выполнение функции каждые 55 минут на таймере

coldplugg.

Участник
Автор темы
180
22
Версия MoonLoader
.026-beta
как выполнять функцию каждые xx:55 на часах, понять не могу
 

VRush

https://t.me/vrushscript
2,417
1,208
Lua:
--беск цикл
local date_table = os.date("*t")
local hour, minute, second = (date_table.hour <= 9 and ('0'..date_table.hour) or date_table.hour), (date_table.min <= 9 and ('0'..date_table.min) or date_table.min), (date_table.sec <= 9 and ('0'..date_table.sec) or date_table.sec)

if minute == 55 then
   if lasthour ~= hour then
      print('Time: '..hour..':'..minute)
      lasthour = hour
   end
end
 
  • Bug
Реакции: Vespan

coldplugg.

Участник
Автор темы
180
22
Lua:
local lastACtion = 0

while true do
    wait(0)
    if lastAction + 65 - os.clock() < 0 and os.date('%M') == '55' then
        lastAction = os.clock()
        -- code
    end
end
в 55 проверю

Lua:
local lastACtion = 0

while true do
    wait(0)
    if lastAction + 65 - os.clock() < 0 and os.date('%M') == '55' then
        lastAction = os.clock()
        -- code
    end
end
-

Lua:
--беск цикл
local date_table = os.date("*t")
local hour, minute, second = (date_table.hour <= 9 and ('0'..date_table.hour) or date_table.hour), (date_table.min <= 9 and ('0'..date_table.min) or date_table.min), (date_table.sec <= 9 and ('0'..date_table.sec) or date_table.sec)

if minute == 55 then
   if lasthour ~= hour then
      print('Time: '..hour..':'..minute)
      lasthour = hour
   end
end
не
 
Последнее редактирование: