AFCleric.mac - Cleric automation macro (updated Aug 24th)

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

Moderator: MacroQuest Developers

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Tue Nov 02, 2004 4:31 pm

I'm playing with some code to "aggresively" handle deciding which heal is right for a given situation. If you want to try adding in your own stuff to check for the mob's being slowed etc, I suggest using the search button above..there's tons of examples to be found of how to use your own custom events.

Don't be afraid to get your hands dirty, MQ2's macro language is about as simple as scripting languages get.

Useless
a ghoul
a ghoul
Posts: 84
Joined: Fri Jul 16, 2004 2:29 pm

Post by Useless » Tue Nov 02, 2004 5:19 pm

True it is a HELL of a lot easier to figure out what it is doing then many web things I have copy/paste "borrowed" code from. I was thinking to use some of the code from the Chanter mac to check for a slowed condition to start using CH and possibly for the chanter to send a tell to the cleric/bot channel to alert the cleric if slow wore off.

As for using fast heals until slow condition achieved I was considering just starting macro with pious remedy to start and then having the slow event trigger CH to be used next heal after tank if tank is above the heal threshhold or even to reset the heal threshold until mob is dead and then recycle to the initial heal and threshold.
Absolutly Useless
Why lie?

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Fri Nov 05, 2004 1:33 pm

I'm about to start working on a cleric mac myself. The slow thing is one thing I've been thinking of how to handle. One thing that might help out a lot tho is, I added in a new variable to spell_routines.inc. ${castEndTime} is the amount of deciseconds left till the current spell finishes. Can possibly, start CHing, and if the tank is dropping too fast and there's a long time left on CH, then duck and do light or remedy depending on how low they are. Maybe also calculate how fast the tank is dying to see what spells to use. If they start taking dmg more slowly, you could adjust. Checking events for slow is a bad thing tho imo since there's lots of times where you can be out of range of spell messages.

Useless
a ghoul
a ghoul
Posts: 84
Joined: Fri Jul 16, 2004 2:29 pm

Post by Useless » Fri Nov 05, 2004 2:53 pm

True checking HP on tank is better and more trackable event as far as I can tell being n00b_wannabe_01. Not sure how calculating HP loss of tank would work. I was thinking more along the lines of checking MTs hp vs how long CH has left to land. If it is a variable then it can be user adjusted for different situations/tanks. Possibly even adjusted on the fly if it needs a tweak. Say I know my tank is 9.5khp with just virtue and clickie, I can say if CH isn't atleast 1/2 way done by the time he is at say 40% then with bad luck on the RNG he may not last long enough for CH to land but still have time to cast pious remedy even if first one fizzles. Of course then would probably need another patch heal to get him up to the min lvl for CH instead of patch heal. But this would eleminate the need to check if mob is slowed and allows for more protection incaes mob is still a butt kicker even slowed.

Thing is this macro is so efficiant in the way it uses mana that my cleric is usually fom almost all the time while my other casters go lom after a chain of about 5 mobs so I was thinking set right I could fight in say MPG instead of WoS and just throttle my casters back a bit.
Absolutly Useless
Why lie?

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Fri Nov 05, 2004 9:29 pm

Yeah it would probably be easier to code that way too. something like

Code: Select all

| if casting CH...
/if ( ${castEndTime}>=50 && ${Target.PctHPs}<=40 ) {
   /call Interrupt
   /if ( ${Target.PctHPs}<=30  ) {
      /call Cast "remedy"      
   } else {
      /call Cast "light"
   }
}
don't really play a cleric much but something along those lines might work.

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Fri Nov 05, 2004 9:48 pm

This is a sub I wrote earlier today..
Makes use of Divine Arbitration

Code: Select all

Sub CheckTankHP

   /if (${Target.PctHPs}<25 && ${castEndTime}>25) {
   /call Interrupt
      /if ${Me.AltAbilityReady[Divine Arbitration]} {
         /delay 1
         /if (${DivineArbTimer}<1) {
            /g --Divine Arbitration--
            /varset DivineArbTimer 300
         }
         /call Cast "Divine Arbitration" alt 3s
      } else {
         /delay 1
         /if (${SpamTimer}<1) {
            /g Ducked CH, Pious Light [ %t ]
            /varset SpamTimer 80
         }
         /call Cast "Pious Light" spell 2s
      }
   }
   
/return
Untested however...

Useless
a ghoul
a ghoul
Posts: 84
Joined: Fri Jul 16, 2004 2:29 pm

Post by Useless » Tue Nov 09, 2004 11:46 am

Looks good will give it a shot when I get home.
Absolutly Useless
Why lie?

Birdbrain
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sat Oct 23, 2004 1:40 pm

Bug possibly?

Post by Birdbrain » Mon Nov 15, 2004 3:07 pm

Anyone know if this can be fixed? When a monk isnt fd it doesnt heal them, so like it just keeps repeating the spam untill the monk fds for heal...

ztrike
a ghoul
a ghoul
Posts: 83
Joined: Fri Mar 26, 2004 1:17 pm
Contact:

Post by ztrike » Tue Nov 16, 2004 3:56 am

Code: Select all

/declare onlyhealfd int outer 1 
change that to ..

Code: Select all

/declare onlyhealfd int outer 0
Ztrike out

Birdbrain
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sat Oct 23, 2004 1:40 pm

Post by Birdbrain » Tue Nov 16, 2004 3:21 pm

thnx!

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Thu Nov 25, 2004 4:13 pm

Added omens bufs, also removed the call to BuffBeg at the end, as it seemed rather..odd practice..to immediately enter a sub with a lot of /pause code in it after being so low on HP one needed to DA and clicks ones own buffs to survive.

Code: Select all

Sub TrickyDA 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Virtue].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Virtue].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Conviction].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Conviction].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Hand of Virtue].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Hand of Virtue].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Hand of Conviction].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Hand of Conviction].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Focus of Soul].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Focus of Soul].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Wunshi's Focusing].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Wunshi's Focusing].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Focus of the Seventh].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Focus of the Seventh].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Talisman of Wunshi].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Talisman of Wunshi].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Protection of the Nine].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Protection of the Nine].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Steeloak Skin].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Steeloak Skin].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Blessing of the Nine].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Blessing of the Nine].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Blessing of Steeloak].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Blessing of Steeloak].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Symbol of Kazad].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Symbol of Kazad].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Symbol of Balikor].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Symbol of Balikor].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Kazad`s Mark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Kazad`s Mark].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Balikor`s Mark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Balikor`s Mark].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Brell's Stalwart Shield].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Brell's Stalwart Shield].ID}-1].Int} leftmouseup 
   /if ((${Me.PctHPs}<40)&&(${Me.Buff[Brell's Brawny Bulwark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Brell's Brawny Bulwark].ID}-1].Int} leftmouseup 
   /if (${Me.Buff[${daspell}].ID}) { 
      :waitalittle 
      /delay 1s ${Me.Buff[${daspell}].Duration}<2 
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle 
   } 
   /varset buffbeg 1 
