Hey all,
I'm trying to troubleshoot this little Lua helper I'm trying to write and need a set of fresh eyes to double-check me, if anyone would be so kind:
I'm trying to troubleshoot this little Lua helper I'm trying to write and need a set of fresh eyes to double-check me, if anyone would be so kind:
Code:
local mq = require('mq')
local XClear = function() --naming the function to be called later.
for i = 1, mq.TLO.Me.XTargetSlots() do --finding how many loops to iterate through
if mq.TLO.Me.XTarget(i)() ~= nil then --if something is on xtarget, clears it.
mq.cmdf('/xtar set %d autohater', i) --passes value of i into the command "/xtar set # autohater"
mq.delay(10) -- waits 1s
if mq.TLO.Me.XTarget(i)() == nil then break end --this should break out of the loop and wait 10 more seconds?
end
end
end
while true do --while true... what would cause this to be false?
mq.delay(100) -- delays 10s then...
XClear() -- ...calls XClear function
end

