From 4d4dfaccfd3cddaf1a81fc2243eb487f9c99f38a Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 29 Sep 2018 23:11:49 +0100 Subject: [PATCH] Few fixes --- modules/ExpGamingBot/autoChat/control.lua | 77 ++++++++++++----------- modules/ExpGamingCore/Role/config.lua | 5 +- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/modules/ExpGamingBot/autoChat/control.lua b/modules/ExpGamingBot/autoChat/control.lua index 3f190077..d615d206 100644 --- a/modules/ExpGamingBot/autoChat/control.lua +++ b/modules/ExpGamingBot/autoChat/control.lua @@ -36,77 +36,84 @@ local messages = { -- comands 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, - ['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, + ['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'}, + ['feedback']={'chat-bot.feedback'}, + ['wiki']={'chat-bot.wiki'}, + ['blame']=function(player) local options = {'?','.','!','!!!'} return {'chat-bot.hodor',options[math.random(#options)]} end, + ['evolution']=function(player) return {'chat-bot.current-evolution',string.format('%.2f',game.forces['enemy'].evolution_factor)} end, --Jokes about food and drink - ['whattoeat']={'ExpGamingBot-autoChat.food'}, + ['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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-popcorn-2',self.data}} end - end):open() return {'ExpGamingBot-autoChat.get-popcorn-1'} end, + 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{'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 + 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 {'ExpGamingBot-autoChat.order-pizza-1'} end, + 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{'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 + 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 {'ExpGamingBot-autoChat.get-snaps-1'} end, + 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{'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 + 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 {'ExpGamingBot-autoChat.get-cocktail-1'} end, + 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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-coffee-2',self.data}} end - end):open() return {'ExpGamingBot-autoChat.make-coffee-1'} end, + 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{'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 + 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 {'ExpGamingBot-autoChat.order-pizza-1'} end, + 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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.make-tea-2',self.data}} end - end):open() return {'ExpGamingBot-autoChat.make-tea-1'} end, + 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, + ['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{'chat-bot.message',{'chat-bot.get-popcorn-2',self.data}} end + end):open() return {'chat-bot.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, + 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{'ExpGamingBot-autoChat.message',{'ExpGamingBot-autoChat.get-beer-2',self.data}} end - end):open() return {'ExpGamingBot-autoChat.get-beer-1'} end + 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 } -- Module Define diff --git a/modules/ExpGamingCore/Role/config.lua b/modules/ExpGamingCore/Role/config.lua index 89cf3533..9fdf1731 100644 --- a/modules/ExpGamingCore/Role/config.lua +++ b/modules/ExpGamingCore/Role/config.lua @@ -151,7 +151,9 @@ Role{ tag='[Partner]', group='HiMember', colour={r=140,g=120,b=200}, - allow={} + allow={ + ['global-chat']=true, + } } Role{ name='Veteran', @@ -163,7 +165,6 @@ Role{ is_varified=true, time=600, -- 10 hours allow={ - ['global-chat']=true, ['tree-decon']=true, ['create-poll']=true, ['repair']=true