Looking for Player HP's

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Quadzer
orc pawn
orc pawn
Posts: 15
Joined: Sun Oct 19, 2003 10:12 pm

Looking for Player HP's

Post by Quadzer » Sat May 01, 2004 5:31 pm

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.

s16z
a ghoul
a ghoul
Posts: 97
Joined: Thu Apr 01, 2004 12:03 pm

Post by s16z » Sat May 01, 2004 6:58 pm

spawn NearestSpawn[n,search]: The nth nearest spawn matching this search

So do something like

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

Quadzer
orc pawn
orc pawn
Posts: 15
Joined: Sun Oct 19, 2003 10:12 pm

Thanks

Post by Quadzer » Sat May 01, 2004 9:20 pm

Loaded it up, Seams to work Great. Can't wait to battle test it.

Quadzer
orc pawn
orc pawn
Posts: 15
Joined: Sun Oct 19, 2003 10:12 pm

Post by Quadzer » Sat May 01, 2004 10:20 pm

Ok I could not get what you had to work just as you had it. And here is what I came up with.

I could not get the radius check to work in the first line.

/declare I int inner
/declare PlayerID int inner

/for I 1 to 72 step 1

/varset PlayerID ${NearestSpawn[${I},pc].ID}
/if (${PlayerID}==0) /return
/if (${Spawn[${PlayerID}].PctHPs}<90 && ${Spawn[${PlayerID}].Distance}<200) {
/target id ${PlayerID}
/cast "Supernal Remedy"
/delay 5s
}
/next I

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Sat May 01, 2004 10:35 pm

in many situations, most actually, hps aren't sent to the client unless you're grouped or have that person/mob targetted. Many people that have their bot setup to heal people out of group put the /target in before the check and a small delay for hps to update, etc.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Mon May 10, 2004 9:03 am

Hey I just took a look at what you had and added a few things. Looks very nice and smoothe to me btw. Gonna addapt it to my druid I think for when she gets bored at raids =D

1) Used SpellCast.inc to take care of things like fizzles, interrupts, and spells not being ready.
2) Moved the target statement up and added a small delay to allow hps to update
3) Added in an extra check so you can use a bigger heal if appropriate.

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