mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
All File Upto ExpGamingBot follow bolier print
This commit is contained in:
@@ -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 = {
|
||||
['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,
|
||||
@@ -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,
|
||||
['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)
|
||||
local player = game.players[event.player_index]
|
||||
if event.player_index == 1 then
|
||||
player.force.friendly_fire = 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}})
|
||||
end
|
||||
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 count > 0 then player.insert{name=item, count=count} end
|
||||
end
|
||||
end)
|
||||
local player = game.players[event.player_index]
|
||||
if event.player_index == 1 then
|
||||
player.force.friendly_fire = 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}})
|
||||
end
|
||||
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 count > 0 then player.insert{name=item, count=count} end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
20
modules/AdvancedStartingItems/softmod.json
Normal file
20
modules/AdvancedStartingItems/softmod.json
Normal 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": {}
|
||||
}
|
||||
@@ -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)
|
||||
local player = game.players[event.player_index]
|
||||
local tag = player.force.add_chart_tag(player.surface,{
|
||||
@@ -25,4 +39,7 @@ Event.register(defines.events.on_tick, function(event)
|
||||
end
|
||||
key=key+1
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
17
modules/DeathMarkers/softmod.json
Normal file
17
modules/DeathMarkers/softmod.json
Normal 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": {}
|
||||
}
|
||||
@@ -1,13 +1,23 @@
|
||||
--[[
|
||||
Explosive Gaming
|
||||
--- Allows control over decon rights, if ExpGamingCore.Ranking is not installed it will allow admins to instant remove trees and thats it.
|
||||
-- @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.
|
||||
Contact a member of management on our discord to seek permission to use our code.
|
||||
Any changes that you may make to the code are yours but that does not make the script yours.
|
||||
Discord: https://discord.gg/r6dC2uK
|
||||
]]
|
||||
--Please Only Edit Below This Line-----------------------------------------------------------
|
||||
-- Module Require
|
||||
local Game = require('FactorioStdLib.Game@^0.8.0')
|
||||
local Server = require('ExpGamingCore.Server@^4.0.0')
|
||||
local Ranking -- ExpGamingCore.Ranking@^4.0.0
|
||||
|
||||
-- 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)
|
||||
Server.new_thread{
|
||||
name='tree-decon',
|
||||
@@ -25,10 +35,15 @@ Event.register(-1,function(event)
|
||||
if not chache then
|
||||
local player = Game.get_player(event)
|
||||
if not player then return end
|
||||
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
|
||||
if not Ranking then
|
||||
if player.admin then self.data.chache[event.player_index] = {'tree-decon',false}
|
||||
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]
|
||||
end
|
||||
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)
|
||||
local rank = Ranking.get_group('Admin').lowest
|
||||
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
|
||||
self.data.clear = game.tick + 10
|
||||
end
|
||||
end
|
||||
end):open()
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
25
modules/DeconControl/softmod.json
Normal file
25
modules/DeconControl/softmod.json
Normal 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"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
--- The base functions required to make the others work.
|
||||
-- @module ExpGamingAdmin.AdminLib@4.0.0
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais Admin
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
--- Adds a custom ban function to the admin command set.
|
||||
-- @module ExpGamingAdmin.Ban@4.0.0
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -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
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -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
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais AdminGui
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -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
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
--- Adds a kick function to the admin function set.
|
||||
-- @module ExpGamingAdmin.Kick@4.0.0
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
-- @module ThisModule@X.Y.Z
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
--- Adds a report system into the game that can also push notifactions to discord.
|
||||
-- @module ExpGamingAdmin.Reports@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
-- @module ExpGamingAdmin.Jail@4.0.0
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
--- Adds three function to admin: tp, bring and go to, these all move the player
|
||||
-- @module ExpGamingAdmin.Teleport@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
-- @module ExpGamingAdmin.Kick@4.0.0
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
--- Adds a temp ban function to the admin set, requires ExpGamingCore.Ranking to work.
|
||||
-- @module ExpGamingAdmin.KicTempBan@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- Desction <get from json>
|
||||
-- @module ThisModule@X.Y.Z
|
||||
-- @author <get from json>
|
||||
-- @license <get from json>
|
||||
--- Adds a warning system into the admin set which can be used by admins and the script.
|
||||
-- @module ExpGamingAdmin.Warnings@4.0.0
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
|
||||
@@ -2,110 +2,122 @@
|
||||
-- @module ExpGamingBot.autoChat
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Ranking
|
||||
-- Module Require
|
||||
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
|
||||
|
||||
-- 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
|
||||
['discord']={'ExpGamingBot-autoChat.discord'},
|
||||
['expgaming']={'ExpGamingBot-autoChat.website'},
|
||||
['website']={'ExpGamingBot-autoChat.website'},
|
||||
['command']={'ExpGamingBot-autoChat.custom-commands'},
|
||||
['commands']={'ExpGamingBot-autoChat.custom-commands'},
|
||||
['softmod']={'ExpGamingBot-autoChat.softmod'},
|
||||
['script']={'ExpGamingBot-autoChat.softmod'},
|
||||
['link']={'ExpGamingBot-autoChat.links'},
|
||||
['links']={'ExpGamingBot-autoChat.links'},
|
||||
['loop']={'ExpGamingBot-autoChat.loops'},
|
||||
['loops']={'ExpGamingBot-autoChat.loops'},
|
||||
['rhd']={'ExpGamingBot-autoChat.lhd'},
|
||||
['roundabout']={'ExpGamingBot-autoChat.loops'},
|
||||
['roundabouts']={'ExpGamingBot-autoChat.loops'},
|
||||
['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 {'ExpGamingBot-autoChat.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,
|
||||
['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,
|
||||
['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'},
|
||||
['magic']={'ExpGamingBot-autoChat.magic'},
|
||||
['aids']={'ExpGamingBot-autoChat.aids'},
|
||||
['riot']={'ExpGamingBot-autoChat.riot'},
|
||||
['lenny']={'ExpGamingBot-autoChat.lenny'},
|
||||
['wiki']={'ExpGamingBot-autoChat.wiki'},
|
||||
['evolution']=function(player) return {'ExpGamingBot-autoChat.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end,
|
||||
--Jokes about food and drink
|
||||
['whattoeat']={'chat-bot.food'},
|
||||
['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{'chat-bot.message',{'chat-bot.get-popcorn-2',self.data}} end
|
||||
end):open() return {'chat-bot.get-popcorn-1'} end,
|
||||
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)
|
||||
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
|
||||
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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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,
|
||||
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)
|
||||
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
|
||||
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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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,
|
||||
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)
|
||||
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
|
||||
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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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,
|
||||
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{'chat-bot.message',{'chat-bot.make-coffee-2',self.data}} end
|
||||
end):open() return {'chat-bot.make-coffee-1'} end,
|
||||
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)
|
||||
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
|
||||
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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.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,
|
||||
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{'chat-bot.message',{'chat-bot.make-tea-2',self.data}} end
|
||||
end):open() return {'chat-bot.make-tea-1'} end,
|
||||
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,
|
||||
['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,
|
||||
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)
|
||||
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
|
||||
if self.data then game.print{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-beer-2',self.data}} 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)
|
||||
local player = Game.get_player(event)
|
||||
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 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
|
||||
game.print{'ExpGamingBot-autoChat.message',message}
|
||||
else player_return({'ExpGamingBot-autoChat.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)
|
||||
player_return({'ExpGamingBot-autoChat.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
|
||||
game.print{'ExpGamingBot-autoChat.message',message}
|
||||
else player_return({'ExpGamingBot-autoChat.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
|
||||
}
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoChat]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoChat]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You can't use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoChat]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoChat]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=You cant use global chat commands
|
||||
players-online=There are __1__ players online
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoChat]
|
||||
message=[Chat Bot]: __1__
|
||||
rank-error=Du kan inte utföra globala chat-kommandon.
|
||||
players-online=Det är __1__ spelare online
|
||||
|
||||
@@ -1,13 +1,30 @@
|
||||
--- Sends messages in chat in resposce to other messages
|
||||
-- @module ExpGamingBot.autoChat
|
||||
--- Prints a message every 15 minutes to chat.
|
||||
-- @module ExpGamingBot.autoMessage
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
-- Module Require
|
||||
local Server = require('ExpGamingCore.Server')
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
local Ranking
|
||||
local Sync
|
||||
local Ranking -- ExpGamingCore.Ranking@4.0.0
|
||||
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)
|
||||
Server.new_thread{
|
||||
name='auto-message',
|
||||
@@ -17,19 +34,19 @@ script.on_init(function(event)
|
||||
high_rank= 'Owner',
|
||||
low_rank= 'Regular',
|
||||
low={
|
||||
{'chat-bot.join-us'},
|
||||
{'chat-bot.discord'},
|
||||
{'chat-bot.website'},
|
||||
{'chat-bot.custom-commands'},
|
||||
{'chat-bot.read-readme'}
|
||||
{'ExpGamingBot-autoMessage.join-us'},
|
||||
{'ExpGamingBot-autoMessage.discord'},
|
||||
{'ExpGamingBot-autoMessage.website'},
|
||||
{'ExpGamingBot-autoMessage.custom-commands'},
|
||||
{'ExpGamingBot-autoMessage.read-readme'}
|
||||
}
|
||||
}
|
||||
}:on_event('timeout',function(self)
|
||||
local data = self.data
|
||||
if not data.high_rank or not data.low_rank
|
||||
or not data.low then self.reopen = false return end
|
||||
game.print{'chat-bot.message',{'chat-bot.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.players-online',#game.connected_players}}
|
||||
game.print{'ExpGamingBot-autoMessage.message',{'ExpGamingBot-autoMessage.map-time',tick_to_display_format(game.tick)}}
|
||||
self.reopen = true
|
||||
end):on_event(defines.events.on_player_joined_game,function(self,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
|
||||
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
|
||||
player_return({'chat-bot.message',message},nil,player)
|
||||
player_return({'ExpGamingBot-autoMessage.message',message},nil,player)
|
||||
end
|
||||
end):on_event('error',function(self,err)
|
||||
if Sync then Sync.emit_embeded{
|
||||
@@ -54,9 +71,5 @@ script.on_init(function(event)
|
||||
end):open()
|
||||
end)
|
||||
|
||||
return {
|
||||
on_init = function(self)
|
||||
if loaded_modules['ExpGamingCore.Ranking'] then Ranking = require('ExpGamingCore.Ranking') end
|
||||
if loaded_modules['ExpGamingCore.Sync'] then Sync = require('ExpGamingCore.Sync') end
|
||||
end
|
||||
}
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoMessage]
|
||||
message=[Chat Bot]: __1__
|
||||
players-online=There are __1__ players online
|
||||
map-time=This map has been on for __1__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoMessage]
|
||||
message=[Chat Bot]: __1__
|
||||
players-online=There are __1__ players online
|
||||
map-time=This map has been on for __1__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoMessage]
|
||||
message=[Chat Bot]: __1__
|
||||
players-online=There are __1__ players online
|
||||
map-time=This map has been on for __1__
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoMessage]
|
||||
message=[Chat Bot]: __1__
|
||||
players-online=There are __1__ players online
|
||||
map-time=This map has been on for __1__
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
[chat-bot]
|
||||
[ExpGamingBot-autoMessage]
|
||||
message=[Chat Bot]: __1__
|
||||
players-online=Det är __1__ spelare online
|
||||
map-time=Den här kartan har varit igång under __1__
|
||||
|
||||
@@ -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
|
||||
-- @author Cooldude2606
|
||||
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
|
||||
-- @alais ThisModule
|
||||
|
||||
local Sync = require('ExpGamingCore.Sync')
|
||||
local Color = require('FactorioStdLib.Color')
|
||||
local Game = require('FactorioStdLib.Game')
|
||||
-- Module Require
|
||||
local Sync = require('ExpGamingCore.Sync@^4.0.0')
|
||||
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 args = {}
|
||||
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
|
||||
}
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Module Return
|
||||
return ThisModule
|
||||
Reference in New Issue
Block a user