All File Upto ExpGamingBot follow bolier print

This commit is contained in:
Cooldude2606
2018-09-14 21:25:28 +01:00
parent 6e129c77c5
commit 4392671ce2
29 changed files with 301 additions and 160 deletions

View File

@@ -1,6 +1,10 @@
--- Adds a better method of player starting items based on production levels.
-- @module AdvancedStartingItems@4.0.0
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
-- made by cooldude - this just allows condidtions on stating items and custom ammounts to be added, ie more iron made means more starting iron -- Local Varibles
local items = { local items = {
['iron-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 8 else return (made*10)/math.pow(tick_to_min(game.tick),2) end end, ['iron-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 8 else return (made*10)/math.pow(tick_to_min(game.tick),2) end end,
['copper-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 0 else return (made*8)/math.pow(tick_to_min(game.tick),2) end end, ['copper-plate']=function(player,made) if tick_to_min(game.tick) < 5 then return 0 else return (made*8)/math.pow(tick_to_min(game.tick),2) end end,
@@ -18,15 +22,24 @@ local items = {
['iron-axe']=function(player,made) if made > 5 and player.force.item_production_statistics.get_input_count('steel-axe') <= 5 then return 1 else return 0 end end, ['iron-axe']=function(player,made) if made > 5 and player.force.item_production_statistics.get_input_count('steel-axe') <= 5 then return 1 else return 0 end end,
['steel-axe']=function(player,made) if made > 5 then return 1 else return 0 end end ['steel-axe']=function(player,made) if made > 5 then return 1 else return 0 end end
} }
-- Module Define
local module_verbose = false
local ThisModule = {}
-- Event Handlers Define
Event.register(defines.events.on_player_created, function(event) Event.register(defines.events.on_player_created, function(event)
local player = game.players[event.player_index] local player = game.players[event.player_index]
if event.player_index == 1 then if event.player_index == 1 then
player.force.friendly_fire = false player.force.friendly_fire = false
game.map_settings.enemy_expansion.enabled = false game.map_settings.enemy_expansion.enabled = false
player.force.chart(player.surface, {{player.position.x - 400, player.position.y - 400}, {player.position.x + 400, player.position.y + 400}}) player.force.chart(player.surface, {{player.position.x - 400, player.position.y - 400}, {player.position.x + 400, player.position.y + 400}})
end end
for item,count in pairs(items) do for item,count in pairs(items) do
if type(count) == 'function' then count = math.floor(count(player,player.force.item_production_statistics.get_input_count(item))) end if type(count) == 'function' then count = math.floor(count(player,player.force.item_production_statistics.get_input_count(item))) end
if count > 0 then player.insert{name=item, count=count} end if count > 0 then player.insert{name=item, count=count} end
end end
end) end)
-- Module Return
return ThisModule

View File

@@ -0,0 +1,20 @@
{
"name": "AdvancedStartingItems",
"version": "4.0.0",
"type": "Module",
"description": "Adds a better method of player starting items based on production levels.",
"location": "<blank>",
"keywords": [
"Inventory",
"Start",
"Items",
"Player",
"Advanced",
"Useful",
"Balaced"
],
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
"dependencies": {}
}

View File

@@ -1,5 +1,19 @@
-- made by cooldude - this just adds a marker to the map which is removed when the body is removed --- Adds markers to the map when a player dies and removes it when the body is removed.
-- @module DeathMarkers@4.0.0
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
-- Module Define
local module_verbose = false
local ThisModule = {}
-- Global Define
local global = global{
corpses={}
}
-- Event Handlers Define
Event.register(defines.events.on_player_died, function(event) Event.register(defines.events.on_player_died, function(event)
local player = game.players[event.player_index] local player = game.players[event.player_index]
local tag = player.force.add_chart_tag(player.surface,{ local tag = player.force.add_chart_tag(player.surface,{
@@ -25,4 +39,7 @@ Event.register(defines.events.on_tick, function(event)
end end
key=key+1 key=key+1
end end
end) end)
-- Module Return
return ThisModule

View File

@@ -0,0 +1,17 @@
{
"name": "DeathMarkers",
"version": "4.0.0",
"type": "Module",
"description": "Adds markers to the map when a player dies and removes it when the body is removed.",
"location": "<blank>",
"keywords": [
"Death",
"Marker",
"Body",
"Map"
],
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
"dependencies": {}
}

View File

@@ -1,13 +1,23 @@
--[[ --- Allows control over decon rights, if ExpGamingCore.Ranking is not installed it will allow admins to instant remove trees and thats it.
Explosive Gaming -- @module DeconControl@4.0.0
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
This file can be used with permission but this and the credit below must remain in the file. -- Module Require
Contact a member of management on our discord to seek permission to use our code. local Game = require('FactorioStdLib.Game@^0.8.0')
Any changes that you may make to the code are yours but that does not make the script yours. local Server = require('ExpGamingCore.Server@^4.0.0')
Discord: https://discord.gg/r6dC2uK local Ranking -- ExpGamingCore.Ranking@^4.0.0
]]
--Please Only Edit Below This Line-----------------------------------------------------------
-- Module Define
local module_verbose = false
local ThisModule = {
on_init=function()
if loaded_modules['ExpGamingCore.Ranking@^4.0.0'] then Ranking = require('ExpGamingCore.Ranking@^4.0.0') end
end
}
-- Event Handlers Define
Event.register(-1,function(event) Event.register(-1,function(event)
Server.new_thread{ Server.new_thread{
name='tree-decon', name='tree-decon',
@@ -25,10 +35,15 @@ Event.register(-1,function(event)
if not chache then if not chache then
local player = Game.get_player(event) local player = Game.get_player(event)
if not player then return end if not player then return end
local rank = Ranking.get_rank(player) if not Ranking then
if rank:allowed('tree-decon') then self.data.chache[event.player_index] = {'tree-decon',false} if player.admin then self.data.chache[event.player_index] = {'tree-decon',false}
elseif not rank:allowed('decon') then self.data.chache[event.player_index] = {'no-decon',false} else self.data.chache[event.player_index] = {'decon',false} end
else self.data.chache[event.player_index] = {'decon',false} end else
local rank = Ranking.get_rank(player)
if rank:allowed('tree-decon') then self.data.chache[event.player_index] = {'tree-decon',false}
elseif not rank:allowed('decon') then self.data.chache[event.player_index] = {'no-decon',false}
else self.data.chache[event.player_index] = {'decon',false} end
end
chache = self.data.chache[event.player_index] chache = self.data.chache[event.player_index]
end end
if not event.entity.last_user or event.entity.name == 'entity-ghost' then if not event.entity.last_user or event.entity.name == 'entity-ghost' then
@@ -45,10 +60,13 @@ Event.register(-1,function(event)
player_return({'tree-decon.player-print'},defines.textcolor.crit,player) player_return({'tree-decon.player-print'},defines.textcolor.crit,player)
local rank = Ranking.get_group('Admin').lowest local rank = Ranking.get_group('Admin').lowest
Ranking.print(rank,{'tree-decon.rank-print',player.name},defines.textcolor.info) Ranking.print(rank,{'tree-decon.rank-print',player.name},defines.textcolor.info)
Admin.give_warning(player,'<server>','Trying To Decon The Base') if Admin then Admin.give_warning(player,'<server>','Trying To Decon The Base') end
end end
self.data.clear = game.tick + 10 self.data.clear = game.tick + 10
end end
end end
end):open() end):open()
end) end)
-- Module Return
return ThisModule

View File

@@ -0,0 +1,25 @@
{
"name": "DeconControl",
"version": "4.0.0",
"type": "Module",
"description": "Allows control over decon rights, if ExpGamingCore.Ranking is not installed it will allow admins to instant remove trees and thats it.",
"location": "<blank>",
"keywords": [
"Trees",
"Decon",
"Protection",
"Admin",
"Tool",
"Report"
],
"author": "Cooldude2606",
"contact": "Discord: Cooldude2606#5241",
"license": "https://github.com/explosivegaming/scenario/blob/master/LICENSE",
"dependencies": {
"ExpGamingCore.Server": "^4.0.0",
"FactorioStdLib.Game": "^0.8.0",
"ExpGamingLib": "^4.0.0",
"ExpGamingAdmin.Warnings": "?^4.0.0",
"ExpGamingCore.Ranking": "?^4.0.0"
}
}

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- The base functions required to make the others work.
-- @module ExpGamingAdmin.AdminLib@4.0.0 -- @module ExpGamingAdmin.AdminLib@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais Admin -- @alais Admin
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a custom ban function to the admin command set.
-- @module ExpGamingAdmin.Ban@4.0.0 -- @module ExpGamingAdmin.Ban@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a function to clear a players inventoy and move the items to spawn.
-- @module ExpGamingAdmin.ClearInventory@4.0.0 -- @module ExpGamingAdmin.ClearInventory@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a gui that can be used to access all the admin commands.
-- @module ExpGamingAdmin.Gui@4.0.0 -- @module ExpGamingAdmin.Gui@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais AdminGui -- @alais AdminGui
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a jail function to the admin set, require ExpGamingRanking to work.
-- @module ExpGamingAdmin.Jail@4.0.0 -- @module ExpGamingAdmin.Jail@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a kick function to the admin function set.
-- @module ExpGamingAdmin.Kick@4.0.0 -- @module ExpGamingAdmin.Kick@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a report system into the game that can also push notifactions to discord.
-- @module ThisModule@X.Y.Z -- @module ExpGamingAdmin.Reports@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds three function to admin: tp, bring and go to, these all move the player
-- @module ExpGamingAdmin.Jail@4.0.0 -- @module ExpGamingAdmin.Teleport@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a temp ban function to the admin set, requires ExpGamingCore.Ranking to work.
-- @module ExpGamingAdmin.Kick@4.0.0 -- @module ExpGamingAdmin.KicTempBan@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -1,7 +1,7 @@
--- Desction <get from json> --- Adds a warning system into the admin set which can be used by admins and the script.
-- @module ThisModule@X.Y.Z -- @module ExpGamingAdmin.Warnings@4.0.0
-- @author <get from json> -- @author Cooldude2606
-- @license <get from json> -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require

View File

@@ -2,110 +2,122 @@
-- @module ExpGamingBot.autoChat -- @module ExpGamingBot.autoChat
-- @author Cooldude2606 -- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
local Game = require('FactorioStdLib.Game') -- Module Require
local Ranking local Game = require('FactorioStdLib.Game@^0.8.0')
local Ranking -- ExpGamingCore.Ranking@^4.0.0
-- Local Varibles
-- lots of these are jokes, but some have uses -- lots of these are jokes, but some have uses
-- white spaces removed and made into lower -- white spaces removed and made into lower
-- these messages are sent only to the player -- these messages are sent only to the player
local messages = { local messages = {
['discord']={'chat-bot.discord'}, ['discord']={'ExpGamingBot-autoChat.discord'},
['expgaming']={'chat-bot.website'}, ['expgaming']={'ExpGamingBot-autoChat.website'},
['website']={'chat-bot.website'}, ['website']={'ExpGamingBot-autoChat.website'},
['command']={'chat-bot.custom-commands'}, ['command']={'ExpGamingBot-autoChat.custom-commands'},
['commands']={'chat-bot.custom-commands'}, ['commands']={'ExpGamingBot-autoChat.custom-commands'},
['softmod']={'chat-bot.softmod'}, ['softmod']={'ExpGamingBot-autoChat.softmod'},
['script']={'chat-bot.softmod'}, ['script']={'ExpGamingBot-autoChat.softmod'},
['link']={'chat-bot.links'}, ['link']={'ExpGamingBot-autoChat.links'},
['links']={'chat-bot.links'}, ['links']={'ExpGamingBot-autoChat.links'},
['loop']={'chat-bot.loops'}, ['loop']={'ExpGamingBot-autoChat.loops'},
['loops']={'chat-bot.loops'}, ['loops']={'ExpGamingBot-autoChat.loops'},
['rhd']={'chat-bot.lhd'}, ['rhd']={'ExpGamingBot-autoChat.lhd'},
['roundabout']={'chat-bot.loops'}, ['roundabout']={'ExpGamingBot-autoChat.loops'},
['roundabouts']={'chat-bot.loops'}, ['roundabouts']={'ExpGamingBot-autoChat.loops'},
['redmew']={'chat-bot.redmew'}, ['redmew']={'ExpGamingBot-autoChat.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 ['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 {'ExpGamingBot-autoChat.afk',max.name,tick_to_display_format(max.afk_time)} end
} }
-- white spaces removed and made into lower -- white spaces removed and made into lower
-- these are global chat commands that can be used -- these are global chat commands that can be used
-- comands start with ! (all messages are also commands) -- comands start with ! (all messages are also commands)
local command_syntax = '!' local command_syntax = '!'
local commands = { local commands = {
['online']=function(player) return {'chat-bot.players-online',#game.connected_players} end, ['online']=function(player) return {'ExpGamingBot-autoChat.players-online',#game.connected_players} end,
['playtime']=function(player) return {'chat-bot.map-time',tick_to_display_format(game.tick)} end, ['playtime']=function(player) return {'ExpGamingBot-autoChat.map-time',tick_to_display_format(game.tick)} end,
['players']=function(player) return {'chat-bot.players',#game.players} end, ['players']=function(player) return {'ExpGamingBot-autoChat.players',#game.players} end,
['dev']={'chat-bot.not-real-dev'}, ['dev']={'ExpGamingBot-autoChat.not-real-dev'},
['blame']=function(player) local names = {'Cooldude2606','arty714','badgamernl',player.name} return {'chat-bot.blame',names[math.random(#names)]} end, ['blame']=function(player) local names = {'Cooldude2606','arty714','badgamernl',player.name} return {'ExpGamingBot-autoChat.blame',names[math.random(#names)]} end,
['readme']={'chat-bot.read-readme'}, ['readme']={'ExpGamingBot-autoChat.read-readme'},
['magic']={'chat-bot.magic'}, ['magic']={'ExpGamingBot-autoChat.magic'},
['aids']={'chat-bot.aids'}, ['aids']={'ExpGamingBot-autoChat.aids'},
['riot']={'chat-bot.riot'}, ['riot']={'ExpGamingBot-autoChat.riot'},
['lenny']={'chat-bot.lenny'}, ['lenny']={'ExpGamingBot-autoChat.lenny'},
['wiki']={'chat-bot.wiki'}, ['wiki']={'ExpGamingBot-autoChat.wiki'},
['evolution']=function(player) return {'chat-bot.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end, ['evolution']=function(player) return {'ExpGamingBot-autoChat.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end,
--Jokes about food and drink --Jokes about food and drink
['whattoeat']={'chat-bot.food'}, ['whattoeat']={'ExpGamingBot-autoChat.food'},
['makepopcorn']=function(player) Server.new_thread{ ['makepopcorn']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data=player.name timeout=math.floor(180*(math.random()+0.5)),data=player.name
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data then game.print{'chat-bot.message',{'chat-bot.get-popcorn-2',self.data}} end if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-popcorn-2',self.data}} end
end):open() return {'chat-bot.get-popcorn-1'} end, end):open() return {'ExpGamingBot-autoChat.get-popcorn-1'} end,
['orderpizza']=function(player) Server.new_thread{ ['orderpizza']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.order-pizza-2',self.data[1]}} if self.data[2]==0 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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 elseif self.data[2]==1 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.order-pizza-3',self.data[1]}} self.reopen = false
end end
self.data[2]=self.data[2]+1 self.data[2]=self.data[2]+1
end):open() return {'chat-bot.order-pizza-1'} end, end):open() return {'ExpGamingBot-autoChat.order-pizza-1'} end,
['passsomesnaps']=function(player) Server.new_thread{ ['passsomesnaps']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.get-snaps-2',self.data[1]}} if self.data[2]==0 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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 elseif self.data[2]==1 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-snaps-3',self.data[1]}} self.reopen = false
end end
self.data[2]=self.data[2]+1 self.data[2]=self.data[2]+1
end):open() return {'chat-bot.get-snaps-1'} end, end):open() return {'ExpGamingBot-autoChat.get-snaps-1'} end,
['makecocktail']=function(player) Server.new_thread{ ['makecocktail']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.get-cocktail-2',self.data[1]}} if self.data[2]==0 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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 elseif self.data[2]==1 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-cocktail-3',self.data[1]}} self.reopen = false
end end
self.data[2]=self.data[2]+1 self.data[2]=self.data[2]+1
end):open() return {'chat-bot.get-cocktail-1'} end, end):open() return {'ExpGamingBot-autoChat.get-cocktail-1'} end,
['makecoffee']=function(player) Server.new_thread{ ['makecoffee']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data=player.name timeout=math.floor(180*(math.random()+0.5)),data=player.name
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data then game.print{'chat-bot.message',{'chat-bot.make-coffee-2',self.data}} end if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-coffee-2',self.data}} end
end):open() return {'chat-bot.make-coffee-1'} end, end):open() return {'ExpGamingBot-autoChat.make-coffee-1'} end,
['orderpizza']=function(player) Server.new_thread{ ['orderpizza']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true timeout=math.floor(180*(math.random()+0.5)),data={player.name,0}, reopen=true
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data[2]==0 then game.print{'chat-bot.message',{'chat-bot.order-pizza-2',self.data[1]}} if self.data[2]==0 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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 elseif self.data[2]==1 then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.order-pizza-3',self.data[1]}} self.reopen = false
end end
self.data[2]=self.data[2] + 1 self.data[2]=self.data[2] + 1
end):open() return {'chat-bot.order-pizza-1'} end, end):open() return {'ExpGamingBot-autoChat.order-pizza-1'} end,
['maketea']=function(player) Server.new_thread{ ['maketea']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data=player.name timeout=math.floor(180*(math.random()+0.5)),data=player.name
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data then game.print{'chat-bot.message',{'chat-bot.make-tea-2',self.data}} end if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-tea-2',self.data}} end
end):open() return {'chat-bot.make-tea-1'} end, end):open() return {'ExpGamingBot-autoChat.make-tea-1'} end,
['meadplease']=function(player) Server.new_thread{ ['meadplease']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data=player.name timeout=math.floor(180*(math.random()+0.5)),data=player.name
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data then game.print{'chat-bot.message',{'chat-bot.get-mead-2',self.data}} end if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-mead-2',self.data}} end
end):open() return {'chat-bot.get-mead-1'} end, end):open() return {'ExpGamingBot-autoChat.get-mead-1'} end,
['passabeer']=function(player) Server.new_thread{ ['passabeer']=function(player) Server.new_thread{
timeout=math.floor(180*(math.random()+0.5)),data=player.name timeout=math.floor(180*(math.random()+0.5)),data=player.name
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
if self.data then game.print{'chat-bot.message',{'chat-bot.get-beer-2',self.data}} end if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-beer-2',self.data}} end
end):open() return {'chat-bot.get-beer-1'} end end):open() return {'ExpGamingBot-autoChat.get-beer-1'} end
} }
-- Module Define
local module_verbose = false
local ThisModule = {
on_init=function()
if loaded_modules['ExpGamingCore.Ranking@^4.0.0'] then Ranking = require('ExpGamingCore.Ranking@^4.0.0') end
end
}
-- Event Handlers Define
script.on_event(defines.events.on_console_chat,function(event) script.on_event(defines.events.on_console_chat,function(event)
local player = Game.get_player(event) local player = Game.get_player(event)
if not player then return end if not player then return end
@@ -115,25 +127,22 @@ script.on_event(defines.events.on_console_chat,function(event)
if player_message:match(command_syntax..to_find) then if player_message:match(command_syntax..to_find) then
if allowed then if allowed then
if is_type(message,'function') then message=message(player) end if is_type(message,'function') then message=message(player) end
game.print{'chat-bot.message',message} game.print{'ExpGamingBot-autoChat.message',message}
else player_return({'chat-bot.rank-error'},nil,player) end else player_return({'ExpGamingBot-autoChat.rank-error'},nil,player) end
elseif player_message:match(to_find) then elseif player_message:match(to_find) then
if is_type(message,'function') then message=message(player) end if is_type(message,'function') then message=message(player) end
player_return({'chat-bot.message',message},nil,player) player_return({'ExpGamingBot-autoChat.message',message},nil,player)
end end
end end
for to_find,message in pairs(commands) do for to_find,message in pairs(commands) do
if player_message:match(command_syntax..to_find) then if player_message:match(command_syntax..to_find) then
if allowed then if allowed then
if is_type(message,'function') then message=message(player) end if is_type(message,'function') then message=message(player) end
game.print{'chat-bot.message',message} game.print{'ExpGamingBot-autoChat.message',message}
else player_return({'chat-bot.rank-error'},nil,player) end else player_return({'ExpGamingBot-autoChat.rank-error'},nil,player) end
end end
end end
end) end)
return { -- Module Return
on_init = function(self) return ThisModule
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
end
}

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoChat]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
rank-error=You cant use global chat commands rank-error=You cant use global chat commands
players-online=There are __1__ players online players-online=There are __1__ players online

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoChat]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
rank-error=You can't use global chat commands rank-error=You can't use global chat commands
players-online=There are __1__ players online players-online=There are __1__ players online

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoChat]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
rank-error=You cant use global chat commands rank-error=You cant use global chat commands
players-online=There are __1__ players online players-online=There are __1__ players online

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoChat]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
rank-error=You cant use global chat commands rank-error=You cant use global chat commands
players-online=There are __1__ players online players-online=There are __1__ players online

