Page 1 of 1

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

Posted: Sun May 02, 2004 1:30 am
by fantum409
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 

Posted: Wed Mar 08, 2006 4:55 pm
by Learningcurve
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

Posted: Mon Mar 13, 2006 8:13 am
by nikko
macro loads fine...cleric doesnt start heal tho..i set heal at 70% and it loads just fine but doesnt seem to work

Posted: Mon Mar 13, 2006 8:15 pm
by NeXuS
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 

Posted: Thu Apr 06, 2006 4:22 am
by Lord Beavis
same for me. it doesnt seem to work.
Even made sure to have spell in gem1

Posted: Fri Apr 07, 2006 12:10 pm
by DeeGee
What are you typing in to start it? Remember to use quotes if the paramater has more than one word.

Posted: Mon Apr 10, 2006 3:09 am
by Lord Beavis
Doh, Didn't use quotes for the heal spell. Will have to try that next time.

Posted: Sun Jun 18, 2006 12:33 pm
by asele01
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.

Posted: Mon Jun 19, 2006 10:23 am
by methodx
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?

Posted: Mon Jun 19, 2006 10:25 pm
by asele01
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.

Posted: Tue Jul 18, 2006 4:02 am
by logitech3
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

Posted: Tue Jul 18, 2006 8:47 am
by Gag
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

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

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

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

Posted: Thu Aug 12, 2021 10:17 pm
by Illona

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

Posted: Mon Aug 16, 2021 4:28 am
by Illona