help adding auto heal to a macro.

Macro requests from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

van
a lesser mummy
a lesser mummy
Posts: 37
Joined: Mon Jun 24, 2002 1:04 am

help adding auto heal to a macro.

Post by van » Thu Jun 05, 2003 8:00 am

I have a cleric tank macro to help add dps to my wimpy warrior.
what I would like is a
/target <myname>
if health < 60% go to heal owner

:healowner
/target owner
/pause 5
/cast 8
/pause 100
return

Just need help with the health part.
I can add it to the loop

so you know the code im using....

Code: Select all

|CLERIC TANK.mac
|
#include routines.mac

Sub Main
   /varset v80 0

   :Autokill
      /call SelectTarget
      /if "$target()"=="FALSE" /goto :WaitASec
      /if "$target(type)"=="NPC" /call AttackAndFollow
      :WaitASec
      /call Rest
   /goto :AutoKill
/return


Sub SelectTarget
   /press esc
   /for v81 1 to 5
      /if "$target()"=="TRUE" /return
      /delay 5
      /doevents
/assist owner
  /delay 5

/return

Sub AttackAndFollow

   /varset v90 $target(id)
   /echo Going after $target(name)...
   /face
   /attack on
   /varset t0 5m
   :CloserAF
      /if "$target(id)"!="$v90" /goto :EndAF
      /if n $target(distance)>13 /call AutoRun 1
      /if n $target(distance)<15 /call cast
      /if n $t0==0 /press esc
      /if n $char(hp,pct)<30 /press esc
      /face
      /doevents
   /goto :CloserAF

sub cast
/call AutoRun 0
/cast 1
      /delay 10
/doability 1
/delay 15
/return

   :EndAF
   /call AutoRun 0
   /attack off
/endmacro
/return


Sub Rest
 
/return

Sub Event_Death
   /mqlog You died ;(
/return

Sub Event_SkillUp
   /mqlog Your '$p0' went up: $p1
/return

Sub Event_Level

/return


Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

Something....

Post by Malachi » Thu Jun 05, 2003 10:29 am

It's something like:

Code: Select all

sub CheckMe
/press f1 |Targets self
/if char(hp,pct)<=60 {then
      /cast 1 |gem # of heal spell
      /call CheckMe |check the value again
            {else /call NextSub}} |name of next routine to check

So I haven't coded a macro in 3 months, lol, I forget the syntax and I don't have a readme closeby. That should give you an idea tho. Just look @ the readme, it has that stuff, assuming struct changes haven't made things like char(hp,pct) invalid.

Mebbe I'm not so much help, lol.

~malachi
~Oh danny boy, the pipes the pipes are calling.~

van
a lesser mummy
a lesser mummy
Posts: 37
Joined: Mon Jun 24, 2002 1:04 am

Post by van » Thu Jun 05, 2003 10:31 am

thanks for the quick reply.. ill test it out now