Autoheal macro - suggestions on improving my code?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Autoheal macro - suggestions on improving my code?

Post by Mckorr » Tue Dec 31, 2002 5:06 pm

Wrote this to autoheal my beastlord (get tired of repeatedly hitting my heal spell when it only does 10 at a time.) Was wondering if someone could make some suggestions on cleaning it up a bit. It works as is, but I'm sure the coding could be more efficient.

Code: Select all

#include routines.mac
#include macrokit.inc

sub main

|Clean things up a bit

/zapvars
/press esc
/press esc
/press esc

|Set pet to guard me so he doesn't run around like an idiot

/pet guard me

|Target self
/press F1

|Healing loop, break if full health or low on mana

:loop
/if n $char(hp,pct)>99 /goto :fullhealth
/cast 5
/delay 4s
/if n $char(mana,pct)<5 /call lowmana
/goto :loop

|If health is full, say so and clear target
:fullhealth
/say Full Health, ready to continue.
/press esc
/goto :end

|If low on mana, say so and sit to med
sub lowmana
/say Low on mana, medding.
/sit
:manaloop
/if n $char(mana,pct)<100 /goto :manaloop
/say Full mana, continuing to heal self.
/stand
/return

:end
Thanks for any suggestions

macrolover
a ghoul
a ghoul
Posts: 107
Joined: Sun Jul 14, 2002 9:19 am

suggetstion

Post by macrolover » Tue Dec 31, 2002 11:39 pm

shouldn't you be using /echo instead of /say?

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

Hehe

Post by Malachi » Wed Jan 01, 2003 2:12 am

I've got one hint for ya, and that's DON'T use minor healing with a beastie. Inner fire costs the same mana, but is a more important skill and heals for 20pts. :) Of course, you can't use it with cleric/druid/sha buffs already on you, but I usually tell them to buff my pet anyway, since I'm not taking aggro.

Just a hint, my kitty's at 25 and still uses IF to heal up. Pretty nice too, uses about 20% mana for a 60% heal up. :)

Same trick works for pally's and....what's that spell? not yaulp....the other one, their first buff.

Anyhoo, try dat and see how for you it goes.

Additionally, you want to /echo that you're full, not /say it, unless you want people around you to know what you're doing. :)

And here:

Code: Select all

:manaloop 
/if n $char(mana,pct)<100 /goto :manaloop 
/say Full mana, continuing to heal self. 
/stand 
/return 
you need an {else /echo Got mana, healing up! /goto :loop} or else you're gonna keel it when you get to full mana. :)

you might wanna make end a sub and not a loop...and make sure you stick your /return in there for closure purposes.

Code: Select all

sub End
/echo All healed up and ready to rock
/endmacro
or whatever generic ending you wanna stick on there...I'm just pretty sure that end isn't a loop. :)

Oh, and as an afterthought....you might consider /pet sit down instead because he'll ALWAYS protect you he'll regen hp's faster that way, and he'll be SURE to not move, but if guard me works then good for youz. Beastie pets don't really change position, but hp regen is faster and they don't move that way. He just stands there blinking.

And....I dunno why you're including routines and macrokit, unless there's something I'm missing in there, just adds preprocessor time/resources.

Lessee, anything else? something like /doability "bind wound" wouldn't hurt either, just for the practice, assuming you carry bandages. :) Dunna worry about error messages, if you're over 50% it doesn't eat the bandage and it won't hurt your timing any.

This is a little disjointed, sorry. :) Lemme know how it works for you, and...REALLY, switch to IF for your healing.

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

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Wed Jan 01, 2003 12:21 pm

Thanks. First, for the "echo" stuff. Yeah, that's what I wanted to do, just, well, couldn't remember the command.

Didn't know about using Inner Fire for healing. You are thinking of Daring for paladins (my main is a paladin). Will make that change.

Also wanted to thank you for the end macro suggestion. Another one of those brain cramp things where I couldn't remember the proper commands, and didn't have the readme file printed out.

I included routines and macrokit more out of habit than anything else. I was writing this on the fly and wasn't sure what I was going to use during the process. Figured I could remove them later if I didn't need them.

Appreciate the constructive criticism. Thanks to all.

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

Post a finished version...

Post by Malachi » Wed Jan 01, 2003 1:09 pm

Youza welcome. :)
Post a finished version, I'll use it for me beastie as well. :)

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