{"slots":{"0":{"name":"slot1","type":{"events":[],"methods":[]}},"1":{"name":"slot2","type":{"events":[],"methods":[]}},"2":{"name":"slot3","type":{"events":[],"methods":[]}},"3":{"name":"slot4","type":{"events":[],"methods":[]}},"4":{"name":"slot5","type":{"events":[],"methods":[]}},"5":{"name":"slot6","type":{"events":[],"methods":[]}},"6":{"name":"slot7","type":{"events":[],"methods":[]}},"7":{"name":"slot8","type":{"events":[],"methods":[]}},"8":{"name":"slot9","type":{"events":[],"methods":[]}},"9":{"name":"slot10","type":{"events":[],"methods":[]}},"-1":{"name":"unit","type":{"events":[],"methods":[]}},"-3":{"name":"player","type":{"events":[],"methods":[]}},"-2":{"name":"construct","type":{"events":[],"methods":[]}},"-4":{"name":"system","type":{"events":[],"methods":[]}},"-5":{"name":"library","type":{"events":[],"methods":[]}}},"handlers":[{"code":"--[[\n DU-Nested-Coroutines by Jericho\n Permit to easier avoid CPU Load Errors by using nested coroutines and adapt cycles on the FPS\n Source unminified available here: https://github.com/Jericho1060/du-nested-coroutines\n]]--\nlocal a={__index={coroutines={update={},flush={}},functions={update={},flush={}},main={update=coroutine.create(function()end),flush=coroutine.create(function()end)},update=function(self)local b=coroutine.status(self.main.update)if b==\"dead\"then self.main.update=coroutine.create(function()self:runUpdate()end)elseif b==\"suspended\"then assert(coroutine.resume(self.main.update))end end,flush=function(self)local b=coroutine.status(self.main.flush)if b==\"dead\"then self.main.flush=coroutine.create(function()self:runFlush()end)elseif b==\"suspended\"then assert(coroutine.resume(self.main.flush))end end,runUpdate=function(self)for c,d in pairs(self.coroutines.update)do local b=coroutine.status(d)if b==\"dead\"then self.coroutines.update[c]=coroutine.create(self.functions.update[c])elseif b==\"suspended\"then assert(coroutine.resume(d))end end end,runFlush=function(self)for c,d in pairs(self.coroutines.flush)do local b=coroutine.status(d)if b==\"dead\"then self.coroutines.flush[c]=coroutine.create(self.functions.flush[c])elseif b==\"suspended\"then assert(coroutine.resume(d))end end end,onUpdate=function(self,e)for c,f in pairs(e)do self.functions.update[c]=f;self.coroutines.update[c]=coroutine.create(f)end end,onFlush=function(self,e)for c,f in pairs(e)do self.functions.flush[c]=f;self.coroutines.flush[c]=coroutine.create(f)end end}}NestCo={}setmetatable(NestCo,a)\n\n--[[\n add the functions you want to run as coroutines here\n you can remove co1 and co2 that are given as example\n]]\nlocal functions = {\n update = {},\n flush = {}\n}\n\n--Functions to load as coroutines that will be runned in system > onUpdate (based on FPS)\nfunctions.update.co1 = function ()\n for i=0, 10 do\n system.print(\"coroutine 1 --- update --- \"..i)\n coroutine.yield(self.co1) -- pause the coroutine 1\n end\nend\nfunctions.update.co2 = function ()\n for i=0, 10 do\n system.print(\"coroutine 2 --- update --- \"..i)\n coroutine.yield(self.co2) -- pause the coroutine 2\n end\nend\n\n--Functions to load as coroutines that will be runned in system > onFlush (60 times / s)\nfunctions.flush.co1 = function ()\n for i=0, 10 do\n system.print(\"coroutine 1 --- flush --- \"..i)\n coroutine.yield(self.co1) -- pause the coroutine 1\n end\nend\nfunctions.flush.co2 = function ()\n for i=0, 10 do\n system.print(\"coroutine 2 --- flush --- \"..i)\n coroutine.yield(self.co2) -- pause the coroutine 2\n end\nend\n\n--[[\n do not change the following\n]]\nNestCo:onUpdate(functions.update) --loading coroutines for system > onUpdate\nNestCo:onFlush(functions.flush) --loading coroutines for system > onFlush\n","filter":{"args":[],"signature":"onStart()","slotKey":"-1"},"key":"0"},{"code":"--[[\n DU-Nested-Coroutines by Jericho\n Permit to easier avoid CPU Load Errors\n Source available here: https://github.com/Jericho1060/du-nested-coroutines\n]]--\n\nNestCo:update()","filter":{"args":[],"signature":"onUpdate()","slotKey":"-4"},"key":"1"},{"code":"--[[\n DU-Nested-Coroutines by Jericho\n Permit to easier avoid CPU Load Errors\n Source available here: https://github.com/Jericho1060/du-nested-coroutines\n]]--\n\nNestCo:flush()","filter":{"args":[],"signature":"onFlush()","slotKey":"-4"},"key":"2"}],"methods":[],"events":[]}