From 5d4bcc8db3441df3657fb032694ed02944108f4b Mon Sep 17 00:00:00 2001 From: Lunovox Date: Thu, 29 Feb 2024 21:37:55 -0300 Subject: [PATCH] --- api.lua | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/api.lua b/api.lua index 9ea85f3..2c039fe 100644 --- a/api.lua +++ b/api.lua @@ -468,24 +468,29 @@ end) --[[ ]] minetest.after(3.5, function() + local timecheck = 0 minetest.register_globalstep(function(dtime) - --local presname = modEUrn.handler.elected.president.name - local presname = modEUrn.getPresidentName() - if type(presname)=="string" and presname~="" then - local mesAtual = os.date("%m", os.time()) - local mesChecked = os.date("%m", tonumber(modEUrn.handler.elected.president.when)) - if mesChecked ~= mesAtual then - local result, cause = modEUrn.doCheckPresident() - local titlecolor = "#FF0000" - if result == true then - titlecolor = "#00FF00" - modEUrn.doSave() + timecheck = timecheck + dtime + if timecheck >= 60 then + timecheck = 0 + --local presname = modEUrn.handler.elected.president.name + local presname = modEUrn.getPresidentName() + if type(presname)=="string" and presname~="" then + local mesAtual = os.date("%m", os.time()) + local mesChecked = os.date("%m", tonumber(modEUrn.handler.elected.president.when)) + if mesChecked ~= mesAtual then + local result, cause = modEUrn.doCheckPresident() + local titlecolor = "#FF0000" + if result == true then + titlecolor = "#00FF00" + minetest.chat_send_all( + core.colorize(titlecolor, "[E-URN]").." "..cause + ) + modEUrn.doSave() + end end - minetest.chat_send_all( - core.colorize(titlecolor, "[E-URN]").." "..cause - ) - end - end + end --Fim de if type(presname)=="string" and presname~="" then + end --Fim de if timecheck >= 60 then end) end) --]]