View File

@@ -1,5 +1,5 @@
[chat-bot] [ExpGamingBot-autoChat]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
rank-error=Du kan inte utföra globala chat-kommandon. rank-error=Du kan inte utföra globala chat-kommandon.
players-online=Det är __1__ spelare online players-online=Det är __1__ spelare online

View File

@@ -1,13 +1,30 @@
--- Sends messages in chat in resposce to other messages --- Prints a message every 15 minutes to chat.
-- @module ExpGamingBot.autoChat -- @module ExpGamingBot.autoMessage
-- @author Cooldude2606 -- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule
-- Module Require
local Server = require('ExpGamingCore.Server') local Server = require('ExpGamingCore.Server')
local Game = require('FactorioStdLib.Game') local Game = require('FactorioStdLib.Game')
local Ranking local Ranking -- ExpGamingCore.Ranking@4.0.0
local Sync local Sync -- ExpGamingCore.Sync@4.0.0
-- Local Varibles
-- Module Define
local module_verbose = false
local ThisModule = {
on_init=function()
if loaded_modules['ExpGamingCore.Ranking@^4.0.0'] then Ranking = require('ExpGamingCore.Ranking@^4.0.0') end
if loaded_modules['ExpGamingCore.Sync@^4.0.0'] then Sync = require('ExpGamingCore.Sync@^4.0.0') end
end,
on_post=function()
--code
end
}
-- Event Handlers Define
script.on_init(function(event) script.on_init(function(event)
Server.new_thread{ Server.new_thread{
name='auto-message', name='auto-message',
@@ -17,19 +34,19 @@ script.on_init(function(event)
high_rank= 'Owner', high_rank= 'Owner',
low_rank= 'Regular', low_rank= 'Regular',
low={ low={
{'chat-bot.join-us'}, {'ExpGamingBot-autoMessage.join-us'},
{'chat-bot.discord'}, {'ExpGamingBot-autoMessage.discord'},
{'chat-bot.website'}, {'ExpGamingBot-autoMessage.website'},
{'chat-bot.custom-commands'}, {'ExpGamingBot-autoMessage.custom-commands'},
{'chat-bot.read-readme'} {'ExpGamingBot-autoMessage.read-readme'}
} }
} }
}:on_event('timeout',function(self) }:on_event('timeout',function(self)
local data = self.data local data = self.data
if not data.high_rank or not data.low_rank if not data.high_rank or not data.low_rank
or not data.low then self.reopen = false return end or not data.low then self.reopen = false return end
game.print{'chat-bot.message',{'chat-bot.players-online',#game.connected_players}} game.print{'ExpGamingBot-autoMessage.message',{'ExpGamingBot-autoMessage.players-online',#game.connected_players}}
game.print{'chat-bot.message',{'chat-bot.map-time',tick_to_display_format(game.tick)}} game.print{'ExpGamingBot-autoMessage.message',{'ExpGamingBot-autoMessage.map-time',tick_to_display_format(game.tick)}}
self.reopen = true self.reopen = true
end):on_event(defines.events.on_player_joined_game,function(self,event) end):on_event(defines.events.on_player_joined_game,function(self,event)
local player = Game.get_player(event) local player = Game.get_player(event)
@@ -40,7 +57,7 @@ script.on_init(function(event)
-- idk but this stoped working for no appent reason so i added more checks for nil values -- idk but this stoped working for no appent reason so i added more checks for nil values
if Ranking and Ranking.get_rank(player).power <= Ranking.get_rank(data.low_rank).power or player.admin then return end if Ranking and Ranking.get_rank(player).power <= Ranking.get_rank(data.low_rank).power or player.admin then return end
for _,message in pairs(data.low) do for _,message in pairs(data.low) do
player_return({'chat-bot.message',message},nil,player) player_return({'ExpGamingBot-autoMessage.message',message},nil,player)
end end
end):on_event('error',function(self,err) end):on_event('error',function(self,err)
if Sync then Sync.emit_embeded{ if Sync then Sync.emit_embeded{
@@ -54,9 +71,5 @@ script.on_init(function(event)
end):open() end):open()
end) end)
return { -- Module Return
on_init = function(self) return ThisModule
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
if loaded_modules['ExpGamingCore.Sync'] then Sync = require('ExpGamingCore.Sync') end
end
}

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoMessage]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
players-online=There are __1__ players online players-online=There are __1__ players online
map-time=This map has been on for __1__ map-time=This map has been on for __1__

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoMessage]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
players-online=There are __1__ players online players-online=There are __1__ players online
map-time=This map has been on for __1__ map-time=This map has been on for __1__

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoMessage]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
players-online=There are __1__ players online players-online=There are __1__ players online
map-time=This map has been on for __1__ map-time=This map has been on for __1__

View File

@@ -1,4 +1,4 @@
[chat-bot] [ExpGamingBot-autoMessage]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
players-online=There are __1__ players online players-online=There are __1__ players online
map-time=This map has been on for __1__ map-time=This map has been on for __1__

View File

@@ -1,5 +1,5 @@
[chat-bot] [ExpGamingBot-autoMessage]
message=[Chat Bot]: __1__ message=[Chat Bot]: __1__
players-online=Det är __1__ spelare online players-online=Det är __1__ spelare online
map-time=Den här kartan har varit igång under __1__ map-time=Den här kartan har varit igång under __1__

View File

@@ -1,14 +1,20 @@
--- Desction <get from json> --- Sends alerts to discord once there is a bot set up to read the alerts.
-- @module ExpGamingBot.discordAlerts@4.0.0 -- @module ExpGamingBot.discordAlerts@4.0.0
-- @author Cooldude2606 -- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE -- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
-- @alais ThisModule -- @alais ThisModule
local Sync = require('ExpGamingCore.Sync') -- Module Require
local Color = require('FactorioStdLib.Color') local Sync = require('ExpGamingCore.Sync@^4.0.0')
local Game = require('FactorioStdLib.Game') local Color = require('FactorioStdLib.Color@^0.8.0')
local Game = require('FactorioStdLib.Game@^0.8.0')
Event.register(defines.events.on_console_command,function(event) -- Module Define
local module_verbose = false
local ThisModule = {}
-- Event Handlers Define
script.on_event(defines.events.on_console_command,function(event)
local command = event.command local command = event.command
local args = {} local args = {}
if event.parameters then for word in event.parameters:gmatch('%S+') do table.insert(args,word) end end if event.parameters then for word in event.parameters:gmatch('%S+') do table.insert(args,word) end end
@@ -51,4 +57,7 @@ Event.register(defines.events.on_console_command,function(event)
['Reason:']=data.reason ['Reason:']=data.reason
} }
end end
end) end)
-- Module Return
return ThisModule