I guess this is also a good time to readdress the use of timers? I see a lot of macros that wait some specific time AND until some event happens when specifically they're just trying to test the event truthiness.
In the example shown above:
JavaScript:
local mq = require('mq')
require('functions')
while true do
mq.delay(1)
if DoTimer(os.clock(), 15) and mq.TLO.Me.AbilityReady('Feign Death') and mq.TLO.Me.Standing() then
mq.cmd.doability('"feign death"')
end
end
I'm assuming the 15-second wait timer is because the Necromancer Feign Death spell has a base recast of 15 seconds.
However, we're in the loop checking to see if the 15-second timer has elapsed at a faster rate as seen in the mq.delay(1).
Once the 15 seconds check returns TRUE, we then check to see if the ability 'Feign Death' is ready and if so we check to see if we're standing.
Lua short-circuits logical and's - that is it only continues along the path if the first and is TRUE, and so forth.
Basically what I'm getting to is that the 15 second wait timer (in this case) is not needed. And I would contend in a lot of cases the wait timers are not needed, but rather has just become the idiom used in cases where you want to check something.
If you remove the timer check, you basically will check every second for your feign death ability to be ready AND your character to be standing, and if so, you'll cast feign death.
Now, I understand that some mechanics may need timers - that's understandable. But I think a lot of timing conditions could be replaced with simple polling for some conditions.