Group check while attacking

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

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

Group check while attacking

Post by Quadzer » Mon Dec 29, 2003 10:39 pm

Is there a way to check the health of group members while still attacking?

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Dec 30, 2003 1:55 am

Yes. This should get you started:

Code: Select all

Sub Main
/declare GroupMemNum local
/declare Player local
/declare MinHealth local

| Set this to the minimum percentage the player can be at before you heal them.
/varset MinHealth 50

:Loop
/for GroupMemNum 1 to $group(count)
    /varset Player $group($calc(@GroupMemNum-1))
    /if n @Player>0 {
    /if n $spawn(@Player,hp,pct)<@MinHealth /call Heal @Player
    }
/next GroupMemNum
/doevents
/goto :Loop
/return


Sub Heal(PlayerID)
/target id @PlayerID
  [color=red]Your Healing code here...[/color]
/return 

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

Post by Quadzer » Tue Dec 30, 2003 4:59 pm

Thanks I will check this out.