/return 

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Fri Dec 03, 2004 4:27 am

Code: Select all

|**----------------------------------------------------------
AFCleric.mac

  Run the macro with Main Tank targeted.
  Usage: /mac AFCleric <%health> <Heal spell>
  Defaults to casting Complete Healing at 60%
  
  This Cleric macro operates in 4 modes:
  
  autohealmode=0 will watch a single target's health
  relentlessly. The cleric will not heal self or group, only
  the specified Tankname at the specified %health.
  
  autohealmode=1 will watch Tank as above, but also heal
  self and even attempt to cast DA if self HP get too low.
  
  autohealmode=2 will watch Tank, self, and also the rest of
  the group. Heals will go first to the person in group with
  lowest HP percentage. Healtypes for people other than Tank
  and self will be based on Class and HP percentage.
  
  autohealmode=3 is exactly the same as mode 2, except that
  Tank HP and self HP are double checked immediately before
  healing anyone else. If Tank or self HP are low enough to
  justify a heal, they get it first even if other group
  members have lower HP. IE: it tries not to let Tank or
  self die while healing that overnuking wizard. =)

FaNTuM

Changes by Cr4zyb4rd:

  Tries to compute pecentage-per-second that the tank is losing
  and estimated time-to-live based on that.  Aborts heal if the
  tank looks like he'll survive long enough to cast another one.
  (and pushes this limit even farther if Divine Arb is up) this
  makes it ok to set a fairly high default range to start CH
  (I use 85 or 90%) since it will only go through if needed,
  though keep in mind that the cleric will never be "idle" so it
  will take longer to service chat requests or patch other
  group members.
  
  Currently isn't real smart about these computations...it keeps
  the %per-second as a running tab "per fight" rather than just
  the past X seconds, so it doesn't handle things like slows
  landing\dropping or flurry, etc. Plenty of work to be done,
  but it's about 5x more mana-efficient than the basic AFCleric
  in a typical "XP grind" type situation.

----------------------------------------------------------**|

#turbo 40
#include spell_routines.inc
#Chat tell
#Chat group
#event WinFight "You gain party experience!!"

Sub Main

|------------READ THIS SECTION AND EDIT IF NEEDED-----------|

