mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 12:16:37 +09:00
Spell Check and Lua Check
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
--- Sends messages in chat in resposce to other messages
|
||||
--- Sends messages in chat in response to other messages
|
||||
-- @module ExpGamingBot.autoChat
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
-- @alias ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Server = require('ExpGamingCore.Server')
|
||||
local Role -- ExpGamingCore.Role@^4.0.0
|
||||
|
||||
-- Local Varibles
|
||||
-- Local Variables
|
||||
-- lots of these are jokes, but some have uses
|
||||
|
||||
-- white spaces removed and made into lower
|
||||
@@ -34,12 +34,12 @@ local messages = {
|
||||
}
|
||||
-- white spaces removed and made into lower
|
||||
-- these are global chat commands that can be used
|
||||
-- comands start with ! (all messages are also commands)
|
||||
-- commands start with ! (all messages are also commands)
|
||||
local command_syntax = '!'
|
||||
local commands = {
|
||||
['online']=function(player) return {'ExpGamingBot-autoChat.players-online',#game.connected_players} end,
|
||||
['playtime']=function(player) return {'ExpGamingBot-autoChat.map-time',tick_to_display_format(game.tick)} end,
|
||||
['players']=function(player) return {'ExpGamingBot-autoChat.players',#game.players} end,
|
||||
['online']=function() return {'ExpGamingBot-autoChat.players-online',#game.connected_players} end,
|
||||
['playtime']=function() return {'ExpGamingBot-autoChat.map-time',tick_to_display_format(game.tick)} end,
|
||||
['players']=function() return {'ExpGamingBot-autoChat.players',#game.players} end,
|
||||
['dev']={'ExpGamingBot-autoChat.not-real-dev'},
|
||||
['blame']=function(player) local names = {'Cooldude2606','arty714','badgamernl',player.name} return {'ExpGamingBot-autoChat.blame',names[math.random(#names)]} end,
|
||||
['readme']={'ExpGamingBot-autoChat.read-readme'},
|
||||
@@ -49,15 +49,17 @@ local commands = {
|
||||
['lenny']={'ExpGamingBot-autoChat.lenny'},
|
||||
['feedback']={'ExpGamingBot-autoChat.feedback'},
|
||||
['wiki']={'ExpGamingBot-autoChat.wiki'},
|
||||
['hodor']=function(player) local options = {'?','.','!','!!!'} return {'ExpGamingBot-autoChat.hodor',options[math.random(#options)]} end,
|
||||
['evolution']=function(player) return {'ExpGamingBot-autoChat.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end,
|
||||
['hodor']=function() local options = {'?','.','!','!!!'} return {'ExpGamingBot-autoChat.hodor',options[math.random(#options)]} end,
|
||||
['evolution']=function() return {'ExpGamingBot-autoChat.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end,
|
||||
--Jokes about food and drink
|
||||
['whattoeat']={'ExpGamingBot-autoChat.food'},
|
||||
|
||||
['makepopcorn']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-popcorn-2',self.data}} end
|
||||
end):open() return {'ExpGamingBot-autoChat.get-popcorn-1'} end,
|
||||
|
||||
['orderpizza']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
|
||||
}:on_event('timeout',function(self)
|
||||
@@ -66,6 +68,7 @@ local commands = {
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'ExpGamingBot-autoChat.order-pizza-1'} end,
|
||||
|
||||
['passsomesnaps']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
|
||||
}:on_event('timeout',function(self)
|
||||
@@ -74,6 +77,7 @@ local commands = {
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'ExpGamingBot-autoChat.get-snaps-1'} end,
|
||||
|
||||
['makecocktail']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
|
||||
}:on_event('timeout',function(self)
|
||||
@@ -82,11 +86,13 @@ local commands = {
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'ExpGamingBot-autoChat.get-cocktail-1'} end,
|
||||
|
||||
['makecoffee']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-coffee-2',self.data}} end
|
||||
end):open() return {'ExpGamingBot-autoChat.make-coffee-1'} end,
|
||||
|
||||
['orderpizza']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
|
||||
}:on_event('timeout',function(self)
|
||||
@@ -95,21 +101,25 @@ local commands = {
|
||||
end
|
||||
self.data[2]=self.data[2] + 1
|
||||
end):open() return {'ExpGamingBot-autoChat.order-pizza-1'} end,
|
||||
|
||||
['maketea']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-tea-2',self.data}} end
|
||||
end):open() return {'ExpGamingBot-autoChat.make-tea-1'} end,
|
||||
|
||||
['popcorn']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-popcorn-2',self.data}} end
|
||||
end):open() return {'ExpGamingBot-autoChat.get-popcorn-1'} end,
|
||||
|
||||
['meadplease']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-mead-2',self.data}} end
|
||||
end):open() return {'ExpGamingBot-autoChat.get-mead-1'} end,
|
||||
|
||||
['passabeer']=function(player) Server.new_thread{
|
||||
timeout=math.floor(180*(math.random()+0.5)),data=player.name
|
||||
}:on_event('timeout',function(self)
|
||||
@@ -153,4 +163,4 @@ script.on_event(defines.events.on_console_chat,function(event)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
return ThisModule
|
||||
@@ -2,7 +2,7 @@
|
||||
-- @module ExpGamingBot.autoMessage
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
-- @alias ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Server = require('ExpGamingCore.Server')
|
||||
@@ -10,7 +10,7 @@ local Game = require('FactorioStdLib.Game')
|
||||
local Role -- ExpGamingCore.Role@4.0.0
|
||||
local Sync -- ExpGamingCore.Sync@4.0.0
|
||||
|
||||
-- Local Varibles
|
||||
-- Local Variables
|
||||
|
||||
-- Module Define
|
||||
local module_verbose = false
|
||||
@@ -25,7 +25,7 @@ local ThisModule = {
|
||||
}
|
||||
|
||||
-- Event Handlers Define
|
||||
script.on_init(function(event)
|
||||
script.on_init(function()
|
||||
Server.new_thread{
|
||||
name='auto-message',
|
||||
timeout=54000, -- 3240000 = 15 hours dont make the mistake i did, 54000 is 15 minutes
|
||||
@@ -54,13 +54,12 @@ script.on_init(function(event)
|
||||
local data = self.data
|
||||
if not data.high_role or not data.low_role
|
||||
or not data.low then self.reopen = false return end
|
||||
-- idk but this stoped working for no appent reason so i added more checks for nil values
|
||||
if Role and Role.get_highest(player).index <= Role.get(data.low_role).index or player.admin then return end
|
||||
for _,message in pairs(data.low) do
|
||||
player_return({'ExpGamingBot-autoMessage.message',message},nil,player)
|
||||
end
|
||||
end):on_event('error',function(self,err)
|
||||
if Sync then Sync.emit_embeded{
|
||||
if Sync then Sync.emit_embedded{
|
||||
title='Auto Message Error',
|
||||
color=Color.to_hex(defines.textcolor.bg),
|
||||
description='Auto Message Error - Closed Thread',
|
||||
@@ -72,4 +71,4 @@ script.on_init(function(event)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
return ThisModule
|
||||
@@ -2,7 +2,7 @@
|
||||
-- @module ExpGamingBot.discordAlerts@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
-- @alias ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Sync = require('ExpGamingCore.Sync')
|
||||
@@ -23,7 +23,7 @@ script.on_event(defines.events.on_console_command,function(event)
|
||||
data.by = event.player_index and game.players[event.player_index].name or '<server>'
|
||||
if data.by == '<server>' then return end
|
||||
if command == 'config' or command == 'banlist' then
|
||||
Sync.emit_embeded{
|
||||
Sync.emit_embedded{
|
||||
title='Edit To '..data.title,
|
||||
color=Color.to_hex(defines.textcolor.bg),
|
||||
description='A player edited the '..command..'.',
|
||||
@@ -48,7 +48,7 @@ script.on_event(defines.events.on_console_command,function(event)
|
||||
if not Game.get_player(data.username) then return end
|
||||
if string.sub(command,-1) == 'e' then data.command = command..'d' else data.command = command..'ed' end
|
||||
data.reason = data.reason and data.reason ~= '' and data.reason or 'No Reason Required'
|
||||
Sync.emit_embeded{
|
||||
Sync.emit_embedded{
|
||||
title='Player '..data.title,
|
||||
color=data.colour,
|
||||
description='There was a player '..data.command..'.',
|
||||
@@ -60,4 +60,4 @@ script.on_event(defines.events.on_console_command,function(event)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
return ThisModule
|
||||
Reference in New Issue
Block a user