Healbot.mac (Like Healwatch.mac but uses Spellcast.inc)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Healbot.mac (Like Healwatch.mac but uses Spellcast.inc)

Post by fantum409 » Sun May 02, 2004 1:30 am

There is stuff copy/pasted from Grimjack's original Healwatch.mac but it's updated and all the extra stuff is cut out so that it uses Spellcast.inc (tested with ml2517's version from Advbot thread.)
Seems to run fast and reliable for me, using whatever heal spell you specify.

Code: Select all

|----------------------------------------------------------
|Healbot.mac
|Simple Healer Macro to watch the health of a single target
|
|Usage: /mac Healbot <%health> <Heal spell>
|
|Effect: watch target health and cast specified spell at 
|specified health. This is just like Healwatch.mac but uses
|spellcast.inc for simplicity/uniformity
|
|By Fantum409
|Date: 05/01/2004
|----------------------------------------------------------

#include spellcast.inc

Sub Main 
   /declare HealSpell outer 
   /declare HealPct outer 
   /declare Splwrd outer
   
   
      /if (!${Defined[Param1]}) {    
      /echo Usage: /mac healbot Percent Healspell 
      /echo Example: /mac healbot 40 Complete Heal 
      /end 
   } 


   /if (!${Defined[Param2]}) { 
      /varset HealSpell "${Param1}" 
      /varset Splwrd 1 
   } else /if (!${Defined[Param3]}) { 
      /varset HealSpell "${Param1} ${Param2}" 
      /varset Splwrd 2 
   } else /if (!${Defined[Param4]}) { 
      /varset HealSpell "${Param1} ${Param2} ${Param3}" 
      /varset Splwrd 3 
   } else { 
      /varset HealSpell "${Param1} ${Param2} ${Param3} ${Param4}" 
      /varset Splwrd 4 
   } 
   
  
   /varset HealPct ${Param0} 
   
   /echo Healbot active:
   /echo Casting ${HealSpell} on your Target at ${HealPct}% Health
   
      :HealWatchLoop 
      /delay 1 
      /if (${Bool[${Target}]}==TRUE) { 
         /if (${Target.PctHPs}<=${HealPct}) { 
               /if (${Splwrd}==1) { 
	       /call Cast "${Param1}"
	       } else /if (${Splwrd}==2) { 
	       /call Cast "${Param1} ${Param2}" 
	       } else /if (${Splwrd}==3) { 
	       /call Cast "${Param1} ${Param2} ${Param3}" 
	       } else { 
	       /call Cast "${Param1} ${Param2} ${Param3} ${Param4}" 
            } 
         } 
      } 
      /delay 2s 
      /goto :HealWatchLoop 

/return 

/end 

Learningcurve
orc pawn
orc pawn
Posts: 21
Joined: Sat Dec 17, 2005 6:04 pm

Post by Learningcurve » Wed Mar 08, 2006 4:55 pm

I love this Macro its nice and simple. It quit working a few patches ago and I wanted to use it the other day. Was able to get it to work by replacing this line.

Code: Select all

/if (${Target.PctHPs}<=${HealPct}) { 
               /if (${Splwrd}==1) { 
With

Code: Select all

/if (${Target.PctHPs}<=${HealPct}) { 
               /if (${Splwrd}==1) { 
Seems to work again :D

nikko
decaying skeleton
decaying skeleton
Posts: 6
Joined: Mon Apr 18, 2005 2:43 pm

Post by nikko » Mon Mar 13, 2006 8:13 am

macro loads fine...cleric doesnt start heal tho..i set heal at 70% and it loads just fine but doesnt seem to work

NeXuS
a lesser mummy
a lesser mummy
Posts: 75
Joined: Thu Jun 23, 2005 9:25 pm

Post by NeXuS » Mon Mar 13, 2006 8:15 pm

Try this one also you have to enter the heal percent without the % sign

Code: Select all

|---------------------------------------------------------- 
|Healbot.mac 
|Simple Healer Macro to watch the health of a single target 
| 
|Usage: /mac Healbot <Percent> <Healspell>
| 
|Effect: watch target health and cast specified spell at 
|specified health. This is just like Healwatch.mac but uses 
|spellcast.inc for simplicity/uniformity 
| 
|By Fantum409 
|Date: 05/01/2004 
|---------------------------------------------------------- 

#include spellcast.inc 

Sub Main 
   /declare HealSpell outer 
   /declare HealPct outer 
 
     /if (!${Defined[Param0]} || !${Defined[Param1]}) {          
      /echo Usage: /mac healbot Percent Healspell 
      /echo Example: /mac healbot 40 Complete Healing 
      /end 
   } 

   /if (${Defined[Param0]}) { 
      /varset HealPct ${Param0} 
    }
   /if (${Defined[Param1]}) { 
      /varset HealSpell "${Param1}" 
     }
   /if (${Defined[Param2]}) { 
      /varset HealSpell "${Param1} ${Param2}" 
      }
  /if (${Defined[Param3]}) { 
      /varset HealSpell "${Param1} ${Param2} ${Param3}" 
       }
   /if (${Defined[Param4]}) { 
     /varset HealSpell "${Param1} ${Param2} ${Param3} ${Param4}"
        }
  
   /echo Healbot active: 
   /echo Casting ${HealSpell} on your Target at ${HealPct}% Health 
    
      :HealWatchLoop 
      /delay 1 
      /if (${Target.ID} && ${Target.Type.NotEqual[NPC]} && ${Me.SpellReady[${HealSpell}]} && ${Target.PctHPs}<=${HealPct}) { 
          /call cast "${HealSpell}" gem1
      } 
      /goto :HealWatchLoop 
/return 

User avatar
Lord Beavis
a lesser mummy
a lesser mummy
Posts: 59
Joined: Wed Jul 17, 2002 9:50 pm
Contact:

Post by Lord Beavis » Thu Apr 06, 2006 4:22 am

same for me. it doesnt seem to work.
Even made sure to have spell in gem1

DeeGee
a ghoul
a ghoul
Posts: 116
Joined: Wed Sep 22, 2004 4:51 pm

Post by DeeGee » Fri Apr 07, 2006 12:10 pm

What are you typing in to start it? Remember to use quotes if the paramater has more than one word.

User avatar
Lord Beavis
a lesser mummy
a lesser mummy
Posts: 59
Joined: Wed Jul 17, 2002 9:50 pm
Contact:

Post by Lord Beavis » Mon Apr 10, 2006 3:09 am

Doh, Didn't use quotes for the heal spell. Will have to try that next time.

asele01
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Jun 16, 2006 3:55 am

Post by asele01 » Sun Jun 18, 2006 12:33 pm

I tried the original code posted above and took note of Learningcurve's post below it, noting that

Code: Select all

<
should be replaced with an actual (l)ess (t)han sign. I did a Find/Replace twice (to also check for greater than as well) and saved the file. I then did this with the spellcast.inc file.

Now it get's fun. When I typed in the MQ2 interface, this is verbatum what I typed. "/mac healbot 70 "Minor Healing" Resulted in an echo saying it would heal my "Target" at 70 percent with Minor Healing.

It sat there. This led me to two conclusions; 1) It isn't aquiring the actual target and is dispaying "Target" instead of a target name, or 2) something else about the game or MQ2 changed that required an update to the code.

I started with 2 and found the new code and retired with it only to get the same result. I am now trying to learn how to read code via google to see if I can figure out if 1 is correct or if I am way off base.

Essentially, I have the same problems as Nikko and Lord Beavis.

I did some reading on the wikki and found this link.
"http://www.macroquest2.com/wiki/index.p ... opriate.29
I thought myself lucky to see the comment about the manual and usage of the gem command/phrase (I'm unsure of the correct term). It seems to require it to be

Code: Select all

"Gem[1]
instead of what is currently on line 59 of the macro, so naturally I changed it.

I am now sifting through the manual to find every word/phrase/command line by line in this macro to try and figure out what might be off. I apologize for the length of this post, I sort of needed to type it out to get it straight in my head as well as hoping for someone who might have a clue as to the cause (most likely me) of the problem to maybe confirm whether it is the code or me that is having an issue.

I first compiled MQ2 after the most recent update and the most recent patch. This is my first time to try anything with it.

Please be gentle.

methodx
a lesser mummy
a lesser mummy
Posts: 37
Joined: Mon Jan 16, 2006 10:57 am

Post by methodx » Mon Jun 19, 2006 10:23 am

NM I made this post cause I thought I saw a mistake in the macro... are you sure you're targetting your tank when you start this macro?

asele01
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Jun 16, 2006 3:55 am

Post by asele01 » Mon Jun 19, 2006 10:25 pm

Ya, I actualy just figured ou tthe problem. Me. I was right on that at least. I had a friend compile for me and send to me and it worked like a champ. I used VS2005 and assumed becase MQ2 ran and the basic commands like /target and /face worked that it all worked right. I put everything in the ./release/macros folder and copy/pasted and saved as all files to make the .mac and .inc files. Don't know what was so diff on hwo I compiled with VS2005 vs how my friend did, but using the one he compiled for me fixed everything and the original code worked.

So, I blame myself. I just wish it didn't take me so long to finally figure it out.

logitech3
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Jun 25, 2006 3:37 pm

Post by logitech3 » Tue Jul 18, 2006 4:02 am

got it working formyself and also added an event to re-buff Conviction if it fades. To take it out just delete the code.

Code: Select all

#Event BuffFade "Your Conviction spell has worn off of #1#."
***NOTE***: I didn't write this macro, i'm not claiming to, i thought about posting a snippet but i thought it would make more sense to people if i posted it in the macro. I also had replaced the bad code to make it work, which had alread been posted here before.

Code: Select all

|----------------------------------------------------------
|Healbot.mac
|Simple Healer Macro to watch the health of a single target
|
|Usage: /mac Healbot <%health> <Heal spell>
|
|Effect: watch target health and cast specified spell at
|specified health. This is just like Healwatch.mac but uses
|spellcast.inc for simplicity/uniformity
|
|By Fantum409
|Date: 05/01/2004
|----------------------------------------------------------

#include spellcast.inc
#Event BuffFade "Your Conviction spell has worn off of #1#."

Sub Main
   /declare HealSpell outer
   /declare HealPct outer
   /declare Splwrd outer
   
   
      /if (!${Defined[Param1]}) {   
      /echo Usage: /mac healbot Percent Healspell
      /echo Example: /mac healbot 40 Complete Heal
      /end
   }


   /if (!${Defined[Param2]}) {
      /varset HealSpell "${Param1}"
      /varset Splwrd 1
   } else /if (!${Defined[Param3]}) {
      /varset HealSpell "${Param1} ${Param2}"
      /varset Splwrd 2
   } else /if (!${Defined[Param4]}) {
      /varset HealSpell "${Param1} ${Param2} ${Param3}"
      /varset Splwrd 3
   } else {
      /varset HealSpell "${Param1} ${Param2} ${Param3} ${Param4}"
      /varset Splwrd 4
   }
   
 
   /varset HealPct ${Param0}
   
   /echo Healbot active:
   /echo Casting ${HealSpell} on your Target at ${HealPct}% Health
   
      :HealWatchLoop
      /delay 1
      /if (${Bool[${Target}]}==TRUE) {
	/if (${Target.PctHPs}<=${HealPct}) {
               /if (${Splwrd}==1) {
          /call Cast "${Param1}"
          } else /if (${Splwrd}==2) {
          /call Cast "${Param1} ${Param2}"
          } else /if (${Splwrd}==3) {
          /call Cast "${Param1} ${Param2} ${Param3}"
          } else {
          /call Cast "${Param1} ${Param2} ${Param3} ${Param4}"
            }
         }
      }
      /delay 2s
      /goto :HealWatchLoop

/return

Sub Event_BuffFade(String Line, String BuffFadeDewd)
      /tar ${BuffFadeDewd}
      /delay 1s ${Target.ID}==${BuffFadeDewd.ID}
      /delay 1
      /call cast "Conviction"
/return 

/end
Last edited by logitech3 on Tue Jul 18, 2006 2:18 pm, edited 2 times in total.

Gag
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Sep 03, 2004 5:57 pm

Post by Gag » Tue Jul 18, 2006 8:47 am

i made it so this Now auto sits once you are below 70% mp and will stand to cast then auto resit agian nice for PLing a melee class

Code: Select all


|By Fantum409 
|Date: 05/01/2004 
|---------------------------------------------------------- 

#include spellcast.inc 

Sub Main 
   /declare HealSpell outer 
   /declare HealPct outer 
   /declare Splwrd outer 
    
    
      /if (!${Defined[Param1]}) {    
      /echo Usage: /mac healbot Percent Healspell 
      /echo Example: /mac healbot 40 Complete Heal 
      /end 
   } 


   /if (!${Defined[Param2]}) { 
      /varset HealSpell "${Param1}" 
      /varset Splwrd 1 
   } else /if (!${Defined[Param3]}) { 
      /varset HealSpell "${Param1} ${Param2}" 
      /varset Splwrd 2 
   } else /if (!${Defined[Param4]}) { 
      /varset HealSpell "${Param1} ${Param2} ${Param3}" 
      /varset Splwrd 3 
   } else { 
      /varset HealSpell "${Param1} ${Param2} ${Param3} ${Param4}" 
      /varset Splwrd 4 
   } 
    
  
   /varset HealPct ${Param0} 
    
   /echo Healbot active: 
   /echo Casting ${HealSpell} on your Target at ${HealPct}% Health 
     
 :HealWatchLoop 
      /delay 1 
      /if (${Bool[${Target}]}==TRUE) { 
         /if (${Target.PctHPs}<=${HealPct}) { 
               /if (${Splwrd}==1) { 
          /call Cast "${Param1}" 
          } else /if (${Splwrd}==2) { 
          /call Cast "${Param1} ${Param2}" 
          } else /if (${Splwrd}==3) { 
          /call Cast "${Param1} ${Param2} ${Param3}" 
          } else { 
          /call Cast "${Param1} ${Param2} ${Param3} ${Param4}" 
            } 
         } 
      } 
      /if (${Me.PctMana} < 70) { 
      /if (!${Me.Sitting}) /sit 
             }
      /delay 2s 
      /goto :HealWatchLoop 

/return 

/end

Yunto?
a grimling bloodguard
a grimling bloodguard
Posts: 502
Joined: Sat Nov 19, 2005 12:05 pm

Post by Yunto? » Tue Jul 18, 2006 8:54 am

Code: Select all

#Event BuffFade "Your Conviction spell has worn off of #1#." 

Sub Event_BuffFade(String Line, String BuffFadeDewd)
      /tar ${BuffFadeDewd}
      /delay 1s ${Target.ID}==${BuffFadeDewd.ID}
      /delay 1
      /call cast "Conviction"
/return

Illona
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Jul 09, 2021 5:58 pm

Спасительная магия

Post by Illona » Thu Aug 12, 2021 10:17 pm