mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-28 20:05:22 +09:00
Added ExpGamingBot
This commit is contained in:
139
modules/ExpGamingBot/autoChat/control.lua
Normal file
139
modules/ExpGamingBot/autoChat/control.lua
Normal file
@@ -0,0 +1,139 @@
|
||||
--- Sends messages in chat in resposce to other messages
|
||||
-- @module ExpGamingBot.autoChat
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Ranking
|
||||
|
||||
-- lots of these are jokes, but some have uses
|
||||
|
||||
-- white spaces removed and made into lower
|
||||
-- these messages are sent only to the player
|
||||
local messages = {
|
||||
['discord']={'chat-bot.discord'},
|
||||
['expgaming']={'chat-bot.website'},
|
||||
['website']={'chat-bot.website'},
|
||||
['command']={'chat-bot.custom-commands'},
|
||||
['commands']={'chat-bot.custom-commands'},
|
||||
['softmod']={'chat-bot.softmod'},
|
||||
['script']={'chat-bot.softmod'},
|
||||
['link']={'chat-bot.links'},
|
||||
['links']={'chat-bot.links'},
|
||||
['loop']={'chat-bot.loops'},
|
||||
['loops']={'chat-bot.loops'},
|
||||
['rhd']={'chat-bot.lhd'},
|
||||
['roundabout']={'chat-bot.loops'},
|
||||
['roundabouts']={'chat-bot.loops'},
|
||||
['redmew']={'chat-bot.redmew'},
|
||||
['afk']=function(_player) local max=_player for _,player in pairs(game.connected_players) do if max.afk_time < player.afk_time then max=player end end return {'chat-bot.afk',max.name,tick_to_display_format(max.afk_time)} end
|
||||
}
|
||||
-- white spaces removed and made into lower
|
||||
-- these are global chat commands that can be used
|
||||
-- comands start with ! (all messages are also commands)
|
||||
local command_syntax = '!'
|
||||
local commands = {
|
||||
['online']=function(player) return {'chat-bot.players-online',#game.connected_players} end,
|
||||
['playtime']=function(player) return {'chat-bot.map-time',tick_to_display_format(game.tick)} end,
|
||||
['players']=function(player) return {'chat-bot.players',#game.players} end,
|
||||
['dev']={'chat-bot.not-real-dev'},
|
||||
['blame']=function(player) local names = {'Cooldude2606','arty714','badgamernl',player.name} return {'chat-bot.blame',names[math.random(#names)]} end,
|
||||
['readme']={'chat-bot.read-readme'},
|
||||
['magic']={'chat-bot.magic'},
|
||||
['aids']={'chat-bot.aids'},
|
||||
['riot']={'chat-bot.riot'},
|
||||
['lenny']={'chat-bot.lenny'},
|
||||
['wiki']={'chat-bot.wiki'},
|
||||
['evolution']=function(player) return {'chat-bot.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end,
|
||||
--Jokes about food and drink
|
||||
['whattoeat']={'chat-bot.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{'chat-bot.message',{'chat-bot.get-popcorn-2',self.data}} end
|
||||
end):open() return {'chat-bot.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)
|
||||
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.order-pizza-2',self.data[1]}}
|
||||
elseif self.data[2]==1 then game.print{'chat-bot.message',{'chat-bot.order-pizza-3',self.data[1]}} self.reopen = false
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'chat-bot.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)
|
||||
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.get-snaps-2',self.data[1]}}
|
||||
elseif self.data[2]==1 then game.print{'chat-bot.message',{'chat-bot.get-snaps-3',self.data[1]}} self.reopen = false
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'chat-bot.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)
|
||||
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.get-cocktail-2',self.data[1]}}
|
||||
elseif self.data[2]==1 then game.print{'chat-bot.message',{'chat-bot.get-cocktail-3',self.data[1]}} self.reopen = false
|
||||
end
|
||||
self.data[2]=self.data[2]+1
|
||||
end):open() return {'chat-bot.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{'chat-bot.message',{'chat-bot.make-coffee-2',self.data}} end
|
||||
end):open() return {'chat-bot.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)
|
||||
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.order-pizza-2',self.data[1]}}
|
||||
elseif self.data[2]==1 then game.print{'chat-bot.message',{'chat-bot.order-pizza-3',self.data[1]}} self.reopen = false
|
||||
end
|
||||
self.data[2]=self.data[2] + 1
|
||||
end):open() return {'chat-bot.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{'chat-bot.message',{'chat-bot.make-tea-2',self.data}} end
|
||||
end):open() return {'chat-bot.make-tea-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{'chat-bot.message',{'chat-bot.get-mead-2',self.data}} end
|
||||
end):open() return {'chat-bot.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)
|
||||
if self.data then game.print{'chat-bot.message',{'chat-bot.get-beer-2',self.data}} end
|
||||
end):open() return {'chat-bot.get-beer-1'} end
|
||||
}
|
||||
|
||||
script.on_event(defines.events.on_console_chat,function(event)
|
||||
local player = Game.get_player(event)
|
||||
if not player then return end
|
||||
local player_message = event.message:lower():gsub("%s+", "")
|
||||
local allowed = Ranking and Ranking.get_rank(player):allowed('global-chat') or player.admin
|
||||
for to_find,message in pairs(messages) do
|
||||
if player_message:match(command_syntax..to_find) then
|
||||
if allowed then
|
||||
if is_type(message,'function') then message=message(player) end
|
||||
game.print{'chat-bot.message',message}
|
||||
else player_return({'chat-bot.rank-error'},nil,player) end
|
||||
elseif player_message:match(to_find) then
|
||||
if is_type(message,'function') then message=message(player) end
|
||||
player_return({'chat-bot.message',message},nil,player)
|
||||
end
|
||||
end
|
||||
for to_find,message in pairs(commands) do
|
||||
if player_message:match(command_syntax..to_find) then
|
||||
if allowed then
|
||||
if is_type(message,'function') then message=message(player) end
|
||||
game.print{'chat-bot.message',message}
|
||||
else player_return({'chat-bot.rank-error'},nil,player) end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return {
|
||||
on_init = function(self)
|
||||
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
|
||||
end
|
||||
}
|
||||
20
modules/ExpGamingBot/autoChat/locale/de.cfg
Normal file
20
modules/ExpGamingBot/autoChat/locale/de.cfg
Normal file
@@ -0,0 +1,20 @@
|
||||
[chat-bot]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
players=There have been __1__ players on this map
|
||||
map-time=This map has been on for __1__
|
||||
line-8=Type /help <command> for more info
|
||||
join-us=Please join us on:
|
||||
discord=Discord: https://discord.explosivegaming.nl
|
||||
website=Website: explosivegaming.nl
|
||||
custom-commands=We use custom commands, such as /tag and /report, see the commands tab in readme for more info.
|
||||
read-readme=Make sure you have read the Readme (can be found through the question mark on the top left)
|
||||
not-real-dev=Cooldude2606 is a dev for this server and makes the softmod (look top left) and is not a factorio dev.
|
||||
softmod=A softmod is a custom scenario that runs on this server, example is the player list.
|
||||
blame=Blame __1__ for what just happend!
|
||||
afk=Your afk? Look at __1__ they have been afk for: __2__
|
||||
links=To see links open the readme and click links.
|
||||
magic=Fear the admin magic (ノ゚∀゚)ノ⌒・*:.。. .。.:*・゜゚・*☆
|
||||
aids=≖ ‿ ≖ Fear the aids of a public server ≖ ‿ ≖
|
||||
riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹‹\ ( ´)/››‹‹\ ( ´ω`)/›› (rest of server)
|
||||
47
modules/ExpGamingBot/autoChat/locale/en.cfg
Normal file
47
modules/ExpGamingBot/autoChat/locale/en.cfg
Normal file
@@ -0,0 +1,47 @@
|
||||
[chat-bot]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You can't use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
players=There have been __1__ players on this map
|
||||
map-time=This map has been on for __1__
|
||||
line-8=Type /help <command> for more info
|
||||
join-us=Please join us on:
|
||||
discord=Discord: https://discord.explosivegaming.nl
|
||||
website=Website: https://www.explosivegaming.nl
|
||||
custom-commands=We use custom commands, such as /tag and /report, see the commands tab in readme for more info.
|
||||
read-readme=Make sure you have read the Readme (It can be found through the question mark on the top left)
|
||||
not-real-dev=Cooldude2606 is a dev for this server and makes the softmod (look top left) and is not a factorio dev.
|
||||
softmod=A softmod is a custom scenario that runs on this server, example is the player list.
|
||||
redmew=We dont talk about redmew here; they beat us to 1000 members; F
|
||||
blame=Blame __1__ for what just happend!
|
||||
afk=Your afk? Look at __1__, that player has been afk for: __2__
|
||||
links=To see links open the readme and click links.
|
||||
current-evolution=Current evolution factor is __1__
|
||||
magic=Fear the admin magic (ノ゚∀゚)ノ⌒・*:.。. .。.:*・゜゚・*☆
|
||||
aids=≖ ‿ ≖ Fear the aids of a public server ≖ ‿ ≖
|
||||
riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹‹\ ( ´)/››‹‹\ ( ´ω`)/›› (rest of server)
|
||||
loops=NO LOOPS; LOOPS ARE BAD; JUST NO LOOPS!!!!!; IF YOU MAKE A LOOP.... IT WILL NOT END WELL!!!!!!!
|
||||
lenny=( ͡° ͜ʖ ͡°)
|
||||
make-tea-1= ☕ Boiling the water... ☕
|
||||
make-tea-2= ☕ __1__ your tea is done! ☕
|
||||
order-pizza-1= 🍕 Finding nearest pizza supplier... 🍕
|
||||
order-pizza-2= 🍕 Figuring out the favourite pizza of __1__ 🍕
|
||||
order-pizza-3= 🍕 __1__ your pizza is here! 🍕
|
||||
make-coffee-1= ☕ Boiling the water and grinding the coffee beans... ☕
|
||||
make-coffee-2= ☕ __1__ we ran out of coffe beans! Have some tea instead. ☕
|
||||
get-beer-1= 🍺 Pouring A Glass 🍺
|
||||
get-beer-2= 🍻 Chears Mate 🍻
|
||||
get-mead-1= Filling the drinking horn
|
||||
get-mead-2= Skål!
|
||||
get-snaps-1=Pouring the glasses and finding the correct song book...
|
||||
get-snaps-2=Singing a song...🎤🎶
|
||||
get-snaps-3=skål, my friends!
|
||||
get-cocktail-1= 🍸 Inintiating mind reading unit... 🍸
|
||||
get-cocktail-2= 🍸 Mixing favourite ingredients of __1__ 🍸
|
||||
get-cocktail-3=🍸 __1__ your cocktail is done.🍸
|
||||
lhd=All trains must be LHD!
|
||||
food=Don't know what to make for dinner? Use a random recipe from the random dinner suggestion generator at http://www.whatthefuckshouldimakefordinner.com/
|
||||
get-popcorn-1=Heating the oil and waiting for the popping sound...
|
||||
get-popcorn-2=__1__ your popcorn is finished. Lean backwards and watch the drama unfold.
|
||||
wiki=You can get more information about us and the custom scenario from our wiki: https://wiki.explosivegaming.nl/
|
||||
feedback=Do you have feedback? leave it at https://exp.fider.io/
|
||||
20
modules/ExpGamingBot/autoChat/locale/fr.cfg
Normal file
20
modules/ExpGamingBot/autoChat/locale/fr.cfg
Normal file
@@ -0,0 +1,20 @@
|
||||
[chat-bot]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
players=There have been __1__ players on this map
|
||||
map-time=This map has been on for __1__
|
||||
line-8=Type /help <command> for more info
|
||||
join-us=Please join us on:
|
||||
discord=Discord: https://discord.explosivegaming.nl
|
||||
website=Website: explosivegaming.nl
|
||||
custom-commands=We use custom commands, such as /tag and /report, see the commands tab in readme for more info.
|
||||
read-readme=Make sure you have read the Readme (can be found through the question mark on the top left)
|
||||
not-real-dev=Cooldude2606 is a dev for this server and makes the softmod (look top left) and is not a factorio dev.
|
||||
softmod=A softmod is a custom scenario that runs on this server, example is the player list.
|
||||
blame=Blame __1__ for what just happend!
|
||||
afk=Your afk? Look at __1__ they have been afk for: __2__
|
||||
links=To see links open the readme and click links.
|
||||
magic=Fear the admin magic (ノ゚∀゚)ノ⌒・*:.。. .。.:*・゜゚・*☆
|
||||
aids=≖ ‿ ≖ Fear the aids of a public server ≖ ‿ ≖
|
||||
riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹‹\ ( ´)/››‹‹\ ( ´ω`)/›› (rest of server)
|
||||
20
modules/ExpGamingBot/autoChat/locale/nl.cfg
Normal file
20
modules/ExpGamingBot/autoChat/locale/nl.cfg
Normal file
@@ -0,0 +1,20 @@
|
||||
[chat-bot]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
players=There have been __1__ players on this map
|
||||
map-time=This map has been on for __1__
|
||||
line-8=Type /help <command> for more info
|
||||
join-us=Please join us on:
|
||||
discord=Discord: https://discord.explosivegaming.nl
|
||||
website=Website: explosivegaming.nl
|
||||
custom-commands=We use custom commands, such as /tag and /report, see the commands tab in readme for more info.
|
||||
read-readme=Make sure you have read the Readme (can be found through the question mark on the top left)
|
||||
not-real-dev=Cooldude2606 is a dev for this server and makes the softmod (look top left) and is not a factorio dev.
|
||||
softmod=A softmod is a custom scenario that runs on this server, example is the player list.
|
||||
blame=Blame __1__ for what just happend!
|
||||
afk=Your afk? Look at __1__ they have been afk for: __2__
|
||||
links=To see links open the readme and click links.
|
||||
magic=Fear the admin magic (ノ゚∀゚)ノ⌒・*:.。. .。.:*・゜゚・*☆
|
||||
aids=≖ ‿ ≖ Fear the aids of a public server ≖ ‿ ≖
|
||||
riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹‹\ ( ´)/››‹‹\ ( ´ω`)/›› (rest of server)
|
||||
25
modules/ExpGamingBot/autoChat/locale/sv-SE.cfg
Normal file
25
modules/ExpGamingBot/autoChat/locale/sv-SE.cfg
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
[chat-bot]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=Du kan inte utföra globala chat-kommandon.
|
||||
players-online=Det är __1__ spelare online
|
||||
players=Det har varit __1__ spelare på den här kartan
|
||||
map-time=Den här kartan har varit igång under __1__
|
||||
line-8=Type /help <kommando> för mer information
|
||||
join-us=Var snäll och förena dig med oss:
|
||||
discord=Discord: https://discord.explosivegaming.nl
|
||||
website=Website: explosivegaming.nl
|
||||
custom-commands=Vi använder oss av specialiserade kommandon, som till exempel /tag och /report, se kommandotabben i readme för mer information.
|
||||
read-readme=Se till att du har läst "Readme" (Finn den genom att klicka på frågetecknet högst upp i vänstra hörnet)
|
||||
not-real-dev=Cooldude2606 är dev för den här servern och gör mjukmodden ("the softmod") och är inte en factorio dev.
|
||||
ssoftmod=En mjukmod ("softmod") är ett specialscenario som används på den här servern, exempelvis listan över spelare.
|
||||
blame=Skyll på __1__ för vad som just hände!
|
||||
afk=Är du afk (borta från tangentbordet)? Titta på __1__, den spelaren har varit afk under: __2__
|
||||
links=För att se länkar, öppna readme och klicka "länkar".
|
||||
magic=Frukta admin-magin (ノ゚∀゚)ノ⌒・*:.。. .。.:*・゜゚・*☆
|
||||
aids=≖ ‿ ≖Fear the aids of a public server ≖ ‿ ≖
|
||||
riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹‹\ ( ´)/››‹‹\ ( ´ω`)/›› (rest of server)
|
||||
loops=INGA LOOPAR; LOOPAR ÄR DÅLIGT; JUST INGA LOOPAR!!!!!; OM DU GJÖR EN LOOP.... DET KOMMER INTE ATT SLUTA VÄL!!!!!!!
|
||||
lhd=Alla tåg skall köras med vänstertrafik!
|
||||
current-evolution=Nuvarande evolutionsfaktor är __1__
|
||||
wiki=Du kan få mer information om oss och scenariot på vår wiki: https://wiki.explosivegaming.nl/
|
||||
17
modules/ExpGamingBot/autoChat/softmod.json
Normal file
17
modules/ExpGamingBot/autoChat/softmod.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "autoChat",
|
||||
"version": "4.0.0",
|
||||
"type": "Module",
|
||||
"description": "Sends messages in chat based on what has been said by other players",
|
||||
"location": "<blank>",
|
||||
"keywords": [
|
||||
"Chat",
|
||||
" Bot",
|
||||
" Jokes",
|
||||
" Fun"
|
||||
],
|
||||
"author": "<blank>",
|
||||
"contact": "<blank>",
|
||||
"license": "<blank>",
|
||||
"dependencies": {}
|
||||
}
|
||||
Reference in New Issue
Block a user