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

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

Moderator: MacroQuest Developers

Frank25
a ghoul
a ghoul
Posts: 136
Joined: Thu Aug 12, 2004 6:38 am

Post by Frank25 » Tue May 17, 2005 7:51 pm

Shamna wrote:Anyone getting errors since the last patch running this macro?...was working flawless,but now i get error No such "int" member "PctHP's"...
SEARCH...answer is in about 400 million posts..


It's working fine for me, other hten not using Div Arb (

Shamna
decaying skeleton
decaying skeleton
Posts: 7
Joined: Thu Sep 02, 2004 11:50 am

Post by Shamna » Sat May 21, 2005 7:18 pm

i replaced those parts that needed and spam ended now,however client crashes everytime i start macro and it tryes to cast a spell...any idea anyone?

Fixxer
a ghoul
a ghoul
Posts: 146
Joined: Wed Apr 13, 2005 8:15 am

Divine Arbitration

Post by Fixxer » Sun May 22, 2005 7:08 am

Frank25 wrote:
Shamna wrote:Anyone getting errors since the last patch running this macro?...was working flawless,but now i get error No such "int" member "PctHP's"...
SEARCH...answer is in about 400 million posts..


It's working fine for me, other hten not using Div Arb (
I might not have it set up completely right, but mine has never used divine arbitration. Everything else works fine. I was having simular errors as described, and then I deleted the entire MQ2 directory, and started from scratch using a fresh download... No more problems after that.

If you get it working, can you let us know what you changed to make it work? I'll do the same.

Thanks. :)

Frank25
a ghoul
a ghoul
Posts: 136
Joined: Thu Aug 12, 2004 6:38 am

Post by Frank25 » Tue May 31, 2005 1:52 pm

update:

After that last mq2 update suddenly my bot started divarbing again..
no clue why.
But, when he does i get the following error:

DoCommand: Coulnd't parse 'else'
afcleric.mac@513 (Divarbcast): else
afcleric.mac@634 (CheckHP):/call Divarbcast
spell_routines.inc@603 (WaitCast(string mySub)):/if($Bool[${mySub}])/call ${mySub}
spell_routines.inc@286 (Cast(string spellName,string spellType,timer giveUpTimer, string mySub)):/call WaitCast ${mySub}
afcleric.mac@491 (Healgroup):/call Cast "${patchheal}" gem8 1s CheckHP
afcleric.mac@249 (Main):/call Healgroup

The part it talks about most follows:

Code: Select all

Sub Divarbcast
   /varset divarboor 0
   /for gmember 0 to ${Group}
      /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1
   /next gmember
   /if (${Math.Calc[${Group}-${divarboor}]}>=2) {
      /if (${announce}==1) /g Inc Divine Arbitration

   /if (${shieldtimer}!=0) {
		/call cast "Divine Arbitration" alt 2s
	} 
	else 
		{
      		/call cast "Harmony of the Soul" item
	      	/varset shieldtimer 360s
   		}
	   /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
         /if (${announce}==1) /g Inc Grp Heal, get close
         /call Cast "${groupheal}" gem6 2s
         /delay 15 ${Me.SpellReady[${groupheal}]}
      }
   }
/return
There is a shieldtimer declare at the start:

Code: Select all

   /declare shieldtimer timer outer 0s
Any help is appreciated )

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Tue May 31, 2005 2:04 pm

try

Code: Select all

} else {
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

Frank25
a ghoul
a ghoul
Posts: 136
Joined: Thu Aug 12, 2004 6:38 am

Post by Frank25 » Tue May 31, 2005 2:10 pm

fearless wrote:try

Code: Select all

} else {
could i have been this dumb...you know, i believe i could have been.
It looked odd heh.

Changed it, will do some testing tonite and let you know )

JJVD
orc pawn
orc pawn
Posts: 14
Joined: Wed Jan 26, 2005 9:49 pm

group heal code

Post by JJVD » Mon Jun 27, 2005 2:27 am

Any one else having this not heal the group?

nytemyst
a grimling bloodguard
a grimling bloodguard
Posts: 578
Joined: Mon Oct 25, 2004 2:29 pm
Location: florida

Post by nytemyst » Mon Jun 27, 2005 8:57 am

The answer is in this thread. Try reading it sometime.

JJVD
orc pawn
orc pawn
Posts: 14
Joined: Wed Jan 26, 2005 9:49 pm

newb

Post by JJVD » Mon Jun 27, 2005 6:58 pm

Well I had it working after may 22 but then it stopped working sometime in june. I had all the fixes done. Apparently I overwrote my good mac with a older version. Anyway heres a working version.

Code: Select all

#include spell_routines.inc 

#Chat Chat 
#Chat tell 

Sub Main 

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

   /declare mychannel string outer boombash 
   /declare autohealmode int outer 3 
   /declare healspell string outer Complete Healing 
   /declare healspellrange int outer 100 
   /declare patchheal string outer Pious Light 
   /declare patchhealrange int outer 200 
   /declare hotspell string outer Pious Elixir 
   /declare hotspellrange int outer 100 
   /declare daspell string outer Divine Barrier 
   /declare yaulpspell string outer Yaulp VI 
   /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 0 
   /declare announce int outer 1 
   /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 acbuff string outer Ward of Valiance 
   /declare longhpbuff string outer Conviction 
   /declare singlesymbuff string outer Symbol of Balikor 
   /declare groupsymbuff string outer NULL 
   /declare spellhastebuff string outer Blessing of Reverence 
   /declare rgcspell string outer Remove Greater Curse 
   /declare healpetmode int outer 2 
   /declare pethealpoint int outer 65 
   /declare manatohealpet int outer 25 
   /declare pethealspell string outer Complete Healing 
   /declare pethealspellrange int outer 100 
   /declare nukeone string outer Reproach 
   /declare nuketwo string outer Order 
   /declare stunone string outer Sound of Divinity 
   /declare stuntwo string outer Shock of Wonder 

|** 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 70 
   /declare dacastpoint int outer 29 
   /declare divarbpoint int outer 25 
   /declare interrupt2divarb int outer 12 
   /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 

