Soandso2
Well-known member
- Joined
- Mar 13, 2023
- RedCents
- 937¢
Macroquest functions like AltAbilityReady, CombatAbilityReady and AbilityReady screw up in a strange manner. Or am I just not using them right?
Consider the following Lua function
[CODE lang="Lua" title="useCombatAAs"]local function useCombatAAs()
for act,aaData in pairs (combatAAs) do
if target() and goodToGo() and me.AltAbilityReady(aaData[1])() and target.Distance() < aaData[2] then
if me.Song("Ton Po's Stance X").ID() == nil or (me.Song("Ton Po's Stance X").ID() ~= nil and aaData[1] ~= "Focused Destructive Force") then
mq.delay(500)
mq.cmdf('/alt activate "%s"',act)
printf('Direct AA: \ag%s',aaData[1])
mq.cmdf("/mqlog Direct AA: %s",aaData[1])
end
end
end
end[/CODE]
The first if-condition in the for-loop should not trigger unless the AltAbilityReady for the ability in question (and the other conditions are also met, of course) is actually ready to be used. And if the AltAbility has been used, the first if-condition should not be evaluated to true. However, more often than not, the condition triggers several times in a row. I can get something like this in the MQ window
DirectAA: Five Point Palm
DirectAA: Five Point Palm
I even put in a delay of half a second before the actual command to use the AltAbility in case there is a delay between server and client. I even increased this delay to a full 2 seconds, but it did not change anything. Any ideas?
Consider the following Lua function
[CODE lang="Lua" title="useCombatAAs"]local function useCombatAAs()
for act,aaData in pairs (combatAAs) do
if target() and goodToGo() and me.AltAbilityReady(aaData[1])() and target.Distance() < aaData[2] then
if me.Song("Ton Po's Stance X").ID() == nil or (me.Song("Ton Po's Stance X").ID() ~= nil and aaData[1] ~= "Focused Destructive Force") then
mq.delay(500)
mq.cmdf('/alt activate "%s"',act)
printf('Direct AA: \ag%s',aaData[1])
mq.cmdf("/mqlog Direct AA: %s",aaData[1])
end
end
end
end[/CODE]
The first if-condition in the for-loop should not trigger unless the AltAbilityReady for the ability in question (and the other conditions are also met, of course) is actually ready to be used. And if the AltAbility has been used, the first if-condition should not be evaluated to true. However, more often than not, the condition triggers several times in a row. I can get something like this in the MQ window
DirectAA: Five Point Palm
DirectAA: Five Point Palm
I even put in a delay of half a second before the actual command to use the AltAbility in case there is a delay between server and client. I even increased this delay to a full 2 seconds, but it did not change anything. Any ideas?


