clericbot.mac

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

Moderator: MacroQuest Developers

ImaNoob
a ghoul
a ghoul
Posts: 89
Joined: Mon Mar 08, 2004 4:37 am

clericbot.mac

Post by ImaNoob » Thu Apr 08, 2004 5:13 am

My wife has a high level cleric, figured I would try to find an easy way to bot her, so she would just kinda follow my baby monk around and cast complete heal on him all day (power leveling?). Anyways the following script is a VERY quick attempt to fulfill that need, you need to be able to 2 box for this to work.

It is cobbled together from a few macros found here, so kudos to the contributors, if you happen to have been one, post here I will add you to the credits.

I am at work at present and really don't have a way to test this out yet, so I am posting it here. As always if you find any errors, please let me know so that I may correct them.

As a heads up if cleric runs too low on mana or HP she will gate and exit, so don't try to take down Lady Vox with a lvl 10 warrior while running this script.

Code: Select all

|ClericBot.mac
|v1.0 by ImaNoob
|Used to bot a cleric around without being grouped most useful for Powerleveling
|Usage, target person you wish to follow around and help, then /macro clericbot
|Since there currently appears to be no easy way to determine if a buff has ended, I am leaving buffing out

#turbo

#include spellcast.inc
#include advpath.inc

Sub Main
	/zapvars
	/call Delarations
	/call SetVars
	/call FollowAndHEAL
/return

Sub Declarations
	/declare HEALSPELL global
	/declare EVAC global
	/declare MELEE_NAME global
/return

Sub SetVars 
   /varset MAIN_BUFF "Virtue" 
   /varset HEALSPELL "Complete Healing" 
   /varset EVAC "Gate"
   /varset MELEE_NAME $target(name) 
/return 

SUb FollowAndHeal
	:MAIN_LOOP
		/if n (DistanceFunction($target) >= $spell("@HEALSPELL",range)){
			/call FollowFunction ($target)
			/delay 2s
		}
		/if n ($target(hp,pct) <= 50){
			/call Cast "@HEALSPELL"
			/delay $spell("@HEALSPELL",casttime)
		}
		/call CheckSelfHP
		/call CheckMana
	/goto :MAIN_LOOP
/return

Sub CheckSelfHP 
| Check our current Hit Points and Port out if below 20%. 
   /if n $char(hp,pct)<=20 { 
      /echo HEY!!!  I'm DIEING!!!  Time to bug out!!!  [HP: $char(hp,pct)%] 
      /call cast "@EVAC" 
   } 
| Check our current Hit Points and if below 60%, Heal until we reach 90%. 
   /if n $char(hp,pct)<=60 { 
      /target myself 
      /call Cast "@HEALSPELL"
      /delay $spell("@HEALSPELL",casttime)
      /target @MELEE_NAME
   } 
/return 


Sub CheckMana 
| Check our current Mana and Port out if below 20%. 
   /if n $char(mana,pct)<=20 { 
      /echo HEY!!!  I'm almost OOM!!!  Time to bug out!!!  [MANA: $char(mana,pct)%] 
      /call cast "@EVAC" 
   } 
| Check our current Mana and if below 40%, Meditate until we reach 90%. 
 	/if n $char(mana,pct)<=40 { 
	:MedLoop 
		/echo LOW MANA!!!  Medding [MANA: $char(mana,pct)%] 
         	/if ($char(state)!="SIT") &&  ($char(state)!="MOUNTED"){
	 		/sit on 
         	} 
         	/delay 10s			 
		/if n $char(mana,pct)<=90 /goto :MedLoop
	}
	/sit off 
/return 

Drunkensloth
a lesser mummy
a lesser mummy
Posts: 67
Joined: Sat Oct 18, 2003 2:54 am

updating :P

Post by Drunkensloth » Mon Apr 12, 2004 7:16 pm

going to take a look and update for MQ2Data instead of parms

also, fixing some general stuff as well~
And here I was clicking like a sucker!

Drunkensloth
a lesser mummy
a lesser mummy
Posts: 67
Joined: Sat Oct 18, 2003 2:54 am

Post by Drunkensloth » Tue Apr 13, 2004 12:02 am

here you go...

Code: Select all

|ClericBot.mac
|v1.0 by ImaNoob
|v1.1 updated by Drunkensloth
|Used to bot a cleric around without being grouped most useful for Powerleveling
|usage  /mac clericbot <TankName> <Heal spell> <heal %> <EnchanterName> <Heal spell> <heal %>
|
|
|NOTE: you need some way to get safe... i call this method /jump safe    edit it to cast gate for you
|
|if you dont have this, replace /jump safe  w/    /call Cast Gate
|
|revision history
|1.1 cleaned up most of the subs, added in a secondary heal target, will work on fixing that logic next, changed target input..
|
|untested... all of this is untested at the moment
|i have absolutely no idea how advpath works... or how it works within this macro.
|
|upcoming:
|looking to add entire group support
|without wasting too many cycles or having way too much code
|be smarter about healing... who gets healed first



#turbo

#include spellcast.inc
#include advpath.inc

Sub Main
/echo Welcome to ImaNoob's Clericbot upgraded by: Drunkensloth
/echo Version 1.1a
|~~~~~~~~~~~~~DECLARATIONS~~~~~~~~~~~|
   /declare MELEE_SPELL global
   /declare MELEE_NAME global
   /declare MELEE_HEAL global
   /declare ENCHANTER_SPELL global
   /declare ENCHANTER_NAME global
   /declare ENCHANTER_HEAL global
|~~~~~~~~~~~~~END DECLARATIONS~~~~~~~~~~~|


|~~~~~~~~~~~~~VARSETS~~~~~~~~~~~~~~~~|
   /varset MELEE_NAME @Param0
   /varset MELEE_SPELL @Param1
   /varset MELEE_HEAL @Param2
   /varset ENCHANTER_NAME @Param3
   /varset ENCHANTER_SPELL @Param4
   /varset ENCHANTER_HEAL @Param5
|~~~~~~~~~~~~~END VARSETS~~~~~~~~~~~~~~~~|

|~~~~~~~~~~~~~START WATCHING~~~~~~~~~~~~~|

   :MAIN_LOOP
|melee
|
/tar @Param0
      /if n (DistanceFunction(${Target}) >= ${Spell["@MELEE_SPELL"].Range} {
         /call FollowFunction (${Target})
         /delay 2s
      }  else {
	/tt get in range please
	}
      /if n ${Target.PctHPs} <= @MELEE_HEAL){
	 /sit off
         /call Cast "@MELEE_SPELL"
	 /sit
      }

|enchanter
|
/tar @Param1
      /if n (DistanceFunction(${Target}) >= ${Spell["@MELEE_SPELL"].Range} {
         /call FollowFunction (${Target})
         /delay 2s
      } else {
	/tt get in range please
	}
      /if n ${Target.PctHPs} <= @ENCHANTER_HEAL){
	 /sit off
         /call Cast "@ENCHANTER_SPELL"
	 /sit
      }
| Check our current Hit Points and Port out if below 20%.
   /if n ${Me.PctHPs}<=40 {
      /echo HEY!!!  I'm DIEING!!!  Time to bug out!!!  [HP: ${Me.PctHPs}%]
      /jump safe
   }
| Check our current Hit Points and if below 60%, Heal until we reach 90%.
   /if n ${Me.PctHPs}<=75 {
      /target myself
      /call Cast "@ENCHANTER_SPELL"
      /target @MELEE_NAME
   }
   /goto :MAIN_LOOP
/return
And here I was clicking like a sucker!