/declare mychannel string outer zergjustice
/declare autohealmode int outer 3
/declare healspell string outer Complete Healing
/declare healspellrange int outer ${Me.Book[${Me.Book[${healspell}]}].Range}
/declare patchheal string outer ${If[${Me.Book[Pious Remedy]},Pious Remedy,Supernal Remedy]}
/declare patchhealrange int outer ${Me.Book[${Me.Book[${patchheal}]}].Range}
/declare hotspell string outer ${If[${Me.Book[Pious Elixir]},Pious Elixir,Supernal Elixir]}
/declare hotspellrange int outer ${Me.Book[${Me.Book[${hotspell}]}].Range}
/declare daspell string outer Divine Barrier
/declare yaulpspell string outer ${If[${Me.Book[Yaulp VII]},Yaulp VII,Yaulp VI]}
/declare celestialregen string outer Celestial Rejuvenation
/declare usegroupheal int outer 1
/declare groupheal string outer Word of Replenishment
/declare grouphealrange int outer 70
/declare usedivarb int outer 1
/declare healafterdivarb int outer 1
/declare announce int outer 1
/declare announcemana bool outer TRUE
/declare autosit int outer 1
/declare distancetosit int outer 40
/declare autointerrupt int outer 1
/declare onlyhealfd int outer 1
/declare interrupt2healself int outer 1
/declare interrupt2healselfhp int outer 50
/declare noInvis int outer 1
/declare defaultstophealpoint int outer 80
/declare trickyda int outer 1
/declare acbuff string outer ${If[${Me.Book[Ward of Valiance]},Ward of Valiance,Ward of Gallantry]}
/declare longhpbuff string outer ${If[${Me.Book[Conviction]},Conviction,Virtue]}
/declare singlesymbuff string outer ${If[${Me.Book[Symbol of Balikor]},Symbol of Balikor,Symbol of Kazad]}
/declare groupsymbuff string outer Kazad`s Mark
/declare spellhastebuff string outer ${If[${Me.Book[Blessing of Devotion]},Blessing of Devotion,Blessing of Reverence]}
/declare rgcspell string outer Remove Greater Curse
/declare healpetmode int outer 2
/declare pethealpoint int outer 60
/declare manatohealpet int outer 60
/declare pethealspell string outer Complete Healing
/declare pethealspellrange int outer 100
/declare nukeone string outer ${If[${Me.Book[Reproach]},Reproach,Order]}
/declare nuketwo string outer Condemnation
/declare stunone string outer ${If[${Me.Book[Sound of Divinity]},Sound of Divinity,Sound of Might]}
/declare stuntwo string outer ${If[${Me.Book[Shock of Wonder]},Shock of Wonder,Tarnation]}


|** Tweak Heals Here - tankhealpoint is for War/Pal/SK other
 than MT, casterhotpoint and casterpatchpoint refer to
 wiz/mag/enc/dru, necshmpatchpoint refers to necros and
 shamans, defaultpatchpoint refers to all other classes.   **|

/declare selfhealpoint int outer 85
/declare dacastpoint int outer 32
/declare divarbpoint int outer 30
/declare tankhealpoint int outer 65
/declare casterhotpoint int outer 85
/declare casterpatchpoint int outer 60
/declare necshmpatchpoint int outer 60
/declare defaultpatchpoint int outer 70

|------------------------END EDITING------------------------|

/declare healpct int outer 85
/declare tankname string outer ${Target}
/declare tanknameid int outer
/declare tankclass string outer
/declare minorhurt int outer 0
/declare majorhurt int outer 0
/declare worsthurt string outer NULL
/declare worsthurtid int outer
/declare worsthp int outer 100
/declare worstclass string outer NULL
/declare gmember int outer
/declare nohotforua string outer NULL
/declare nohotforub string outer NULL
/declare nohotforuc string outer NULL
/declare nohotforud string outer NULL
/declare rodwait int outer 0
/declare following int outer 0
/declare follname string outer NULL
/declare pallycount int outer 0
/declare stophealpoint int outer ${defaultstophealpoint}
/declare buffbeg int outer 0
/declare oomspam int outer 1
/declare lomspam int outer 1
/declare duckspam int outer 1
/declare duckfdspam int outer 1
/declare duckselfspam int outer 1
/declare nomtspam int outer 1
/declare ghealhurtcount int outer 0
/declare divarboor int outer 0
/declare tankppstimer timer outer 0
/declare ppsresettimer timer outer 0
/declare tankpps float outer 0
/declare tanktimetolive int outer 0
/declare tanklastpct int outer 0
/declare totaltankhits int outer 0


/join ${mychannel}:zergjustice

/if (!${Target.ID}) {
	/echo Target the Tank when you run this macro to designate him as MT
	/end
} else {
	/varset tanknameid ${Target.ID}
	/varset tankclass ${Target.Class.Name}
}

/if (${Defined[Param0]}) {
	/varset healpct ${Param0}
} else {
	/echo No Heal% specified, defaulting to 80%
}

/if (!${Defined[Param1]}) {
	/echo Usage: /mac AFCleric % healspell
	/echo Example: /mac AFCleric 40 Complete Heal
	/echo Defaulting to ${healspell} at ${healpct}%
} else {
	/if (!${Defined[Param2]}) {
		/varset healspell ${Param1}
	} else /if (!${Defined[Param3]}) {
		/varset healspell ${Param1} ${Param2}
	} else /if (!${Defined[Param4]}) {
		/varset healspell ${Param1} ${Param2} ${Param3}
	} else {
		/varset healspell ${Param1} ${Param2} ${Param3} ${Param4}
	}
}

/echo AFCleric Active, running in Autohealmode ${autohealmode}
/echo Casting ${healspell} on ${tankname} at ${healpct}% HP
/if (${autohealmode}==0) /echo ONLY ${tankname} will be healed
/if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed
/if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed
/if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group

:tankwatchloop
/if (${String[${Spawn[${tanknameid}]}].NotEqual[${tankname}]}) /varset tanknameid 0
/if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) {
	/if (${SpawnCount[${tankname} ${tankclass}]}==1) {
		/varset tanknameid ${Spawn[${tankname} ${tankclass}].ID}
		/echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid}
	}
	/if (${SpawnCount[${tankname} ${tankclass}]}>1) {
		/if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
			/beep
			/varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID}
			/echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro
		} else {
			/beep
			/echo Need to restart macro to correctly identify the MT
		}
	}
}
/if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) {
	/if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) {
		/varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID}
		/echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro
	}
}
/if ((!${Target.ID})||(${Target.ID}!=${tanknameid})) {
/if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) {
	/target id ${tanknameid}
	/delay 6 ${Target.ID}==${tanknameid}
}
}
/if (!${Spawn[${tanknameid}].ID}) {
	/if (${nomtspam}==1) {
		/echo Warning No Designated MT is available
		/timed 300 /varset nomtspam 1
		/varset nomtspam 0
	}
}
/if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) {
	/gsay ${Me.PctMana}m
	/varset lomspam 0
	/timed 300 /varset lomspam 1
}
/if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) {
	/gsay oom
	/varset oomspam 0
	/timed 300 /varset oomspam 1
	/call MedTime
}
/if (${GameState.Equal[CHARSELECT]}) /end
/if (${Target.ID}==${tanknameid}) {
	| Incoming DPS to tank calc

	/if (!${tanklastpct} || !${ppsresettimer} || ${NearestSpawn[npc].Distance} > 400) {
		/varset tanklastpct ${Target.PctHPs}
		/varset tankppstimer 10000
		/varset ppsresettimer 100
		/varset totaltankhits 0
	}

	/call CheckPPS

	/varset stophealpoint ${Math.Calc[${healpct}*1.1]}
	/if (${Target.ID}!=${tanknameid} && (${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) {
		/if (${announce}==1) /gsay %T, have a ${patchheal.Lower} you fucking lush
		/call Cast "${patchheal}" gem2 1s CheckHP
		/delay 15 ${Me.SpellReady[${patchheal}]}
	}
	/if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})) {
		/if (${announce}==1) /gsay casting ${healspell.Lower} on %T
		/call Cast "${healspell}" gem1 1s CheckHP
		/delay 15 ${Me.SpellReady[${healspell}]}
	}
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
}
/if ((${autosit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
	/if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand
}
/if ((${autosit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) {
	/if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand
}
/if (${autohealmode}==0) {
	/call CheckEvents
	/goto :tankwatchloop
}
/if ((${autohealmode}>=1)&&(${Me.PctHPs}<=${selfhealpoint})) /call Healself
/if (${autohealmode}>=2) {
	/if ((${Target.PctHPs}>${healpct})||(${Target.Distance}>${healspellrange})||(${Target.PctHPs}<=1)||(!${Target.ID})||(${Target.ID}!=${tanknameid})) {
	/call Healgroup
}
}
/if ((${autohealmode}<2)&&(${Me.PctHPs}>${selfhealpoint})&&(${Me.PctMana}<=98)) /call MedTime
/call CheckEvents
/goto :tankwatchloop
/return


Sub Healself
/if (${Me.PctHPs}>${selfhealpoint}) /return
/varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
/if ((!${Target.ID})||(${Target.PctHPs}>=${Math.Calc[1.1*${healpct}]})||(${Target.PctHPs}<=1)||(${Target.ID}!=${tanknameid})) {
/if ((${Me.PctHPs}<=${selfhealpoint})&&(${Me.PctHPs}>${dacastpoint})) {
	/target myself
	/delay 6 ${Target.Name.Equal[${Me}]}
	/if (${Target.Name.Equal[${Me}]}) {
		/if (${announce}==1) /gsay Casting ${patchheal} on %T
		/call Cast "${patchheal}" gem2 1s CheckHP
		/delay 15 ${Me.SpellReady[${patchheal}]}
	}
}
/if ((${Me.PctHPs}<=${dacastpoint})&&(${Me.SpellReady[${daspell}]})) {
	/if (${announce}==1) /gsay Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS
	:retryda
	/call Cast "${daspell}"
	/delay 1
	/if ((!${Me.Buff[${daspell}].ID})&&(${Me.SpellReady[${daspell}]})) /goto :retryda
	/if ((${trickyda}==1)&&(${Me.Buff[${daspell}].ID})) /call TrickyDA
	:dawait
	/if (${Me.Buff[${daspell}].ID}) {
		/delay 1s !${Me.Buff[${daspell}].ID}
		/varset stophealpoint ${defaultstophealpoint}
		/call CheckEvents
		/goto :dawait
	}
}
}
/if (${Me.PctHPs}<=${Math.Calc[${selfhealpoint}*0.7]}) {
	/target myself
	/delay 6 ${Target.Name.Equal[${Me}]}
	/if (${Target.Name.Equal[${Me}]}) {
		/if (${announce}==1) /gsay Casting ${patchheal} on %T
		/varset stophealpoint ${Math.Calc[${selfhealpoint}+5]}
		/call Cast "${patchheal}" gem2 1s CheckHP
		/delay 15 ${Me.SpellReady[${patchheal}]}
	}
}
/varset stophealpoint ${defaultstophealpoint}
/return


Sub Healgroup
:healgroup
/varset worsthurt NULL
/varset worsthp 100
/varset worstclass NULL
/varset minorhurt 0
/varset majorhurt 0
/varset ghealhurtcount 0
/for gmember 0 to ${Group}
/if (${onlyhealfd}==0) {
	/if (${Group[${gmember}].Distance}<=${patchhealrange}) {
		/if (${Group[${gmember}].PctHPs}<=${worsthp}) {
			/varset worsthurt ${Group[${gmember}].Name}
			/varset worsthurtid ${Group[${gmember}].ID}
			/varset worsthp ${Group[${gmember}].PctHPs}
			/varset worstclass ${Group[${gmember}].Class.Name}
		}
	}
}
/if (${onlyhealfd}==1) {
	/if (${Group[${gmember}].Distance}<=${patchhealrange}) {
		/if ((${Group[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group[${gmember}].PctHPs}<=${worsthp})) {
			/varset worsthurt ${Group[${gmember}].Name}
			/varset worsthurtid ${Group[${gmember}].ID}
			/varset worsthp ${Group[${gmember}].PctHPs}
			/varset worstclass ${Group[${gmember}].Class.Name}
		}
		/if ((${Group[${gmember}].Class.Name.Equal[Monk]})||(${Group[${gmember}].Class.Name.Equal[Necromancer]})) {
		/if ((${Group[${gmember}].State.Equal[feign]})&&(${Group[${gmember}].PctHPs}<=${worsthp})) {
			/varset worsthurt ${Group[${gmember}].Name}
			/varset worsthurtid ${Group[${gmember}].ID}
			/varset worsthp ${Group[${gmember}].PctHPs}
			/varset worstclass ${Group[${gmember}].Class.Name}
		}
	}
}
}
/if ((${Group[${gmember}].Distance}<=${grouphealrange})&&(${Group[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1
/if ((${Group[${gmember}].PctHPs}<=85)&&(${Group[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1
/if ((${Group[${gmember}].PctHPs}<=60)&&(${Group[${gmember}].PctHPs}>=1)) /varcalc majorhurt ${majorhurt}+1
/next gmember
/if (${autohealmode}==3) {
	/if ((!${Target.ID})||(${Target.Name.NotEqual[${tankname}]})) /if (${Spawn[${tanknameid}].ID}) {
	/target id ${tanknameid}
	/delay 6 ${Target.ID}==${tanknameid}
	/delay 1
	/if ((${Target.ID}==${tanknameid})&&(${Target.PctHPs}<=${healpct})&&(${Target.Distance}<=${healspellrange})) /return
}
/if (${Me.PctHPs}<=${selfhealpoint}) /return
}
/if ((${majorhurt}==0)&&(${minorhurt}==0)) {
	/if (${Spawn[${tanknameid}].ID}) {
		/target id ${tanknameid}
		/delay 6 ${Target.ID}==${tanknameid}
		/delay 1
	}
	/if (((${Target.ID}==${tanknameid})&&(${Target.PctHPs}>${healpct}))||(!${Spawn[${tanknameid}].ID})||(${Spawn[${tanknameid}].Type.Equal[corpse]})) {
	/if ((${healpetmode}>0)&&(${Me.PctMana}>=${manatohealpet})) /call HealPet
	/if (${Me.PctMana}<=98) /call MedTime
}
/call CheckEvents
/return
}
/if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${Me.AltAbilityReady[Divine Arbitration]})) {
	/call Cast "Divine Arbitration" alt 3s
	/delay 3 ${Me.AltAbilityReady[Divine Arbitration]}
	/if (${Me.AltAbilityReady[${celestialregen}]}) {
		/if (${announce}==1) /gsay CR inc
		/call Cast "${celestialregen}" alt 1s
		/delay 25
	} else /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
		/if (${announce}==1) /gsay group heal, hug mah!
		/call Cast "${groupheal}" gem4 1s
		/delay 15 ${Me.SpellReady[${groupheal}]}
	}
	/varset divarboor 0
	/return
}
/if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3)&&(${usegroupheal}==1)) {
	/if (${announce}==1) /gsay Inc Grp Heal, get close
	/call Cast "${groupheal}" gem4 1s
	/delay 15 ${Me.SpellReady[${groupheal}]}
	/call CheckEvents
	/return
}
/if (${worsthurtid}==${tanknameid}) /return
/if (${worsthurtid}==${Me.ID}) {
	/call Healself
	/call CheckEvents
	/return
}
/if ((${String[${worstclass}].Equal[Warrior]})||(${String[${worstclass}].Equal[Paladin]})||(${String[${worstclass}].Equal[Shadow Knight]})) {
/if ((${worsthp}<=${tankhealpoint})&&(${worsthp}>=${Math.Calc[0.7*${tankhealpoint}]})&&(${majorhurt}<=1)&&(${minorhurt}<=1)) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
	/if (${announce}==1) /gsay Casting ${healspell} on %T
	/call Cast "${healspell}" gem1 1s CheckHP
	/delay 15 ${Me.SpellReady[${healspell}]}
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/return
}
/if (${worsthp}<=${tankhealpoint}) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/varset stophealpoint ${Math.Calc[${tankhealpoint}+5]}
	/if (${announce}==1) /gsay Casting ${patchheal} on %T
	/call Cast "${patchheal}" gem2 1s CheckHP
	/delay 15 ${Me.SpellReady[${patchheal}]}
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/return
}
} else /if ((${String[${worstclass}].Equal[Magician]})||(${String[${worstclass}].Equal[Wizard]})||(${String[${worstclass}].Equal[Enchanter]})||(${String[${worstclass}].Equal[Druid]})) {
/if ((${worsthp}<=${casterhotpoint})&&(${worsthp}>${casterpatchpoint})) {
	/if ((${String[${worsthurt}].Equal[${nohotforua}]})||(${String[${worsthurt}].Equal[${nohotforub}]})||(${String[${worsthurt}].Equal[${nohotforuc}]})||(${String[${worsthurt}].Equal[${nohotforud}]})) /return
	/if (${String[${nohotforua}].Equal[NULL]}) {
		/target id ${worsthurtid}
		/delay 5 ${Target.ID}==${worsthurtid}
		/if (!${Target.ID}) /return
		/if (${Target.ID}!=${worsthurtid}) /return
		/varset nohotforua ${Target.Name}
		/if (${announce}==1) /gsay Casting ${hotspell} on %T
		/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
		/call Cast "${hotspell}" gem3 1s CheckHP
		/timed ${Math.Calc[10*${Spell[${hotspell].Duration.TotalSeconds}]} /varset nohotforua NULL
		/delay 15 ${Me.SpellReady[${hotspell}]}
	} else /if (${String[${nohotforub}].Equal[NULL]}) {
		/target id ${worsthurtid}
		/delay 5 ${Target.ID}==${worsthurtid}
		/if (!${Target.ID}) /return
		/if (${Target.ID}!=${worsthurtid}) /return
		/varset nohotforub ${Target.Name}
		/if (${announce}==1) /gsay Casting ${hotspell} on %T
		/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
		/call Cast "${hotspell}" gem3 1s CheckHP
		/timed ${Math.Calc[10*${Spell[${hotspell}].Duration.TotalSeconds}]} /varset nohotforub NULL
		/delay 15 ${Me.SpellReady[${hotspell}]}
	} else /if (${String[${nohotforuc}].Equal[NULL]}) {
		/target id${worsthurtid}
		/delay 5 ${Target.ID}==${worsthurtid}
		/if (!${Target.ID}) /return
		/if (${Target.ID}!=${worsthurtid}) /return
		/varset nohotforuc ${Target.Name}
		/if (${announce}==1) /gsay Casting ${hotspell} on %T
		/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
		/call Cast "${hotspell}" gem3 1s CheckHP
		/timed ${Math.Calc[10*${Spell[${hotspell].Duration.TotalSeconds}]} /varset nohotforuc NULL
		/delay 15 ${Me.SpellReady[${hotspell}]}
	} else /if (${String[${nohotforud}].Equal[NULL]}) {
		/target id ${worsthurtid}
		/delay 5 ${Target.ID}==${worsthurtid}
		/if (!${Target.ID}) /return
		/if (${Target.ID}!=${worsthurtid}) /return
		/varset nohotforud ${Target.Name}
		/if (${announce}==1) /gsay Casting ${hotspell} on %T
		/varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
		/call Cast "${hotspell}" gem3 1s CheckHP
		/timed ${Math.Calc[10*${Spell[${hotspell].Duration.TotalSeconds}]} /varset nohotforud NULL
		/delay 15 ${Me.SpellReady[${hotspell}]}
	}
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/return
}
/if ((${worsthp}<=${casterpatchpoint})&&(${worsthp}>=1)) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/if (${announce}==1) /gsay casting ${patchheal.Lower} on %T
	/call Cast "${patchheal}" gem2 1s CheckHP
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/delay 15 ${Me.SpellReady[${patchheal}]}
	/return
}
/varset stophealpoint ${defaultstophealpoint}
} else /if ((${String[${worstclass}].Equal[Necromancer]})||(${String[${worstclass}].Equal[Shaman]})) {
/if ((${worsthp}<=${necshmpatchpoint})&&(${worsthp}>=1)) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/varset stophealpoint ${Math.Calc[${necshmpatchpoint}+5]}
	/if (${announce}==1) /gsay Casting ${patchheal} on %T
	/call Cast "${patchheal}" gem2 1s CheckHP
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/delay 15 ${Me.SpellReady[${patchheal}]}
	/return
}
} else /if ((${worsthp}<=${defaultpatchpoint})&&(${worsthp}>=1)) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/if (${announce}==1) /gsay Casting ${patchheal} on %T
	/varset stophealpoint ${Math.Calc[${defaultpatchpoint}+5]}
	/call Cast "${patchheal}" gem2 1s CheckHP
	/varset stophealpoint ${defaultstophealpoint}
	/call CheckEvents
	/delay 15 ${Me.SpellReady[${patchheal}]}
	/return
}
/varset stophealpoint ${defaultstophealpoint}
/if ((${healpetmode}==2)&&(${Me.PctMana}>${manatohealpet})) /call HealPet
/return


Sub HealPet
/varset worsthurt NULL
/varset worsthp 100
/for gmember 0 to ${Group}
/if (${Group[${gmember}].Pet.ID}) {
	/if (${Group[${gmember}].Pet.Distance}<=${pethealspellrange}) {
		/if ((${Group[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group[${gmember}].Pet.PctHPs}<=${pethealpoint})) {
			/varset worsthurt ${Group[${gmember}].Pet.Name}
			/varset worsthurtid ${Group[${gmember}].Pet.ID}
			/varset worsthp ${Group[${gmember}].Pet.PctHPs}
		}
	}
}
/next gmember
/if (${String[${worsthurt}].NotEqual[NULL]}) {
	/target id ${worsthurtid}
	/delay 5 ${Target.ID}==${worsthurtid}
	/if (!${Target.ID}) /return
	/if (${Target.ID}!=${worsthurtid}) /return
	/delay 3
	/if (${Target.PctHPs}<=${pethealpoint}) {
		/if (${announce}==1) /gsay Casting ${pethealspell} on %T
		/varset stophealpoint ${Math.Calc[${pethealpoint}+5]}
		/call Cast "${pethealspell}" spell 1s CheckHP
		/varset stophealpoint ${defaultstophealpoint}
		/delay 15 ${Me.SpellReady[${pethealspell}]}
	}
}
/return


Sub CheckEvents
/delay 1
|   /doevents Chat
|   /doevents tell
|   /doevents flush
/doevents
/return


Sub MedTime
:oomwait
/call CheckEvents
/If (${FindItem["Rod of Mystical Transvergance"].InvSlot} && ${Me.PctMana}<=70 && ${Me.PctHPs}>=98 && !${rodwait}) {
	/call Cast "Rod of Mystical Transvergance" item
	/varset rodwait 1
	/timed 3000 /varset rodwait 0
}
/if ((${autosit}==1)&&(${Me.PctMana}<=98)&&(!${Me.Casting.ID})) {
	/if ((${Bool[${Me.Standing}]})&&(${NearestSpawn[NPC].Distance}>=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${distancetosit}]})&&(${Me.PctHPs}>90)) {
		/sit
	}
	/if ((${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})&&(${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]})) /stand
}
/if ((${Bool[${Me.Standing}]})&&(${autosit}==2)&&(${Me.PctMana}<=98)&&(${Me.PctHPs}>90)&&(!${Me.Casting.ID})) /sit
/if ((${Bool[${Me.Sitting}]})&&(${autosit}>=1)&&(${Me.PctMana}>98)&&(!${Window[SpellBookWnd].Open})) /stand
/if ((${Bool[${Me.Standing}]})&&(!${Me.Mount.ID})&&(${Me.SpellReady[${yaulpspell}]})&&(!${Me.Buff[${yaulpspell}].ID})) {
	/if ((!${Me.Buff[Vallon].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Strength of Tunare].ID})) /call Cast "${yaulpspell}"
}
/if (${buffbeg}==1) /call Buffbeg
/if (${Me.PctHPs}<=${selfhealpoint}) /return
/if (${Me.PctMana}<=8) /goto :oomwait
/return


Sub CheckHP
/if (!${Window[CastingWindow].Open}) /return

/call CheckPPS

/if (${Target.ID}==${tanknameid} && ((${Me.AltAbilityReady[Divine Arbitration]} && ${Target.PctHPs} > 50) || ${Target.PctHPs} > 60) && ${tanktimetolive} > 22 && ${castEndTime} < 40 && ${NearestSpawn[npc].Distance} < 150) {
/if (${announce}==1) /gsay Ducking, ${Target} has a good ${tanktimetolive} or so seconds to live...I hope
/echo Ducking, tank at ${Target.PctHPs} taking ${tankpps} with ${tanktimetolive} est time to live
/call Interrupt
/delay 5
/return
}

/if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) {
	/if ((${announce}==1)&&(${duckspam}==1)) {
		/gsay Ducking heal on %T
		/echo Ducking heal on ${Target.Name}
		/varset duckspam 0
		/timed 60 /varset duckspam 1
	}
	/call Interrupt
	/delay 5
	/return
}
/if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) {
	/if ((${announce}==1)&&(${duckselfspam}==1)) {
		/gsay Ducking heal on %T so I can save my own ass
		/echo Ducking heal on ${Target} so I can heal myself
		/varset duckselfspam 0
		/timed 60 /varset duckselfspam 1
	}
	/call Interrupt
	/delay 2
	/return
}
/if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${castEndTime}>25)) {
	/call Interrupt
	/if (${Me.AltAbilityReady[Divine Arbitration]}) {
		/if (${announce}==1) /gsay Divine Arbitration saves the day!
		/call Cast "Divine Arbitration" alt 1s
		/delay 3
		/if (${Me.AltAbilityReady[${celestialregen}]}) {
			/if (${announce}==1) /gsay CR inc
			/call Cast "${celestialregen}" alt 1s
			/delay 25
		} else /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
			/if (${announce}==1) /gsay Inc Grp Heal, get close
			/call Cast "${groupheal}" gem4 1s
			/delay 15 ${Me.SpellReady[${groupheal}]}
		}
	} else {
		/if (${announce}==1) /gsay Ducked CH, ${patchheal} on %T
		/call Cast "${patchheal}" spell 2s
		/return
	}
}
/if (${onlyhealfd}==1) {
	/if ((${Target.Class.Name.Equal[Necromancer]})||(${Target.Class.Name.Equal[Monk]})) {
	/if (${Target.State.NotEqual[feign]}) {
		/if ((${announce}==1)&&(${duckfdspam}==1)) {
			/gsay Ducking heal on %T because he isn't staying FD
			/echo Ducking heal on ${Target.Name} because he isn't staying FD
			/varset duckfdspam 0
			/timed 40 /varset duckfdspam 1
		}
		/call Interrupt
		/return
	}
}
}
/return

Sub TrickyDA
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Virtue].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Virtue].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Conviction].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Conviction].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Hand of Virtue].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Hand of Virtue].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Hand of Conviction].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Hand of Conviction].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Focus of Soul].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Focus of Soul].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Wunshi's Focusing].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Wunshi's Focusing].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Focus of the Seventh].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Focus of the Seventh].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Talisman of Wunshi].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Talisman of Wunshi].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Protection of the Nine].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Protection of the Nine].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Steeloak Skin].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Steeloak Skin].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Blessing of the Nine].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Blessing of the Nine].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Blessing of Steeloak].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Blessing of Steeloak].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Symbol of Kazad].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Symbol of Kazad].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Symbol of Balikor].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Symbol of Balikor].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Kazad`s Mark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Kazad`s Mark].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Balikor`s Mark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Balikor`s Mark].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Brell's Stalwart Shield].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Brell's Stalwart Shield].ID}-1].Int} leftmouseup
/if ((${Me.PctHPs}<40)&&(${Me.Buff[Brell's Brawny Bulwark].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Brell's Brawny Bulwark].ID}-1].Int} leftmouseup
/if (${Me.Buff[${daspell}].ID}) {
	:waitalittle
	/delay 1s ${Me.Buff[${daspell}].Duration}<2
	/if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle
}
/varset buffbeg 1
/return

Sub Buffbeg
/if (${buffbeg}==0) /return
/echo Begging for buffs now
/if ((!${Me.Buff[Protection of the Nine].ID})&&(!${Me.Buff[Blessing of the Nine].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})) {
	/if (${String[${NearestSpawn[PC guild druid]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild druid].Distance}<=100) {
		/tell ${NearestSpawn[PC guild druid]} need 9 plz
		/delay 20
		/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
	} else /echo No guild Druid available for 9
}
/if ((!${Me.Buff[${daspell}].ID})&&(${Me.PctHPs}<=75)) /call Healself
/if ((!${Me.Buff[Focus of the Seventh].ID})&&(!${Me.Buff[Focus of Soul].ID})) {
	/if (${String[${NearestSpawn[PC guild shaman]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild shaman].Distance}<=100) {
		/tell ${NearestSpawn[PC guild shaman]} need focus plz
		/delay 20
		/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
	} else /echo No guild Shaman available for Focus
}
/if ((!${Me.Buff[${daspell}].ID})&&(${Me.PctHPs}<=75)) /call Healself
/if ((!${Me.Buff[Brell's Stalwart Shield].ID})&&(!${Me.Buff[Spiritual Vigor].ID})) {
	/if (${String[${NearestSpawn[PC guild paladin]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild paladin].Distance}<=100) {
		/tell ${NearestSpawn[PC guild paladin]} need BSS plz
		/delay 20
		/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
	} else /echo No guild Paladin available for BSS
}
/if ((!${Me.Buff[${daspell}].ID})&&(${Me.PctHPs}<=75)) /call Healself
/if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})) {
	/if (${String[${NearestSpawn[PC guild enchanter]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) {
		/tell ${NearestSpawn[PC guild enchanter]} need c5 plz
		/delay 20
		/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
	} else /echo No guild Enchanter available for C5
}
/if ((!${Me.Buff[${daspell}].ID})&&(${Me.PctHPs}<=75)) /call Healself
/if (!${Me.Buff[Spiritual Dominion].ID}) {
	/if (${String[${NearestSpawn[PC guild beastlord]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) {
		/tell ${NearestSpawn[PC guild beastlord]} need SD plz
		/if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
	} else /echo No guild Beastlord available for SD
}
/varset buffbeg 0
/return


Sub FindExactPC(string name)
/declare nameid int local
/declare counter int local 1
:FindNext
/if (!${NearestSpawn[${counter}, pc ${name}].ID}) /return NOT_FOUND
/varset nameid ${NearestSpawn[${counter}, pc ${name}].ID}
/if (${Spawn[${nameid}].CleanName.Equal[${name}]}) {
	/target id ${nameid}
	/delay 1s ${Target.ID}==${nameid}
	/if (${Target.ID}==${nameid}) /return TARGET_SUCCESS
}
/varcalc counter ${counter}+1
/if (${NearestSpawn[${counter}, pc ${name}].ID}) /goto :FindNext
/return NOT_FOUND


Sub Event_Chat(string ChatType,string Sender,string ChatText)
/if ((!${ChatType.Equal[GROUP]})&&(!${ChatType.Equal[TELL]})) /return
/if (!${Spawn[${Sender}].ID}) {
	/echo ${Sender} is not in the zone
	/return
}
/if (${ChatText.Equal[Follow me]}) {
	/delay 5
	/if (!${Spawn[${Sender}].ID}) {
		/echo ${Sender} is not in zone for me to follow!
		/return
	}
	/varset follname ${Sender}
	/varset following 1
	:targetfoll
	/target pc ${follname}
	/delay 1s ${Target.Name.Equal[${follname}]}
	/if (${Target.Name.Equal[${follname}]}) {
		/goto :Loop
	} else /goto :targetfoll
	:Loop
	/face fast
	/if (${Target.Distance}>10) /keypress forward hold
	/if (${Target.Distance}<9) /keypress back
	/if (!${Target.ID}) /varset following 0
	/call CheckEvents
	/if ((${Target.Name.Equal[${follname}]})&&(${following}>0)) {
		/goto :Loop
	} else {
		/keypress forward
		/keypress back
	}
}
/if (${ChatText.Equal[End follow]}) {
	/varset following 0
	/keypress forward
	/keypress back
	/timed 50 /face pc ${follname}
}
/if (${ChatText.Equal[buff us up!]}) {
	/gsay Incoming buffs!
	/varset pallycount 0
	/target myself
	/call Cast "${acbuff}" gem6 7s
	/if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
	/if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
	/for gmember 1 to ${Group}
	/target id ${Group[${gmember}].ID}
	/delay 1s ${Target.ID}==${Group[${gmember}].ID}
	/if (${Target.ID}==${Group[${gmember}].ID}) {
		/if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s
		/if (${Target.Class.Name.Equal[Paladin]}) {
			/call Cast "${longhpbuff}" gem5 10s
			/varcalc pallycount ${pallycount}+1
		}
		/if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) {
			/if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
			/if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
		}
	}
	/next gmember
	/if (${Math.Calc[${Group}-${pallycount}]}>=2) /call Cast "${groupsymbuff}" gem5 10s
	/if (${Math.Calc[${Group}-${pallycount}]}<2) {
		/for gmember 0 to ${Group}
		/target id ${Group[${gmember}].ID}
		/delay 1s ${Target.ID}==${Group[${gmember}].ID}
		/if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${singlesymbuff}" gem5 7s
		/next gmember
	}
}
/if (${ChatText.Equal[BoR now!]}) {
	/target myself
	/delay 5 ${Target.Name.Equal[${Me}]}
	/if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
	/if (!${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "${spellhastebuff}" gem8 5s
	/for gmember 1 to ${Group}
	/target id ${Group[${gmember}].ID}
	/delay 1s ${Target.ID}==${Group[${gmember}].ID}
	/if (${Target.ID}==${Group[${gmember}].ID}) {
		/if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) {
			| /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
			/call Cast "${spellhastebuff}" gem8 5s
		}
	}
	/next gmember
}
/if (${ChatText.Equal[nuke]}) {
	/if (${Me.PctMana}<30) {
		/chat #${mychannel} Cleric Mana ${Me.PctMana}%, holding on nukes!
	} else {
		/assist ${Sender}
		/delay 15 ${Target.Type.Equal[NPC]}
		/if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) {
			/if (${Me.SpellReady[${nukeone}]}) {
				/if (${announce}==1) /gsay Casting ${nukeone} on %T
				/call Cast "${nukeone}" spell 3s
			} else /if (${Me.SpellReady[${nuketwo}]}) {
				/if (${announce}==1) /gsay Casting ${nuketwo} on %T
				/call Cast "${nuketwo}" spell 3s
			} else /chat #${mychannel} nukes not ready
			/if (${Me.PctMana}<=60) /chat #${mychannel} FYI Cleric Mana ${Me.PctMana}%
		} else /chat #${mychannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP)
	}
}
/if (${ChatText.Equal[stun]}) {
	/assist ${Sender}
	/delay 15 ${Target.Type.Equal[NPC]}
	/if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) {
		/if (${Me.SpellReady[${stunone}]}) {
			/if (${announce}==1) /gsay Casting ${stunone} on %T
			/call Cast "${stunone}" spell 3s
		} else /if (${Me.SpellReady[${stuntwo}]}) {
			/if (${announce}==1) /gsay Casting ${stuntwo} on %T
			/call Cast "${stuntwo}" spell 3s
		} else /chat #${mychannel} stuns not ready
	} else /chat #${mychannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP)
}
/if (${ChatText.Equal[tankstatus]}) {
	/gsay ${tankname} appears to be taking ${tankpps}% damage per-second, and will likely die in ${tanktimetolive} seconds if not healed.  Have a nice day.
}
/if (${ChatText.Equal[buffme]}) {
	/call FindExactPC ${Sender}
	/if (${String[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return
	/if (${Target.Class.Name.Equal[Paladin]}) {
		/call Cast "${longhpbuff}" gem5 10s
		| /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
		/call Cast "${spellhastebuff}" gem8 5s
		/return
	}
	/if ((${Target.Class.Name.NotEqual[Warrior]})&&(${Target.Class.Name.NotEqual[Monk]})&&(${Target.Class.Name.NotEqual[Rogue]})&&(${Target.Class.Name.NotEqual[Berserker]})&&(${Target.Class.Name.NotEqual[Bard]})) {
		|/if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
		/call Cast "${spellhastebuff}" gem8 5s
	}
	/call Cast "${acbuff}" gem6 7s
	/call Cast "${singlesymbuff}" gem5 7s
}
/if ((${ChatText.Equal[patch me]})||(${ChatText.Equal[heal]})||(${ChatText.Equal[heal me]})||(${ChatText.Equal[heal plz]})||(${ChatText.Equal[heal me plz]})||(${ChatText.Equal[need heal]})) {
/call FindExactPC ${Sender}
/if (${String[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return
/if (${Target.Distance}<=${patchhealrange}) {
	/if (${announce}==1) /gsay Casting ${patchheal} on %T
	/call Cast "${patchheal}" gem2 2s
	/delay 15 ${Me.SpellReady[${patchheal}]}
} else /tell ${Sender} you're OOR
}
/if (${ChatText.Equal[sym]}||${ChatText.Equal[wog]}||${ChatText.Equal[V]}||${ChatText.Equal[virtue]}||${ChatText.Equal[conviction]}||${ChatText.Equal[bor]}||${ChatText.Equal[bod]}||${ChatText.Equal[spell haste]}||${ChatText.Equal[rgc]}||${ChatText.Equal[hot me]}||${ChatText.Equal[ch me]}||${ChatText.Equal[pb]}) {
/if (${Spawn[pc ${Sender}].Distance}>250) /return
/call FindExactPC ${Sender}
/if (${String[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return
}
/if (${ChatText.Equal[sym]}) /call Cast "${singlesymbuff}" gem5 7s
/if (${ChatText.Equal[wog]}) /call Cast "${acbuff}" gem6 7s
/if (${ChatText.Equal[V]}||${ChatText.Equal[virtue]}||${ChatText.Equal[conviction]}) /call Cast "${longhpbuff}" gem5 10s
/if (${ChatText.Equal[bor]}||${ChatText.Equal[bod]}||${ChatText.Equal[spell haste]}) {
| /if (${FindItem[Breastplate of Vengeful Fury].ID}) /call Cast "Breastplate of Vengeful Fury" item
/call Cast "${spellhastebuff}" gem8 5s
}
/if (${ChatText.Equal[rgc]}) {
	/if (${FindItem[Blackflame Sphere].ID}) {
		/call Cast "Blackflame Sphere" item
	} else /if (${FindItem[Wand of Casual Blessings].ID}) {
		/call Cast "Wand of Casual Blessings" item
	} else /call Cast "${rgcspell}" gem8 5s
}
/if (${ChatText.Equal[pb]}) /call Cast "Pure Blood" gem6 10s
/if (${ChatText.Equal[hot me]}) {
	/if (${Target.Distance}<=${hotspellrange}) {
		/if (${announce}==1) /gsay Casting ${hotspell} on %T
		/call Cast "${hotspell}" gem2 2s
		/delay 15 ${Me.SpellReady[${hotspell}]}
	} else /tell ${Sender} you're OOR
}
/if (${ChatText.Equal[ch me]}) {
	/if (${Target.Distance}<=100) {
		/if (${announce}==1) /gsay Casting Complete Healing on %T
		/call Cast "Complete Healing" gem2 5s
		/delay 15 ${Me.SpellReady[${hotspell}]}
	} else /tell ${Sender} you're OOR
}
/if (${ChatText.Equal[mana?]}) /gsay ${Me.PctMana}% mana
/if (${ChatText.Equal[camp]}) {
	/campnow
	/end
}
/return

Sub Event_WinFight
  /if (${announcemana}) /gsay ${Me.PctMana}% mana
/return

Sub CheckPPS
/if (${Target.ID}==${tanknameid} && ${tanklastpct}>${Target.PctHPs} && ${Target.PctHPs}!=100) {
	/varcalc totaltankhits ${totaltankhits} + ${Math.Calc[${tanklastpct}-${Target.PctHPs}]}
	/varset tankpps ${Math.Calc[${totaltankhits}/((10000-${tankppstimer})/10)]}
	| /echo (${Math.Calc[(10000-${tankppstimer})/10].Int}) Total damage: ${totaltankhits} Avg % per second: ${tankpps}
	/if (!${tankpps}) /varset tankpps 1
	/varset tanktimetolive ${Math.Calc[${Target.PctHPs}/${tankpps}].Int}
	| /echo ${Target.PctHPs}..${Target} will die in ${tanktimetolive} seconds if not healed.
	/varset ppsresettimer 100
}
/varset tanklastpct ${Target.PctHPs}
/return
I'd compare this to the "original" afcleric if you plan on doing any work on it, as there's probably a couple values that I changed on-the-fly that aren't what you're used to..just wanted to post an example of what I've been doinking around with. It's a bit more friendly to a "high end"/omens cleric, but perhaps a bit less so to others, check out the declares for sure to make sure your spells are in there.

I didn't touch any of the logic for non-tank healing at all that I can remember...it does some stuff i'm not too crazy about as far as

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Fri Dec 03, 2004 8:23 am

Woot

TY

Gonna give this a try tonight. I've been using this macro for a while now

My main is a 70 cleric in a high end raiding guild. Using this on the tank at most raids has been the best thing my mana bar has ever known. Specially since I can keep an out of group tank targeted and healed while still watching and reacting to the health of group members.

One spell you left out: The OoW group heal Word of Vivification.

Thanks again tho for the tremendous effort!!

eqaussie
a ghoul
a ghoul
Posts: 124
Joined: Tue Mar 16, 2004 5:58 am

Post by eqaussie » Fri Dec 03, 2004 8:43 am

I just added in a RC response to this too, I added the following under the 'ch me' text, around line 960

My cleric has Resplendent Cure and this worked ok, untested on a cleric with Radiant Cure. The other option would be to just declare it at the top, but I love the idea of not having to customise this for every different cleric i might utilise, so spell book checking and aa checking is nice

Code: Select all

/if (${ChatText.Equal[rc]}) {
   /if (${Target.Distance}<=100) { 
       /if (${Me.AltAbilityReady[Resplendent Cure]}) {
            /if (${announce}==1) /gsay Inc Resplendent Cure
            /call cast "Resplendent Cure" Alt
            /delay 15 ${Me.SpellReady[${hotspell}]}
          }
       } else /if (${Me.AltAbilityReady[Radiant Cure]}) {
            /if (${announce}==1) /gsay Inc Radiant Cure
            /call cast "Radiant Cure" Alt
            /delay 15 ${Me.SpellReady[${hotspell}]}           
           } 
       } 
   } else /tell ${Sender} You're OOR
}
Also need to append line 921 with

Code: Select all

||${ChatText.Equal[rc]}
to do the FindExactPC
Last edited by eqaussie on Fri Dec 03, 2004 8:54 am, edited 1 time in total.

Clueless_Coder
a hill giant
a hill giant
Posts: 192
Joined: Wed Aug 25, 2004 3:18 pm

Post by Clueless_Coder » Fri Dec 03, 2004 8:43 am

Also, I was going to post this this morning anyway..

Just about the only issue I've had with this macro in it's original form was a tendancy to crash after attempting to do a Group Heal.

Bearing in mind I'm not a programmer at all...

I've tried to analyze the error I get and it appears that it doesn't know what to do when one of the group members is out of range for a group heal (generally the monk/puller).

So it returns an error and ends the macro.

Would editing

Code: Select all

/declare groupheal string outer Word of Vivification
/declare grouphealrange int outer 70
to a higher value something like

Code: Select all

/declare groupheal string outer Word of Vivification
/declare grouphealrange int outer 200
correct that problem? Without adversely affecting any other functionality?
Last edited by Clueless_Coder on Fri Dec 03, 2004 8:48 am, edited 3 times in total.