Having some fun learning Lua, but ran into this issue. I am trying to make a button to camp my toons. I want everyone to set camp (using MQ2Boxr Camp command) and then set the main tank to tank mode (currently only supporting CWTN). Here is the code:
This code is attached to an ImGui button press.
The issue I am having is that it seems that the Dannet command is coming in after the tank command, and is resetting the tank to assist mode. I tried inserting an 'mq.delay()' but that did nothing (literally, no matter what delay I use it does not delay - not sure mq.delay() works in the ImGui handler?).
I have had other cases of this happening, where Dannet commands occur in the opposite order from which they are sent (handled these using /multiline). But I would really like to know what is going on here. Alternatively, how would I wait for the Dannet command(s) to complete?
Code:
mq.cmd('/squelch /dgga /boxr Camp')
local command = string.format('/%s mode tank',mq.TLO.Group.MainTank.Class.ShortName())
sendCommand(command,mq.TLO.Group.MainTank.Name())
The issue I am having is that it seems that the Dannet command is coming in after the tank command, and is resetting the tank to assist mode. I tried inserting an 'mq.delay()' but that did nothing (literally, no matter what delay I use it does not delay - not sure mq.delay() works in the ImGui handler?).
I have had other cases of this happening, where Dannet commands occur in the opposite order from which they are sent (handled these using /multiline). But I would really like to know what is going on here. Alternatively, how would I wait for the Dannet command(s) to complete?

