After the last MQ update, having some odd behavior. I am hoping someone can help me save my hair.

The offending code line is:
/if (${Me.PctMana}<${PetMana} && !${Select[${PetBuffGem${i}},alt,item]})
There is no PetBuffGem7... there are only 6 buffs.
added :
/if (${i}>${PetBuffTotal}) /return
/echo Checking pet buff ${i} : \ag ${PetBuff${i}}
to help debug.
if I echo "${i}>${PetBuffTotal}" I get 7>6 when MQ pauses the macro. I am confused on why a for loop would go over the limit, and why a limit line calling for a return would get skipped. Could someone shed some light?
(cold rebooted PC, reinstalled MQ, sacrificed tacos to the programming gawds....)

The offending code line is:
/if (${Me.PctMana}<${PetMana} && !${Select[${PetBuffGem${i}},alt,item]})
There is no PetBuffGem7... there are only 6 buffs.
Code:
/if (!${RDPause} && ${DoPetBuffs} && ${Bool[${Me.Pet.ID}]}) {
/if (${Debug}) /echo \ag Entering \ao Pet Buff, \ay PetBuffTotal = \ag ${PetBuffTotal}
/declare i int local
/for i 1 to ${PetBuffTotal}
/if (${i}>${PetBuffTotal}) /return
/echo Checking pet buff ${i} : \ag ${PetBuff${i}}
/if (!${Spell[${PetBuffIcon${i}}].StacksPet[0]} || ${Me.PetBuff[${PetBuffIcon${i}}]}) /next i
/if (${Me.PctMana}<${PetMana} && !${Select[${PetBuffGem${i}},alt,item]}) {
/if (${Debug}) /echo \ar mana = ${Me.PctMana}<${PetMana} , buff is a spell
/return
}
/if (!${RestrictedList.Find[|${PetBuffID[${i}]}|]} && (${Me.Pet.Distance}<${Int[${Spell[${PetBuffID[${i}]}].MyRange}]} || ${Me.Pet.Distance}<${Spell[${PetBuffID[${i}]}].AERange}) && ${Spell[${PetBuffIcon${i}}].StacksPet[0]} && ((!${SitTimer} || ${Me.Gem[${PetBuff${i}}]} || ${Me.Mount.ID}) && (!${Me.Gem[${PetBuff${i}}]} || ${Me.SpellReady[${Spell[${PetBuff${i}}].RankName}]}) || (${PetBuffGem${i}.Equal[item]} && !${FindItem[${PetBuff${i}}].Timer}) || (${PetBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${PetBuff${i}}]}))) {
/if (!${CheckGroupTimer} && ${Select[${Me.Class.ShortName},CLR,DRU,SHM,BST,PAL,RNG]}) /call CheckGroup
/if (${Target.ID}!=${Me.Pet.ID}) /squelch /target targetable id ${Me.Pet.ID}
/delay 1s ${Target.ID}==${Me.Pet.ID}
/if (${ReportPetBuffs}) /call AnnounceMessage "${ChatChannel}" 4 g "Buffing" m "${Me.Pet.CleanName}" g "with" o "${PetBuff${i}}"
/doevents flush Restricted
/if (${Debug}) /echo CASTING \ay ${PetBuff${i}} \ao from \ay ${PetBuffGem${i}}
/call MQ2Cast "${PetBuff${i}}" ${PetBuffGem${i}} 10s Check4Pad
/call DoRestrictedEvents ${PetBuffID[${i}]}
/return
}
/next i
/varset PetBuffTimer ${PetBuffRecheck}
}
/if (${KillFlappy} && ${Me.Pet.ID}) /pet get lost
/call MoveStuff
/if (${Debug}) /echo \am Exiting pet buff
/return
Code:
DoPetBuffs=TRUE
ReportPetBuffs=FALSE
PetBuffRecheck=5s
PetBuffTotal=6
PetBuff1=Burnout XIII
PetBuffGem1=Gem6
PetBuffIcon1=${PetBuff1}
PetBuff2=Iceflame Armaments
PetBuffGem2=Gem6
PetBuffIcon2=${PetBuff2}
PetBuff3=Magmatic Veil
PetBuffGem3=Gem6
PetBuffIcon3=${PetBuff3}
PetBuff4=Inferno Coat
PetBuffGem4=Gem6
PetBuffIcon4=${PetBuff4}
PetBuff5=Companion's Aegis
PetBuffGem5=ALT
PetBuffIcon5=Companion's Aegis II
PetBuff6=Shieldstone Stance
PetBuffGem6=Gem7
PetBuffIcon6=${PetBuff6}
added :
/if (${i}>${PetBuffTotal}) /return
/echo Checking pet buff ${i} : \ag ${PetBuff${i}}
to help debug.
if I echo "${i}>${PetBuffTotal}" I get 7>6 when MQ pauses the macro. I am confused on why a for loop would go over the limit, and why a limit line calling for a return would get skipped. Could someone shed some light?
(cold rebooted PC, reinstalled MQ, sacrificed tacos to the programming gawds....)


