I have an issue where if my character has a large number of "buffs" active, the hasBuff function will return false even if a given buff is active (true expected).
The point it breaks seems to be around 11-12 buffs.
<onSkillCast>
local health = player.HP/player.MaxHP*100
if( 90 > health ) then
if( not player:hasBuff("Regenerate") ) then
player:cast("PRIEST_REGENERATE")
end
end
</onSkillCast>
EDIT: Make that over 12 buffs. The 13th and higher buff is ignored by the hasBuff function.
Alkaiser wrote:I have an issue where if my character has a large number of "buffs" active, the hasBuff function will return false even if a given buff is active (true expected).
The point it breaks seems to be around 11-12 buffs.
<onSkillCast>
local health = player.HP/player.MaxHP*100
if( 90 > health ) then
if( not player:hasBuff("Regenerate") ) then
player:cast("PRIEST_REGENERATE")
end
end
</onSkillCast>
EDIT: Make that over 12 buffs. The 13th and higher buff is ignored by the hasBuff function.
The function that updates the buffs uses a RoMScript command to return all the buffs. Your probably breaking the 255 character limit that RoMScript can return. You can check a specific buff yourself like this.
<onSkillCast>
local health = player.HP/player.MaxHP*100
if( 90 > health ) then
local HasBuff = RoMScript("} a={false} for i=1,16 do if UnitBuff('player', i) == 'Regenerate' then a={true} break end end z={");
if not HasBuff then
player:cast("PRIEST_REGENERATE")
end
end
</onSkillCast>
Eventually we'll probably be able to get the buffs from memory but in the mean time this should work.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.