When the code below is started, a() runs right away, then after 5 seconds b() runs, and then after 5 more seconds c() runs. And then it repeats.
time 1: a
time 5: b
time 10: c
time 15: a
time 20: b
etc.
What I want to happen is that a(), b(), and c() all start at the same time, and then each repeat every 5 seconds.
I simply want to delay the repetition of each function without making the other functions wait.
time 1: a,b,c
time 5: a,b,c
time 10: a,b,c
etc.
Is there a way to achieve this?
In Macro, these would all start at the same time instead of waiting for each line to finish:
/timed 5s /docommand1
/timed 5s /docommand2
/timed 5s /docommand3
time 1: a
time 5: b
time 10: c
time 15: a
time 20: b
etc.
What I want to happen is that a(), b(), and c() all start at the same time, and then each repeat every 5 seconds.
I simply want to delay the repetition of each function without making the other functions wait.
time 1: a,b,c
time 5: a,b,c
time 10: a,b,c
etc.
Is there a way to achieve this?
Lua:
local mq = require('mq')
local a = function()
print('One')
mq.delay(5000)
end
local b = function()
print('Two')
mq.delay(5000)
end
local c = function()
print('Three')
mq.delay(5000)
end
local terminate = false
while terminate == false do
a()
b()
c()
end
In Macro, these would all start at the same time instead of waiting for each line to finish:
/timed 5s /docommand1
/timed 5s /docommand2
/timed 5s /docommand3
Last edited:

