From db3515e122f3b6c57655abc8aa1aa1b670f44966 Mon Sep 17 00:00:00 2001 From: sakamakj <38378426+sakamakj@users.noreply.github.com> Date: Mon, 14 May 2018 20:54:03 +0200 Subject: [PATCH 1/5] my messing around with the chat box (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create base-damage.cfg * Update base-damage.cfg * spellfix grievers changed to griefers * Create admin.cfg needs editing * Create announcements.cfg * Update announcements.cfg * needs translatoin * needs translation still in English * needs translation * needs translation * Create inventory-search.cfg * translation fixed not much more to write * translation fixed * needs translation * needs translation * needs translation * needs translation * needs translation * needs translation * needs translation * needs translation * needs translation * translation fixed * unfinishied * Translation mostly fixed Couldnt find the right words to correctly translate the emotions and genuine feelings behind "loops" and #fear the aids", they are so genuine as they are now. * translation fixed * translation fixed * translation fixed * translation fixed * translation fixed * translation fixed * hopefully correctly translated (read my comment) not sure if "not enough credentials" is correctly translated. I supposed you meant not enough security clearance or somthing like that. I could have written (Access denied due to invalid rank= Tillgång nekas på grund av otillräcklig rang) * translation fixed * translation fixed * translation fixed * grammar fix * grammer fix Yeah, I copied the grammar error from original English file and made a similiar error in the swedish version. * spell fix * better grammar * estetical language change * added order pizza * order pizza * fix * Update chat-bot.cfg --- Addons/Admin/auto-chat.lua | 12 ++++++++++-- locale/en/chat-bot.cfg | 5 ++++- locale/sv-SE/chat-bot.cfg | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Addons/Admin/auto-chat.lua b/Addons/Admin/auto-chat.lua index 23da5903..99da5bad 100644 --- a/Addons/Admin/auto-chat.lua +++ b/Addons/Admin/auto-chat.lua @@ -41,7 +41,15 @@ local commands = { ['magic']={'chat-bot.magic'}, ['aids']={'chat-bot.aids'}, ['riot']={'chat-bot.riot'}, - ['lenny']={'chat-bot.lenny'}, + ['lenny']={'chat-bot.lenny'} + ['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]=sel.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) @@ -73,4 +81,4 @@ Event.register(defines.events.on_console_chat,function(event) else player_return({'chat-bot.rank-error'},nil,player) end end end -end) \ No newline at end of file +end) diff --git a/locale/en/chat-bot.cfg b/locale/en/chat-bot.cfg index 8626268c..0388864c 100644 --- a/locale/en/chat-bot.cfg +++ b/locale/en/chat-bot.cfg @@ -21,4 +21,7 @@ riot=(admins) ┬┴┬┴┤ᵒ_ᵒ)├┬┴┬┴ ‹ ‹\(´ω` )/››‹ 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! ☕ \ No newline at end of file +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! 🍕 \ No newline at end of file diff --git a/locale/sv-SE/chat-bot.cfg b/locale/sv-SE/chat-bot.cfg index 3d65d9d2..e35b3b11 100644 --- a/locale/sv-SE/chat-bot.cfg +++ b/locale/sv-SE/chat-bot.cfg @@ -19,4 +19,4 @@ 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!!!!!!! +loops=INGA LOOPAR; LOOPAR ÄR DÅLIGT; JUST INGA LOOPAR!!!!!; OM DU GJÖR EN LOOP.... DET KOMMER INTE ATT SLUTA VÄL!!!!!!! \ No newline at end of file From 5edf3f78709dc5bd83f1c9a4555cacc02caf7475 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Mon, 14 May 2018 19:59:47 +0100 Subject: [PATCH 2/5] Missing a comma --- Addons/Admin/auto-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Addons/Admin/auto-chat.lua b/Addons/Admin/auto-chat.lua index 99da5bad..ca0c3df4 100644 --- a/Addons/Admin/auto-chat.lua +++ b/Addons/Admin/auto-chat.lua @@ -41,7 +41,7 @@ local commands = { ['magic']={'chat-bot.magic'}, ['aids']={'chat-bot.aids'}, ['riot']={'chat-bot.riot'}, - ['lenny']={'chat-bot.lenny'} + ['lenny']={'chat-bot.lenny'}, ['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) From e2a149a3974d1b232d0d7474913a4036f63faa5b Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Mon, 14 May 2018 20:00:22 +0100 Subject: [PATCH 3/5] Missing f on self --- Addons/Admin/auto-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Addons/Admin/auto-chat.lua b/Addons/Admin/auto-chat.lua index ca0c3df4..dea51840 100644 --- a/Addons/Admin/auto-chat.lua +++ b/Addons/Admin/auto-chat.lua @@ -48,7 +48,7 @@ local commands = { 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]=sel.data[2] + 1 + 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 From db1625a1dac873a38642814c151d112331c293e6 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Mon, 14 May 2018 20:22:15 +0100 Subject: [PATCH 4/5] Auto Chat Last Fix --- Addons/Admin/auto-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Addons/Admin/auto-chat.lua b/Addons/Admin/auto-chat.lua index dea51840..b6ec95a6 100644 --- a/Addons/Admin/auto-chat.lua +++ b/Addons/Admin/auto-chat.lua @@ -45,7 +45,7 @@ local commands = { ['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]}} + 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 From 0d3e1b90f65b93764e696dc1bb7234db10b3fc99 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Mon, 14 May 2018 20:25:23 +0100 Subject: [PATCH 5/5] Allowed reopen for non named threads --- ExpCore/server.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ExpCore/server.lua b/ExpCore/server.lua index 7a07df0c..ed79419c 100644 --- a/ExpCore/server.lua +++ b/ExpCore/server.lua @@ -294,9 +294,11 @@ function Server._thread:close() end end) end - if is_type(self.name,'string') then threads.paused[self.name]=self.uuid self.opened=nil - if self.reopen == true then self:open() end - else threads.all[uuid] = nil threads.all._n = threads.all._n-1 end + self.opened=nil + if self.reopen == true then self:open() else + if is_type(self.name,'string') then threads.paused[self.name]=self.uuid + else threads.all[uuid] = nil threads.all._n = threads.all._n-1 end + end return _return end