Announce mob hp's during a raid

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

blamstick
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 06, 2003 6:50 pm

Announce mob hp's during a raid

Post by blamstick » Fri Feb 06, 2004 12:46 am

I use this in my autofight code for named fights to announce what the hp % of the mob is. Just turn it off or on at the beginning of the macro depending on whether you're fighting a big named or not. Usually I have it turned off.

The doonce variable turns off/on at each level to make sure that you don't announce the HP percent more than once per each level.


Code: Select all

Sub Main
/declare doonce global
/declare monitorhp global
/varset doonce 0
/varset monitorhp 1 | set to 0 for off, 1 for on - ANNOUNCE MOB HP's
/if "$target()"=="TRUE" /if n @monitorhp==1 /call announcehp
/return

Sub announcehp
/if n $target(hp,pct)>75 /varset doonce 0
/if n $target(hp,pct)<74 /if n $target(hp,pct)>50 /varset doonce 0
/if n $target(hp,pct)<49 /if n $target(hp,pct)>25 /varset doonce 0
/if n $target(hp,pct)>10 /if n $target(hp,pct)<9 /varset doonce 0
/if n $target(hp,pct)>5 /if n $target(hp,pct)<4 /varset doonce 0

/if n $target(hp,pct)>=74 /if n $target(hp,pct)<=75 /if n @doonce==0 {
 /if $left(1,"$target(name,clean)")=="#" { 
    /rs $right($calc($strlen("$target(name,clean)")-1),"$target(name,clean)") is at $target(hp,pct) Health 
 } else { 
    /rs $target(name,clean) is at $target(hp,pct) Health 
} 
/varset doonce 1
/return
}
/if n $target(hp,pct)>=49 /if n $target(hp,pct)<=50 /if n @doonce==0 {
 /if $left(1,"$target(name,clean)")=="#" { 
    /rs $right($calc($strlen("$target(name,clean)")-1),"$target(name,clean)") is at $target(hp,pct) Health 
 } else { 
    /rs $target(name,clean) is at $target(hp,pct) Health 
} 
/varset doonce 1
/return
}
/if n $target(hp,pct)>=24 /if n $target(hp,pct)<=25 /if n @doonce==0 {
 /if $left(1,"$target(name,clean)")=="#" { 
    /rs $right($calc($strlen("$target(name,clean)")-1),"$target(name,clean)") is at $target(hp,pct) Health 
 } else { 
    /rs $target(name,clean) is at $target(hp,pct) Health 
} 
/varset doonce 1
/return
}
/if n $target(hp,pct)>=9 /if n $target(hp,pct)<=10 /if n @doonce==0 {
 /if $left(1,"$target(name,clean)")=="#" { 
    /rs $right($calc($strlen("$target(name,clean)")-1),"$target(name,clean)") is at $target(hp,pct) Health 
 } else { 
    /rs $target(name,clean) is at $target(hp,pct) Health 
}
/varset doonce 1
/return
}
/if n $target(hp,pct)>=4 /if n $target(hp,pct)<=5 /if n @doonce==0 {
 /if $left(1,"$target(name,clean)")=="#" { 
    /rs $right($calc($strlen("$target(name,clean)")-1),"$target(name,clean)") is at $target(hp,pct) Health 
 } else { 
    /rs $target(name,clean) is at $target(hp,pct) Health 
}
/varset doonce 1
/return
}
/return
Last edited by blamstick on Thu Feb 12, 2004 10:52 pm, edited 1 time in total.

Lord Yei
orc pawn
orc pawn
Posts: 24
Joined: Mon Jan 27, 2003 9:48 am
Contact:

Post by Lord Yei » Wed Feb 11, 2004 5:12 pm

nice :)
Lord Yei -- Mage and Scholor
I think there is a world market for maybe five computers.
- [i]Thomas Watson, chairman of IBM, 1943.[/i]