How can I cycle through all the Players ( No NPC's ) with in a certain radius and check them for low HP's?
Thanks for any and all help.
Moderator: MacroQuest Developers
Code: Select all
/declare I int inner
/declare PlayerID inner
/for I 1 to 100 step 1
| We do this to account for people moving around changing the
| nearest spawn before we can do something about it.
/varset PlayerID ${NearestSpawn[${I},pc radius 100].ID}
/if (${Spawn[PlayerID].ID} && ${Spawn[PlayerID].PctHPs}<40) {
| Change the 40 to whatever percent you need
| Add lines to do whatever you want to do to them here, example:
/target id ${PlayerID}
/cast "Complete Heal"
}
/next I
Code: Select all
| Simple Heal Macro
#Include SpellCast.inc
/declare I int inner
/declare PlayerID int inner
/for I 1 to 72 step 1
/varset PlayerID ${NearestSpawn[${I},pc].ID}
/target id ${PlayerID}
/delay 2s
/if (${Spawn[${PlayerID}].PctHPs}<60 && ${Spawn[${PlayerID}].Distance}<200) /call cast "Supernal Light"
/delay 2
/if (${Spawn[${PlayerID}].PctHPs}<90 && ${Spawn[${PlayerID}].Distance}<200) /call cast "Supernal Remedy"
/next I
/return