|**---------------------TrickyDA Config---------------------| 
The following are HP buffs cleric will click off, in order, 
to get above 40% HP and avoid low HP aggro. Clr will then 
click off DA and resume duties, beg new buffs, etc. To 
enable, set trickyda to 1, 0 will disable 
|---------------------------------------------------------**| 
   /declare trickyda int outer 1 
   /if (${trickyda}==1) { 
      /declare intcount int outer 0 
      /declare trickybuff[20] string outer 
      /varset trickybuff[1] Virtue 
      /varset trickybuff[2] Hand of Virtue 
      /varset trickybuff[3] Conviction 
      /varset trickybuff[4] Hand of Conviction 
      /varset trickybuff[5] Focus of Soul 
      /varset trickybuff[6] Focus of the Seventh 
      /varset trickybuff[7] Wunshi's Focusing 
      /varset trickybuff[8] Talisman of Wunshi 
      /varset trickybuff[9] Protection of the 9 
      /varset trickybuff[10] Blessing of the Nine 
      /varset trickybuff[11] Steeloak Skin 
      /varset trickybuff[12] Blessing of Steeloak 
      /varset trickybuff[13] Symbol of Kazad 
      /varset trickybuff[14] Kazad`s Mark 
      /varset trickybuff[15] Symbol of Balikor 
      /varset trickybuff[16] Balikor's Mark 
      /varset trickybuff[17] Brell's Stalwart Shield 
      /varset trickybuff[18] Brell's Brawny Bulwark 
      /varset trickybuff[19] Spiritual Vigor 
      /varset trickybuff[20] Spiritual Vitality 
   } 
|-------------------End TrickyDA Config---------------------| 


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

   /declare healpct int outer 60 
   /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 aetime int outer 0 

   /join ${mychannel} 


   /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 60% 
    
   /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) { 
         /e Warning No Designated MT is available 
         /timed 300 /varset nomtspam 1 
         /varset nomtspam 0 
      } 
   } 
   /if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) { 
      /g ${Me.PctMana}m 
      /varset lomspam 0 
      /timed 300 /varset lomspam 1 
   } 
   /if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) { 
      /g oom 
      /varset oomspam 0 
      /timed 300 /varset oomspam 1 
      /call MedTime 
   } 
   /if (${GameState.Equal[CHARSELECT]}) /end 
   /if (${Target.ID}==${tanknameid}) { 
      /varset stophealpoint ${Math.Calc[${healpct}*1.1]} 
      /if ((${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) { 
         /if (${announce}==1) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 1s CheckHP 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } 
      /if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})&&(${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) { 
         /if (${announce}==1) /g Casting ${healspell} 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) /g 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) /g 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) /g 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.Members} 
      /if (${onlyhealfd}==0) { 
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) { 
            /if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) { 
               /varset worsthurt ${Group.Member[${gmember}].Name} 
               /varset worsthurtid ${Group.Member[${gmember}].ID} 
               /varset worsthp ${Group.Member[${gmember}].PctHPs} 
               /varset worstclass ${Group.Member[${gmember}].Class.Name} 
            } 
         } 
      } 
      /if (${onlyhealfd}==1) { 
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) { 
            /if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) { 
               /varset worsthurt ${Group.Member[${gmember}].Name} 
               /varset worsthurtid ${Group.Member[${gmember}].ID} 
               /varset worsthp ${Group.Member[${gmember}].PctHPs} 
               /varset worstclass ${Group.Member[${gmember}].Class.Name} 
            } 
            /if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]})||(${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) { 
               /if ((${Group.Member[${gmember}].State.Equal[feign]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) { 
                  /varset worsthurt ${Group.Member[${gmember}].Name} 
                  /varset worsthurtid ${Group.Member[${gmember}].ID} 
                  /varset worsthp ${Group.Member[${gmember}].PctHPs} 
                  /varset worstclass ${Group.Member[${gmember}].Class.Name} 
               } 
            } 
         } 
      } 
      /if ((${Group.Member[${gmember}].Distance}<=${grouphealrange})&&(${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1 
      /if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1 
      /if ((${Group.Member[${gmember}].PctHPs}<=60)&&(${Group.Member[${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)&&(${worsthp}<=${divarbpoint})&&(${Me.AltAbilityReady[divine arbitration]})) /call Divarbcast 
   /if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3)&&(${usegroupheal}==1)) { 
      /if (${announce}==1) /g 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) /g 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) /g 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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /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) /g Casting ${patchheal} 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) /g 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) /g 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 Divarbcast 
   /varset divarboor 0 
   /for gmember 0 to ${Group.Members} 
      /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1 
   /next gmember 
   /if (${Math.Calc[${Group}-${divarboor}]}>=2) { 
      /if (${announce}==1) /g Inc Divine Arbitration 
      /call Cast "Divine Arbitration" alt 2s 
      /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) { 
         /if (${announce}==1) /g Inc Grp Heal, get close 
         /call Cast "${groupheal}" gem4 2s 
         /delay 15 ${Me.SpellReady[${groupheal}]} 
      } 
   } 
/return 


Sub HealPet 
   /varset worsthurt NULL 
   /varset worsthp 100 
   /for gmember 0 to ${Group.Members} 
      /if (${Group.Member[${gmember}].Pet.ID}) { 
         /if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) { 
            /if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) { 
               /varset worsthurt ${Group.Member[${gmember}].Pet.Name} 
               /varset worsthurtid ${Group.Member[${gmember}].Pet.ID} 
               /varset worsthp ${Group.Member[${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) /g 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 
/return 


Sub MedTime 
   :oomwait 
   /call CheckEvents 
   /If ((${FindItem["Rod of Mystical Transvergance"].InvSlot})&&(${Me.PctMana}<=70)&&(${Me.PctHPs}>=98)&&(${rodwait}==0)) { 
      /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 
   /if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) { 
      /if ((${announce}==1)&&(${duckspam}==1)) { 
         /g Ducking heal on %T 
         /e Ducking heal on ${Target.Name} 
         /varset duckspam 0 
         /timed 60 /varset duckspam 1 
      } 
      /call Interrupt 
      /return 
   } 
   /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) { 
      /if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) { 
         /call Interrupt 
         /call Divarbcast 
         /return 
      } 
      /if ((${announce}==1)&&(${duckselfspam}==1)) { 
         /g Ducking heal on %T so I can heal my (ChickenShit) self 
         /e Ducking heal on ${Target} so I can heal myself 
         /varset duckselfspam 0 
         /timed 60 /varset duckselfspam 1 
      } 
      /call Interrupt 
      /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)) { 
               /g Ducking heal on %T because he isn't staying FD 
               /e Ducking heal on ${Target.Name} because he isn't staying FD 
               /varset duckfdspam 0 
               /timed 40 /varset duckfdspam 1 
            } 
            /call Interrupt 
            /return 
         } 
      } 
   } 
   /if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${Me.AltAbilityReady[Divine Arbitration]})&&(${castEndTime}>=${interrupt2divarb})) { 
      /for gmember 0 to ${Group.Members} 
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) { 
            /call Interrupt 
            /call Divarbcast 
            /return 
         } 
      /next gmember 
   } 
/return 


Sub TrickyDA 
   /for intcount 1 to 20 
      /if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup 
   /next intcount 
   /if (${Me.Buff[${daspell}].ID}) { 
      :waitalittle 
      /delay 1s ${Me.Buff[${daspell}].Duration}<2 
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle 
   } 
   /varset buffbeg 1 
   /call Buffbeg 
/return 


Sub Buffbeg 
   /if (${buffbeg}==0) /return 
   /echo Begging for buffs now 
   /if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) { 
      /if (${String[${NearestSpawn[PC guild enchanter]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) { 
         /tell ${NearestSpawn[PC guild enchanter]} need C plz 
         /delay 20 
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup 
      } else /e No guild Enchanter available for C5 
   } 
   /if ((!${Me.Buff[Protection of the Nine].ID})&&(!${Me.Buff[Blessing of the Nine].ID})&&(!${Me.Buff[Steeloak Skin].ID})&&(!${Me.Buff[Blessing of Steeloak].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) { 
      /if (${String[${NearestSpawn[PC guild druid]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild druid].Distance}<=100) { 
         /tell ${NearestSpawn[PC guild druid]} need dru crack plz 
         /delay 20 
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup 
      } else /e No guild Druid available for DRU crack 
   } 
   /if ((!${Me.Buff[Spiritual Dominion].ID})&&(!${Me.Buff[Spiritual Ascendance].ID})) { 
      /if (${String[${NearestSpawn[PC guild beastlord]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) { 
         /tell ${NearestSpawn[PC guild beastlord]} need bst crack plz 
         /delay 20 
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup 
      } else /e No guild Beastlord available for BST crack 
   } 
   /if ((!${Me.Buff[Kazad`s Mark].ID})&&(!${Me.Buff[Symbol of Kazad].ID})&&(!${Me.Buff[Symbol of Balikor].ID})&&(!${Me.Buff[Balikor's Mark].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) { 
      /if (${String[${NearestSpawn[PC guild cleric]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild cleric].Distance}<=100) { 
         /tell ${NearestSpawn[PC guild cleric]} need sym plz 
         /delay 20 
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup 
      } else /e No guild Cleric available for Symbol 
   } 
   /if ((!${Me.Buff[Brell's Stalwart Shield].ID})&&(!${Me.Buff[Brell's Brawny Bulwark].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Spiritual Vitality].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 /e No guild Paladin available for BSS 
   }      
   /if ((!${Me.Buff[Shield of Maelin].ID})&&(!${Me.Buff[Focus of the Seventh].ID})&&(!${Me.Buff[Focus of Soul].ID})&&(!${Me.Buff[Wunshi's Focusing].ID})&&(!${Me.Buff[Talisman of Wunshi].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 /e No guild Shaman available for Focus 
   } 
   /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[${mychannel}]})&&(!${ChatType.Equal[TELL]})) /return 
   /if (!${Spawn[${Sender}].ID}) { 
      /e ${Sender} is not in the zone 
      /return 
   } 
   /if (${ChatText.Equal[Follow me]}) { 
      /delay 5 
      /if (!${Spawn[${Sender}].ID}) { 
         /e ${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[Gbuff now!]}) { 
      /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.Member[${gmember}].ID} 
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) { 
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s 
            /if (${Target.Class.Name.Equal[Paladin]}) { 
               /call Cast "${longhpbuff}" gem4 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)&&(${String[${groupsymbuff}].NotEqual[NULL]})) /call Cast "${groupsymbuff}" gem5 10s 
      /if ((${Math.Calc[${Group}-${pallycount}]}<2)||(${String[${groupsymbuff}].Equal[NULL]})) { 
         /for gmember 0 to ${Group.Members} 
            /target id ${Group.Member[${gmember}].ID} 
            /delay 1s ${Target.ID}==${Group.Member[${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.Member[${gmember}].ID} 
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
         /if (${Target.ID}==${Group.Member[${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 
               /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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 5 
         /if (${Target.Type.NotEqual[NPC]}) { 
            /assist ${Sender} 
            /delay 5 ${Target.Type.Equal[NPC]} 
         } 
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
            /if (${Me.SpellReady[${nukeone}]}) { 
               /if (${announce}==1) /g Casting ${nukeone} on %T 
               /call Cast "${nukeone}" spell 3s 
            } else /if (${Me.SpellReady[${nuketwo}]}) { 
               /if (${announce}==1) /g 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 5 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /assist ${Sender} 
         /delay 5 ${Target.Type.Equal[NPC]} 
      } 
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
         /if (${Me.SpellReady[${stunone}]}) { 
            /if (${announce}==1) /g Casting ${stunone} on %T 
            /call Cast "${stunone}" spell 3s 
         } else /if (${Me.SpellReady[${stuntwo}]}) { 
            /if (${announce}==1) /g 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[buffme]}) { 
      /call FindExactPC ${Sender} 
      /if (${String[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Class.Name.Equal[Paladin]}) { 
         /call Cast "${longhpbuff}" gem4 10s 
         /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 
         /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 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 2s 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if ((${ChatText.Equal[sym]})||(${ChatText.Equal[wog]})||(${ChatText.Equal[V]})||(${ChatText.Equal[bor]})||(${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]}) /call Cast "${longhpbuff}" gem4 10s 
   /if (${ChatText.Equal[bor]}) { 
      /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 
   } 
   /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[buff pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 8 
      /target ${Spawn[pc ${Sender}].Pet} 
      /call Cast "${acbuff}" gem6 7s 
      /call Cast "${singlesymbuff}" gem5 7s 
   } 
   /if (${ChatText.Equal[da pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 6 
      /target ${Spawn[pc ${Sender}].Pet} 
      /if (${Me.AltAbilityReady[39]}) /if (${String[${Target.Name}].Equal[${Spawn[pc ${Sender}].Pet.Name}]}) { 
         /call Cast "39" alt 
      } else { 
         /chat #${mychannel} Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target 
      } 
   } 
   /if (${ChatText.Equal[pb]}) /call Cast "Pure Blood" gem6 10s 
   /if (${ChatText.Equal[hot me]}) { 
      /if (${Target.Distance}<=${hotspellrange}) { 
         /if (${announce}==1) /g Casting ${hotspell} on %T 
         /call Cast "${hotspell}" gem2 2s 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[ch me]}) { 
      /if (${Target.Distance}<=100) { 
         /if (${announce}==1) /g Casting Complete Healing on %T 
         /call Cast "Complete Healing" gem2 5s 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[mana check]}) /chat #${mychannel} Cleric Mana ${Me.PctMana}% 
   /if (${ChatText.Equal[slowcamp]}) { 
      /if (${Me.Standing}) /sit 
      /delay 5m ${Me.PctMana}>=98 
      /camp 
      /end 
   } 
/return

Valthonis
a hill giant
a hill giant
Posts: 183
Joined: Tue May 24, 2005 5:48 pm

Post by Valthonis » Sat Jul 02, 2005 5:47 pm

playing around with the no longer functioning string thingie I seem to have this thing working, bear in mind that I am just learning so if you see any problems with it let me know.


Valthonis

Code: Select all

#include spell_routines.inc

#Chat Chat
#Chat tell

Sub Main

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

   /declare mychannel string outer boombash
   /declare autohealmode int outer 3
   /declare interrupt2divarb int outer 12
   /declare healspell string outer Complete Healing
   /declare healspellrange int outer 100
   /declare patchheal string outer Pious Light
   /declare patchhealrange int outer 200
   /declare hotspell string outer Pious Elixir
   /declare hotspellrange int outer 100
   /declare daspell string outer Divine Barrier
   /declare yaulpspell string outer Yaulp VII
   /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 0
   /declare announce int outer 1
   /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 acbuff string outer Ward of Valiance
   /declare longhpbuff string outer Conviction
   /declare singlesymbuff string outer Symbol of Balikor
   /declare groupsymbuff string outer NULL
   /declare spellhastebuff string outer Blessing of Reverence
   /declare rgcspell string outer Remove Greater Curse
   /declare healpetmode int outer 2
   /declare pethealpoint int outer 65
   /declare manatohealpet int outer 25
   /declare pethealspell string outer Complete Healing
   /declare pethealspellrange int outer 100
   /declare nukeone string outer Reproach
   /declare nuketwo string outer Order
   /declare stunone string outer Sound of Divinity
   /declare stuntwo string outer Shock of Wonder

|** 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 70
   /declare dacastpoint int outer 29
   /declare divarbpoint int outer 25
   /declare interrupt2divarb int outer 12
   /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

|**---------------------TrickyDA Config---------------------|
The following are HP buffs cleric will click off, in order,
to get above 40% HP and avoid low HP aggro. Clr will then
click off DA and resume duties, beg new buffs, etc. To
enable, set trickyda to 1, 0 will disable
|---------------------------------------------------------**|
   /declare trickyda int outer 1
   /if (${trickyda}==1) {
      /declare intcount int outer 0
      /declare trickybuff[20] string outer
      /varset trickybuff[1] Virtue
      /varset trickybuff[2] Hand of Virtue
      /varset trickybuff[3] Conviction
      /varset trickybuff[4] Hand of Conviction
      /varset trickybuff[5] Focus of Soul
      /varset trickybuff[6] Focus of the Seventh
      /varset trickybuff[7] Wunshi's Focusing
      /varset trickybuff[8] Talisman of Wunshi
      /varset trickybuff[9] Protection of the 9
      /varset trickybuff[10] Blessing of the Nine
      /varset trickybuff[11] Steeloak Skin
      /varset trickybuff[12] Blessing of Steeloak
      /varset trickybuff[13] Symbol of Kazad
      /varset trickybuff[14] Kazad`s Mark
      /varset trickybuff[15] Symbol of Balikor
      /varset trickybuff[16] Balikor's Mark
      /varset trickybuff[17] Brell's Stalwart Shield
      /varset trickybuff[18] Brell's Brawny Bulwark
      /varset trickybuff[19] Spiritual Vigor
      /varset trickybuff[20] Spiritual Vitality
   }
|-------------------End TrickyDA Config---------------------|


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

   /declare healpct int outer 60
   /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 aetime int outer 0

   /join ${mychannel}


   /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 60%
   
   /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 (${var[${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) {
         /e Warning No Designated MT is available
         /timed 300 /varset nomtspam 1
         /varset nomtspam 0
      }
   }
   /if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) {
      /g ${Me.PctMana}m
      /varset lomspam 0
      /timed 300 /varset lomspam 1
   }
   /if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) {
      /g oom
      /varset oomspam 0
      /timed 300 /varset oomspam 1
      /call MedTime
   }
   /if (${GameState.Equal[CHARSELECT]}) /end
   /if (${Target.ID}==${tanknameid}) {
      /varset stophealpoint ${Math.Calc[${healpct}*1.1]}
      /if ((${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) {
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patchheal}]}
      }
      /if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})&&(${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) {
         /if (${announce}==1) /g Casting ${healspell} 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) /g 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) /g 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) /g 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.Member[${gmember}].Distance}<=${patchhealrange}) {
            /if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) {
               /varset worsthurt ${Group.Member[${gmember}].Name}
               /varset worsthurtid ${Group.Member[${gmember}].ID}
               /varset worsthp ${Group.Member[${gmember}].PctHPs}
               /varset worstclass ${Group.Member[${gmember}].Class.Name}
            }
         }
      }
      /if (${onlyhealfd}==1) {
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) {
            /if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
               /varset worsthurt ${Group.Member[${gmember}].Name}
               /varset worsthurtid ${Group.Member[${gmember}].ID}
               /varset worsthp ${Group.Member[${gmember}].PctHPs}
               /varset worstclass ${Group.Member[${gmember}].Class.Name}
            }
            /if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]})||(${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) {
               /if ((${Group.Member[${gmember}].State.Equal[feign]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) {
                  /varset worsthurt ${Group.Member[${gmember}].Name}
                  /varset worsthurtid ${Group.Member[${gmember}].ID}
                  /varset worsthp ${Group.Member[${gmember}].PctHPs}
                  /varset worstclass ${Group.Member[${gmember}].Class.Name}
               }
            }
         }
      }
      /if ((${Group.Member[${gmember}].Distance}<=${grouphealrange})&&(${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1
      /if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1
      /if ((${Group.Member[${gmember}].PctHPs}<=60)&&(${Group.Member[${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)&&(${worsthp}<=${divarbpoint})&&(${Me.AltAbilityReady[divine arbitration]})) /call Divarbcast
   /if ((${Math.Calc[${majorhurt}+${minorhurt}]}>=3)&&(${usegroupheal}==1)) {
      /if (${announce}==1) /g 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 ((${var[${worstclass}].Equal[Warrior]})||(${var[${worstclass}].Equal[Paladin]})||(${var[${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) /g 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) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /delay 15 ${Me.SpellReady[${patchheal}]}
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /return
      }
   } else /if ((${var[${worstclass}].Equal[Magician]})||(${var[${worstclass}].Equal[Wizard]})||(${var[${worstclass}].Equal[Enchanter]})||(${var[${worstclass}].Equal[Druid]})) {
      /if ((${worsthp}<=${casterhotpoint})&&(${worsthp}>${casterpatchpoint})) {
         /if ((${var[${worsthurt}].Equal[${nohotforua}]})||(${var[${worsthurt}].Equal[${nohotforub}]})||(${var[${worsthurt}].Equal[${nohotforuc}]})||(${var[${worsthurt}].Equal[${nohotforud}]})) /return
         /if (${var[${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) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforua NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${var[${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) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforub NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${var[${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) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /varset nohotforuc NULL
            /delay 15 ${Me.SpellReady[${hotspell}]}
         } else /if (${var[${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) /g Casting ${hotspell} on %T
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]}
            /call Cast "${hotspell}" gem3 1s CheckHP
            /timed 200 /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) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 1s CheckHP
         /varset stophealpoint ${defaultstophealpoint}
         /call CheckEvents
         /delay 15 ${Me.SpellReady[${patchheal}]}
         /return
      }
      /varset stophealpoint ${defaultstophealpoint}
   } else /if ((${var[${worstclass}].Equal[Necromancer]})||(${var[${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) /g 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) /g 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 Divarbcast
   /varset divarboor 0
   /for gmember 0 to ${Group}
      /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1
   /next gmember
   /if (${Math.Calc[${Group}-${divarboor}]}>=2) {
      /if (${announce}==1) /g Inc Divine Arbitration
      /call Cast "Divine Arbitration" alt 2s
      /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) {
         /if (${announce}==1) /g Inc Grp Heal, get close
         /call Cast "${groupheal}" gem4 2s
         /delay 15 ${Me.SpellReady[${groupheal}]}
      }
   }
/return


Sub HealPet
   /varset worsthurt NULL
   /varset worsthp 100
   /for gmember 0 to ${Group}
      /if (${Group.Member[${gmember}].Pet.ID}) {
         /if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) {
            /if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) {
               /varset worsthurt ${Group.Member[${gmember}].Pet.Name}
               /varset worsthurtid ${Group.Member[${gmember}].Pet.ID}
               /varset worsthp ${Group.Member[${gmember}].Pet.PctHPs}
            }
         }
      }
   /next gmember
   /if (${var[${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) /g 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
/return


Sub MedTime
   :oomwait
   /call CheckEvents
   /If ((${FindItem["Rod of Mystical Transvergance"].InvSlot})&&(${Me.PctMana}<=70)&&(${Me.PctHPs}>=98)&&(${rodwait}==0)) {
      /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
   /if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) {
      /if ((${announce}==1)&&(${duckspam}==1)) {
         /g Ducking heal on %T
         /e Ducking heal on ${Target.Name}
         /varset duckspam 0
         /timed 60 /varset duckspam 1
      }
      /call Interrupt
      /return
   }
   /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) {
      /if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) {
         /call Interrupt
         /call Divarbcast
         /return
      }
      /if ((${announce}==1)&&(${duckselfspam}==1)) {
         /g Ducking heal on %T so I can heal my (ChickenShit) self
         /e Ducking heal on ${Target} so I can heal myself
         /varset duckselfspam 0
         /timed 60 /varset duckselfspam 1
      }
      /call Interrupt
      /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)) {
               /g Ducking heal on %T because he isn't staying FD
               /e Ducking heal on ${Target.Name} because he isn't staying FD
               /varset duckfdspam 0
               /timed 40 /varset duckfdspam 1
            }
            /call Interrupt
            /return
         }
      }
   }
   /if ((${usedivarb}==1)&&(${Target.PctHPs}<=${divarbpoint})&&(${Target.Distance}<=200)&&(${Me.AltAbilityReady[Divine Arbitration]})&&(${castEndTime}>=${interrupt2divarb})) {
      /for gmember 0 to ${Group}
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
            /call Interrupt
            /call Divarbcast
            /return
         }
      /next gmember
   }
/return


Sub TrickyDA
   /for intcount 1 to 20
      /if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup
   /next intcount
   /if (${Me.Buff[${daspell}].ID}) {
      :waitalittle
      /delay 1s ${Me.Buff[${daspell}].Duration}<2
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle
   }
   /varset buffbeg 1
   /call Buffbeg
/return


Sub Buffbeg
   /if (${buffbeg}==0) /return
   /echo Begging for buffs now
   /if ((!${Me.Buff[Voice of Quellious].ID})&&(!${Me.Buff[Tranquility].ID})&&(!${Me.Buff[Koadic's Endless Intellect].ID})&&(!${Me.Buff[Clairvoyance].ID})&&(!${Me.Buff[Voice of Clairvoyance].ID})) {
      /if (${var[${NearestSpawn[PC guild enchanter]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) {
         /tell ${NearestSpawn[PC guild enchanter]} need C plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Enchanter available for C5
   }
   /if ((!${Me.Buff[Protection of the Nine].ID})&&(!${Me.Buff[Blessing of the Nine].ID})&&(!${Me.Buff[Steeloak Skin].ID})&&(!${Me.Buff[Blessing of Steeloak].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
      /if (${var[${NearestSpawn[PC guild druid]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild druid].Distance}<=100) {
         /tell ${NearestSpawn[PC guild druid]} need dru crack plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Druid available for DRU crack
   }
   /if ((!${Me.Buff[Spiritual Dominion].ID})&&(!${Me.Buff[Spiritual Ascendance].ID})) {
      /if (${var[${NearestSpawn[PC guild beastlord]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) {
         /tell ${NearestSpawn[PC guild beastlord]} need bst crack plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Beastlord available for BST crack
   }
   /if ((!${Me.Buff[Kazad`s Mark].ID})&&(!${Me.Buff[Symbol of Kazad].ID})&&(!${Me.Buff[Symbol of Balikor].ID})&&(!${Me.Buff[Balikor's Mark].ID})&&(!${Me.Buff[Virtue].ID})&&(!${Me.Buff[Hand of Virtue].ID})&&(!${Me.Buff[Conviction].ID})&&(!${Me.Buff[Hand of Conviction].ID})) {
      /if (${var[${NearestSpawn[PC guild cleric]}].NotEqual[NULL]}) /if (${NearestSpawn[PC guild cleric].Distance}<=100) {
         /tell ${NearestSpawn[PC guild cleric]} need sym plz
         /delay 20
         /if (${Me.Buff[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${daspell}].ID}-1].Int} leftmouseup
      } else /e No guild Cleric available for Symbol
   }
   /if ((!${Me.Buff[Brell's Stalwart Shield].ID})&&(!${Me.Buff[Brell's Brawny Bulwark].ID})&&(!${Me.Buff[Spiritual Vigor].ID})&&(!${Me.Buff[Spiritual Vitality].ID})) {
      /if (${var[${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 /e No guild Paladin available for BSS
   }     
   /if ((!${Me.Buff[Shield of Maelin].ID})&&(!${Me.Buff[Focus of the Seventh].ID})&&(!${Me.Buff[Focus of Soul].ID})&&(!${Me.Buff[Wunshi's Focusing].ID})&&(!${Me.Buff[Talisman of Wunshi].ID})) {
      /if (${var[${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 /e No guild Shaman available for Focus
   }
   /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[${mychannel}]})&&(!${ChatType.Equal[TELL]})) /return
   /if (!${Spawn[${Sender}].ID}) {
      /e ${Sender} is not in the zone
      /return
   }
   /if (${ChatText.Equal[Follow me]}) {
      /delay 5
      /if (!${Spawn[${Sender}].ID}) {
         /e ${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[Gbuff now!]}) {
      /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.Member[${gmember}].ID}
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID}
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) {
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s
            /if (${Target.Class.Name.Equal[Paladin]}) {
               /call Cast "${longhpbuff}" gem4 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)&&(${var[${groupsymbuff}].NotEqual[NULL]})) /call Cast "${groupsymbuff}" gem5 10s
      /if ((${Math.Calc[${Group}-${pallycount}]}<2)||(${var[${groupsymbuff}].Equal[NULL]})) {
         /for gmember 0 to ${Group}
            /target id ${Group.Member[${gmember}].ID}
            /delay 1s ${Target.ID}==${Group.Member[${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.Member[${gmember}].ID}
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID}
         /if (${Target.ID}==${Group.Member[${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
               /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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 5
         /if (${Target.Type.NotEqual[NPC]}) {
            /assist ${Sender}
            /delay 5 ${Target.Type.Equal[NPC]}
         }
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) {
            /if (${Me.SpellReady[${nukeone}]}) {
               /if (${announce}==1) /g Casting ${nukeone} on %T
               /call Cast "${nukeone}" spell 3s
            } else /if (${Me.SpellReady[${nuketwo}]}) {
               /if (${announce}==1) /g 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 5
      /if (${Target.Type.NotEqual[NPC]}) {
         /assist ${Sender}
         /delay 5 ${Target.Type.Equal[NPC]}
      }
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) {
         /if (${Me.SpellReady[${stunone}]}) {
            /if (${announce}==1) /g Casting ${stunone} on %T
            /call Cast "${stunone}" spell 3s
         } else /if (${Me.SpellReady[${stuntwo}]}) {
            /if (${announce}==1) /g 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[buffme]}) {
      /call FindExactPC ${Sender}
      /if (${var[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return
      /if (${Target.Class.Name.Equal[Paladin]}) {
         /call Cast "${longhpbuff}" gem4 10s
         /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
         /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
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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 (${var[${Macro.Return}].NotEqual[TARGET_SUCCESS]}) /return
      /if (${Target.Distance}<=${patchhealrange}) {
         /if (${announce}==1) /g Casting ${patchheal} on %T
         /call Cast "${patchheal}" gem2 2s
         /delay 15 ${Me.SpellReady[${patchheal}]}
      } else /tell ${Sender} your OOR
   }
   /if ((${ChatText.Equal[sym]})||(${ChatText.Equal[wog]})||(${ChatText.Equal[V]})||(${ChatText.Equal[bor]})||(${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 (${var[${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]}) /call Cast "${longhpbuff}" gem4 10s
   /if (${ChatText.Equal[bor]}) {
      /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
   }
   /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[buff pet]}) {
      /target ${Spawn[pc ${Sender}].Pet}
      /delay 8
      /target ${Spawn[pc ${Sender}].Pet}
      /call Cast "${acbuff}" gem6 7s
      /call Cast "${singlesymbuff}" gem5 7s
   }
   /if (${ChatText.Equal[da pet]}) {
      /target ${Spawn[pc ${Sender}].Pet}
      /delay 6
      /target ${Spawn[pc ${Sender}].Pet}
      /if (${Me.AltAbilityReady[39]}) /if (${var[${Target.Name}].Equal[${Spawn[pc ${Sender}].Pet.Name}]}) {
         /call Cast "39" alt
      } else {
         /chat #${mychannel} Bestow Divine Aura is not ready, or Target (%T) OOR or wrong target
      }
   }
   /if (${ChatText.Equal[pb]}) /call Cast "Pure Blood" gem6 10s
   /if (${ChatText.Equal[hot me]}) {
      /if (${Target.Distance}<=${hotspellrange}) {
         /if (${announce}==1) /g Casting ${hotspell} on %T
         /call Cast "${hotspell}" gem2 2s
         /delay 15 ${Me.SpellReady[${hotspell}]}
      } else /tell ${Sender} your OOR
   }
   /if (${ChatText.Equal[ch me]}) {
      /if (${Target.Distance}<=100) {
         /if (${announce}==1) /g Casting Complete Healing on %T
         /call Cast "Complete Healing" gem2 5s
         /delay 15 ${Me.SpellReady[${hotspell}]}
      } else /tell ${Sender} your OOR
   }
   /if (${ChatText.Equal[mana check]}) /chat #${mychannel} Cleric Mana ${Me.PctMana}%
   /if (${ChatText.Equal[slowcamp]}) {
      /if (${Me.Standing}) /sit
      /delay 5m ${Me.PctMana}>=98
      /camp
      /end
   }
/return

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Sun Jul 03, 2005 12:54 am

Valthonis, your entire HoT sub won't work, /if (!{$Target.ID}) does not replace a test for a particular ${nohotforu} variable.

AfCleric always has a Target.ID, even if its the MT's corpse after he's dead.

Valthonis
a hill giant
a hill giant
Posts: 183
Joined: Tue May 24, 2005 5:48 pm

Post by Valthonis » Sun Jul 03, 2005 1:45 am

Doiy, figured I would mess something up lol, could you point out the exact code and what it should look like, I am trying to learn


Valthonis

DigitalMocking
a grimling bloodguard
a grimling bloodguard
Posts: 620
Joined: Mon Apr 04, 2005 5:53 pm

Post by DigitalMocking » Sun Jul 03, 2005 2:35 am

I'm finishing it up now, making some logic fixes for the sit/stand dance the macro does and a couple of other things.

Once I test it I'll post the whole thing.

User avatar
vladk
a ghoul
a ghoul
Posts: 122
Joined: Wed Oct 15, 2003 1:01 am

Post by vladk » Sun Jul 03, 2005 3:47 pm

Here's whatever version of afcleric that I have, edited for new changes, worked perfectly for me.

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. 
   If the Tank takes dmg fast enough that HP is less than 70% 
   of the specified %health, the patchspell will be cast. 
   The Tank does not need to be in your group. 
    
   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 
----------------------------------------------------------**| 

#turbo 40 
#include spell_routines.inc 

#Chat Chat 
#Chat tell 

#event MobDead "You gain party experience!!"
#event ImDead "You have been slain by#*#" 
#event Zoned "LOADING, PLEASE WAIT..." 

Sub Main 

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

   /declare mychannel string outer somechannel
   /declare autohealmode int outer 2
   /declare healspell string outer Complete Healing 
   /declare healspellrange int outer 115 
   /declare patchheal string outer Supernal Light 
   /declare patchhealrange int outer 115 
   /declare hotspell string outer Supernal Elixir 
   /declare hotspellrange int outer 115 
   /declare daspell string outer Divine Barrier 
   /declare yaulpspell string outer Yaulp VI 
   /declare usegroupheal int outer 0 
   /declare groupheal string outer Word of Replenishment 
   /declare grouphealrange int outer 70 
   /declare usedivarb int outer 1
   /declare healafterdivarb int outer 0 
   /declare announce int outer 1 
   /declare autosit int outer 1 
   /declare distancetosit int outer 40 
   /declare autointerrupt int outer 1 
   /declare onlyhealfd int outer 0 
   /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 Ward of Gallantry 
   /declare selfbuff string outer Armor of the Zealot
   /declare longhpbuff string outer Virtue 
   /declare singlesymbuff string outer Symbol of Kazad 
   /declare groupsymbuff string outer Kazad`s Mark 
   /declare spellhastebuff string outer 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 115 
   /declare nukeone string outer Order 
   /declare nuketwo string outer Condemnation 
   /declare stunone string outer Sound of Might 
   /declare stuntwo string outer Tarnation
   /declare automount int outer 1 
    

|** 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 70 
   /declare dacastpoint int outer 29 
   /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 60 
   /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 0 
   /declare duckfdspam int outer 0 
   /declare duckselfspam int outer 0 
   /declare nomtspam int outer 0 
   /declare ghealhurtcount int outer 0 
   /declare divarboor int outer 0 


   /join ${mychannel} 
    
   /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 60% 
    
   /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 (${Spawn[${tanknameid}].Name.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) { 
         /e Warning No Designated MT is available 
         /timed 300 /varset nomtspam 1 
         /varset nomtspam 0 
      } 
   } 
   /if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) { 
      /g ${Me.PctMana}m 
      /varset lomspam 0 
      /timed 300 /varset lomspam 1 
   } 
   /if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) { 
      /g oom 
      /varset oomspam 0 
      /timed 300 /varset oomspam 1 
      /call MedTime 
   } 
   /if (${GameState.Equal[CHARSELECT]}) /end 
   /if (${Target.ID}==${tanknameid}) { 
      /varset stophealpoint ${Math.Calc[${healpct}*1.1]} 
      /if ((${Target.Distance}<=${patchhealrange})&&(${Target.PctHPs}<=${Math.Calc[0.7*${healpct}]})&&(${Target.PctHPs}>=1)) { 
         /if (${announce}==1) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 1s CheckHP 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } 
      /if ((${Target.Distance}<=${healspellrange})&&(${Target.PctHPs}<=${healpct})&&(${Target.PctHPs}>=${Math.Calc[0.7*${healpct}]})) { 
         /if (${announce}==1) /g Casting ${healspell} on %T 
         /call Cast "${healspell}" gem1 1s CheckHP 
         /delay 15 ${Me.SpellReady[${healspell}]} 
         |/g CH Done
      } 
      /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 
   /call MaintainSelfBuffs
   /goto :tankwatchloop 
/return 
    
Sub MaintainSelfBuffs
/if (!${Me.Buff[Armor of the Zealot].ID}) {
  /echo Buffing Self
  /call Cast "Armor of the Zealot"
}
/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) /g 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) /g 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) /g 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.Member[${gmember}].Distance}<=${patchhealrange}) { 
            /if (${Group.Member[${gmember}].PctHPs}<=${worsthp}) { 
               /varset worsthurt ${Group.Member[${gmember}].Name} 
               /varset worsthurtid ${Group.Member[${gmember}].ID} 
               /varset worsthp ${Group.Member[${gmember}].PctHPs} 
               /varset worstclass ${Group.Member[${gmember}].Class.Name} 
            } 
         } 
      } 
      /if (${onlyhealfd}==1) { 
         /if (${Group.Member[${gmember}].Distance}<=${patchhealrange}) { 
            /if ((${Group.Member[${gmember}].Class.Name.NotEqual[Monk]})&&(${Group.Member[${gmember}].Class.Name.NotEqual[Necromancer]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) { 
               /varset worsthurt ${Group.Member[${gmember}].Name} 
               /varset worsthurtid ${Group.Member[${gmember}].ID} 
               /varset worsthp ${Group.Member[${gmember}].PctHPs} 
               /varset worstclass ${Group.Member[${gmember}].Class.Name} 
            } 
            /if ((${Group.Member[${gmember}].Class.Name.Equal[Monk]})||(${Group.Member[${gmember}].Class.Name.Equal[Necromancer]})) { 
               /if ((${Group.Member[${gmember}].State.Equal[feign]})&&(${Group.Member[${gmember}].PctHPs}<=${worsthp})) { 
                  /varset worsthurt ${Group.Member[${gmember}].Name} 
                  /varset worsthurtid ${Group.Member[${gmember}].ID} 
                  /varset worsthp ${Group.Member[${gmember}].PctHPs} 
                  /varset worstclass ${Group.Member[${gmember}].Class.Name} 
               } 
            } 
         } 
      } 
      /if ((${Group.Member[${gmember}].Distance}<=${grouphealrange})&&(${Group.Member[${gmember}].PctHPs}<=85)) /varcalc ghealhurtcount ${ghealhurtcount}+1 
      /if ((${Group.Member[${gmember}].PctHPs}<=85)&&(${Group.Member[${gmember}].PctHPs}>=60)) /varcalc minorhurt ${minorhurt}+1 
      /if ((${Group.Member[${gmember}].PctHPs}<=60)&&(${Group.Member[${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]})) { 
      /for gmember 0 to ${Group} 
         /if (${Group.Member[${gmember}].Distance}>200) /varcalc divarboor ${divarboor}+1 
      /next gmember 
      /if ((${Group}>=3)&&(${divarboor}<2)) /call Cast "Divine Arbitration" alt 3s 
      /delay 3 ${Me.AltAbilityReady[Divine Arbitration]} 
      /if ((${healafterdivarb}==1)&&(${Me.PctMana}>40)) { 
         /if (${announce}==1) /g Inc Grp Heal, get close 
         /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) /g 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 ((${worstclass.Equal[Warrior]})||(${worstclass.Equal[Paladin]})||(${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) /g 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) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 1s CheckHP 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
         /varset stophealpoint ${defaultstophealpoint} 
         /call CheckEvents 
         /return 
      } 
   } else /if ((${worstclass.Equal[Magician]})||(${worstclass.Equal[Wizard]})||(${worstclass.Equal[Enchanter]})||(${worstclass.Equal[Druid]})) { 
      /if ((${worsthp}<=${casterhotpoint})&&(${worsthp}>${casterpatchpoint})) { 
         /if ((${worsthurt.Equal[${nohotforua}]})||(${worsthurt.Equal[${nohotforub}]})||(${worsthurt.Equal[${nohotforuc}]})||(${worsthurt.Equal[${nohotforud}]})) /return 
         /if (${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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /varset nohotforua NULL 
            /delay 15 ${Me.SpellReady[${hotspell}]} 
         } else /if (${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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /varset nohotforub NULL 
            /delay 15 ${Me.SpellReady[${hotspell}]} 
         } else /if (${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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /varset nohotforuc NULL 
            /delay 15 ${Me.SpellReady[${hotspell}]} 
         } else /if (${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) /g Casting ${hotspell} on %T 
            /varset stophealpoint ${Math.Calc[${casterhotpoint}+5]} 
            /call Cast "${hotspell}" gem3 1s CheckHP 
            /timed 200 /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) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 1s CheckHP 
         /varset stophealpoint ${defaultstophealpoint} 
         /call CheckEvents 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
         /return 
      } 
      /varset stophealpoint ${defaultstophealpoint} 
   } else /if ((${worstclass.Equal[Necromancer]})||(${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) /g 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) /g 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.Member[${gmember}].Pet.ID}) { 
         /if (${Group.Member[${gmember}].Pet.Distance}<=${pethealspellrange}) { 
            /if ((${Group.Member[${gmember}].Pet.PctHPs}<=${worsthp})&&(${Group.Member[${gmember}].Pet.PctHPs}<=${pethealpoint})) { 
               /varset worsthurt ${Group.Member[${gmember}].Pet.Name} 
               /varset worsthurtid ${Group.Member[${gmember}].Pet.ID} 
               /varset worsthp ${Group.Member[${gmember}].Pet.PctHPs} 
            } 
         } 
      } 
   /next gmember 
   /if (${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) /g 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 
   /doevents flush
/return 


Sub MedTime 
   :oomwait 
   /call CheckEvents 
   /If ((${FindItem["Rod of Mystical Transvergance"].InvSlot})&&(${Me.PctMana}<=70)&&(${Me.PctHPs}>=98)&&(${rodwait}==0)) { 
      /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 
   /if ((${autointerrupt}>=1)&&(${Target.PctHPs}>=${stophealpoint})) { 
      /if ((${announce}==1)&&(${duckspam}==1)) { 
         /g Ducking heal on %T 
         /e Ducking heal on ${Target.Name} 
         /varset duckspam 0 
         /timed 60 /varset duckspam 1 
      } 
      /call Interrupt 
   } 
   /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) { 
      /if ((${announce}==1)&&(${duckselfspam}==1)) { 
         /g Ducking heal on %T so I can heal my (ChickenShit) self 
         /e Ducking heal on ${Target} so I can heal myself 
         /varset duckselfspam 0 
         /timed 60 /varset duckselfspam 1 
      } 
      /call Interrupt 
   } 
   /if (${onlyhealfd}==1) { 
      /if ((${Target.Class.Name.Equal[Necromancer]})||(${Target.Class.Name.Equal[Monk]})) { 
         /if (${Target.State.NotEqual[feign]}) { 
            /if ((${announce}==1)&&(${duckfdspam}==1)) { 
               /g Ducking heal on %T because he isn't staying FD 
               /e Ducking heal on ${Target.Name} because he isn't staying FD 
               /varset duckfdspam 0 
               /timed 40 /varset duckfdspam 1 
            } 
            /call Interrupt 
         } 
      } 
   } 
/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[Hand of Virtue].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Hand of Virtue].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[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[Protection of the 9].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Protection of the 9].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[Symbol of Kazad].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Symbol of Kazad].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[Brell's Stalwart Shield].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[Brell's Stalwart Shield].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 
   /call Buffbeg 
/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 (${NearestSpawn[PC guild druid].Name.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 /e 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 (${NearestSpawn[PC guild shaman].Name.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 /e 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 (${NearestSpawn[PC guild paladin].Name.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 /e 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 (${NearestSpawn[PC guild enchanter].Name.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 /e No guild Enchanter available for C5 
   } 
   /if ((!${Me.Buff[${daspell}].ID})&&(${Me.PctHPs}<=75)) /call Healself 
   /if (!${Me.Buff[Spiritual Dominion].ID}) { 
      /if (${NearestSpawn[PC guild beastlord].Name.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 /e 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[${mychannel}]})&&(!${ChatType.Equal[TELL]})) /return 
   /if (!${Spawn[${Sender}].ID}) { 
      /e ${Sender} is not in the zone 
      /return 
   } 
   /if (${ChatText.Equal[Follow me]}) { 
      /delay 5 
      /if (!${Spawn[${Sender}].ID}) { 
         /e ${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[Gbuff now!]}) { 
      /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.Member[${gmember}].ID} 
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
         /if (${Target.ID}==${Group.Member[${gmember}].ID}) { 
            /if (${Target.Class.Name.NotEqual[Paladin]}) /call Cast "${acbuff}" gem5 7s 
            /if (${Target.Class.Name.Equal[Paladin]}) { 
               /call Cast "${longhpbuff}" gem4 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.Member[${gmember}].ID} 
            /delay 1s ${Target.ID}==${Group.Member[${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.Member[${gmember}].ID} 
         /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
         /if (${Target.ID}==${Group.Member[${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 
               /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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 5 
         /if (${Target.Type.NotEqual[NPC]}) { 
            /assist ${Sender} 
            /delay 5 ${Target.Type.Equal[NPC]} 
         } 
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
            /if (${Me.SpellReady[${nukeone}]}) { 
               /if (${announce}==1) /g Casting ${nukeone} on %T 
               /call Cast "${nukeone}" spell 3s 
            } else /if (${Me.SpellReady[${nuketwo}]}) { 
               /if (${announce}==1) /g 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 5 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /assist ${Sender} 
         /delay 5 ${Target.Type.Equal[NPC]} 
      } 
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
         /if (${Me.SpellReady[${stunone}]}) { 
            /if (${announce}==1) /g Casting ${stunone} on %T 
            /call Cast "${stunone}" spell 3s 
         } else /if (${Me.SpellReady[${stuntwo}]}) { 
            /if (${announce}==1) /g 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[buffme]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Class.Name.Equal[Paladin]}) { 
         /call Cast "${longhpbuff}" gem4 10s 
         /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 
         /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 
         /if (!${FindItem[Breastplate of Vengeful Fury].ID}) /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 (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=${patchhealrange}) { 
         /if (${announce}==1) /g Casting ${patchheal} on %T 
         /call Cast "${patchheal}" gem2 2s 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if ((${ChatText.Equal[sym]})||(${ChatText.Equal[wog]})||(${ChatText.Equal[V]})||(${ChatText.Equal[bor]})||(${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 (${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]}) /call Cast "${longhpbuff}" gem4 10s 
   /if (${ChatText.Equal[bor]}) { 
      /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 
   } 
   /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) /g Casting ${hotspell} on %T 
         /call Cast "${hotspell}" gem2 2s 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[ch me]}) { 
      /if (${Target.Distance}<=100) { 
         /if (${announce}==1) /g Casting Complete Healing on %T 
         /call Cast "Complete Healing" gem2 5s 
         /delay 15 ${Me.SpellReady[${hotspell}]} 
      } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[mana check]}) /chat #${mychannel} Cleric Mana ${Me.PctMana}% 
   /if (${ChatText.Equal[slowcamp]}) { 
      /if (${Me.Standing}) /sit 
      /delay 5m ${Me.PctMana}>=98 
      /camp 
      /end 
   } 
/return

Sub Event_ImDead 
    /echo ENDING MACRO. WE DIED!
    /endmacro
/return 

Sub Event_Zoned
    /echo ENDING MACRO. We Zoned.
    /endmacro
/return 


SiatX
orc pawn
orc pawn
Posts: 27
Joined: Thu May 06, 2004 6:14 am

Post by SiatX » Sun Jul 03, 2005 4:56 pm

Any way to make this

Code: Select all

Sub MaintainSelfBuffs 
/if (!${Me.Buff[Armor of the Zealot].ID}) { 
  /echo Buffing Self 
  /call Cast "Armor of the Zealot"
Check for Steeloak before it starts trying to buff that?

Nm I just removed the whole thing :P
Last edited by SiatX on Sun Jul 03, 2005 5:10 pm, edited 1 time in total.