I can't get this to work. I'm trying to create a defup routine. Now the real problem is I am so used to zmud type of scripting and it has me all confused. I usually just create a second trigger or something. But I would like to figure out how to do this with a coroutine.
This has to wait for "You have recovered equilibrium." from the mud.
It will send the first one but then just stops working even after I received the equilibrium message. I didn't want to just stick it in my normal eq trigger because I don't want it running the function every time I get eq. I only want this function to be called during the defup routine. So I created two eq recover triggers and just enable and disable the one. I have it as a lower priority and keep evaluating.
Am I doing it wrong or what? Each time I receive "You have recovered equilibrium" I need it to call that function until all the defenses are up. It's just not working.
function defup.eq()
-- check if able
if defing.try or
not balance.eq or
cures.general.paused then
return
end -- can't do it yet
-- check defenses
for _, v in ipairs(defing.eqdefs) do
if not defense[v.name] then
SendImmediate(v.command)
defing.try = true
return
end
end
EnableTrigger("eqDefup", false)
end -- function defup
This has to wait for "You have recovered equilibrium." from the mud.
It will send the first one but then just stops working even after I received the equilibrium message. I didn't want to just stick it in my normal eq trigger because I don't want it running the function every time I get eq. I only want this function to be called during the defup routine. So I created two eq recover triggers and just enable and disable the one. I have it as a lower priority and keep evaluating.
Am I doing it wrong or what? Each time I receive "You have recovered equilibrium" I need it to call that function until all the defenses are up. It's just not working.