Macro Will this still work?

adol

Premium Member
Joined
Sep 25, 2007
Messages
69
Reaction score
0
Points
6
My old cleric macro, I used to run two groups, not going to go that far again but wanted to run a full group, needed to see if these old macros would still run. My friend, I used to get them from has long moved on and is not interested in coming back to EQ.




Code:
|**---------------------------------------------------------- 
AFCleric.mac

USAGE: /mac AFCLERIC 80 -- target Main Assist 

 4 modes: 

   autohealmode=0 TANK ONLY
    
   autohealmode=1 TANK - CLERIC 
    
   autohealmode=2 TANK - CLERIC - GROUP
    
   autohealmode=3 TANK FIRST - CLERIC SECOND ... THEN GROUP 
  
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..."
#event Invited "#*# invites you to join a group."  

Sub Main 

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

 
   /declare autohealmode         int     outer 2
   /declare healpartner          string  outer NULL

|-----SPELLS-----|

   /declare healspell            string  outer Complete Heal 
   /declare patchheal            string  outer Sacred Light Rk. III
   /declare shhealspell          string  outer Sacred Light Rk. III
   /declare fastheal             string  outer Devout Remedy
   /declare hotspell             string  outer Sacred Elixir Rk. III 
   /declare pethealspell         string  outer Sacred Elixir Rk. III
   /declare groupheal            string  outer Word of Vivacity

   /declare rgcspell             string  outer Remove Greater Curse
   /declare curespell            string  outer Antidote 

   /declare acbuff               string  outer Ward of the Dauntless Rk. III
   /declare grpacbuff            string  outer Order of the Resolute Rk. III
   /declare selfbuff             string  outer Armor of the Solemn 
   /declare virtuebuff           string  outer Virtue 
   /declare longhpbuff           string  outer Hand of Temerity  
   /declare singlelonghpbuff     string  outer Temerity Rk. II 
   /declare singlesmybuff        string  outer Temerity Rk. II
   /declare groupsmybuff         string  outer Hand of Temerity

   /declare spellhastebuff       string  outer Aura of Purpose 
   /declare shieldspell          string  outer Rallied Shield of Vie Rk. II
   /declare auraspell            string  outer Aura of the Pious
   /declare auraeffect           string  outer Aura of the Pious Effect
   /declare auraspellii          string  outer Circle of Divinity
   /declare auraeffectii         string  outer Divinity Effect
   /declare spelldi              string  outer Promised Renewal Rk. III
   /declare daspell              string  outer Divine Destiny
   /declare ivuspell             string  outer Fool the Fallen
   /declare shieldspell          string  outer Rallied Shield of Vie Rk. II
   /declare daproc               string  outer Touch of the Divine 

   /declare yaulpspell           string  outer Yaulp X 

   /declare spellgate            string  outer gate

   /declare bhealspell           string  outer ${healspell} 
   /declare bpatchheal           string  outer ${patchheal}
   /declare bfastheal            string  outer ${fastheal}

   /declare SpellRezEffect       string  outer Resurrection Sickness
   /declare SpellRevEffect       string  outer Revival Sickness

|-----Other Class Buffs-----| 

   /declare shmfocus             string  outer Bloodworg Focusing
   /declare shmfocusrkii         string  outer Bloodworg Focusing Rk. II
   /declare shmfocusrkiii        string  outer Bloodworg Focusing Rk. III 
   /declare shmgrpfocus          string  outer Talisman of the Bloodworg 
   /declare shmgrpfocusrkii      string  outer Talisman of the Bloodworg Rk. II
   /declare shmgrpfocusrkiii     string  outer Talisman of the Bloodworg Rk. III
   /declare pallybuff            string  outer Brell's Earthen Aegis 
   /declare pallybuffrkii        string  outer Brell's Earthen Aegis Rk. II
   /declare pallybuffrkiii       string  outer Brell's Earthen Aegis Rk. III
   /declare beastcrack           string  outer Spiritual Epiphany
   /declare beastcrackrkii       string  outer Spiritual Epiphany Rk. II
   /declare beastcrackrkiii      string  outer Spiritual Epiphany Rk. III
   /declare chantercrack         string  outer Voice of Intuition 
   /declare chantercrackrkii     string  outer Voice of Intuition Rk. II
   /declare chantercrackrkiii    string  outer Voice of Intuition Rk. III
   /declare chanterhaste         string  outer Hastening of Erradien
   /declare chanterhasterkii     string  outer Hastening of Erradien Rk. II
   /declare chanterhasterkiii    string  outer Hastening of Erradien Rk. III
   /declare druidbuff            string  outer Ironwood Skin
   /declare druidbuffrkii        string  outer Ironwood Skin Rk. II
   /declare druidbuffrkiii       string  outer Ironwood Skin Rk. III
   /declare druidgrpbuff         string  outer Blessing of the Ironwood 
   /declare druidgrpbuffrkii     string  outer Blessing of the Ironwood Rk. II
   /declare druidgrpbuffrkiii    string  outer Blessing of the Ironwood Rk. III

|-----TO DO LIST-----|

   /declare aada                 int     outer 1
   /declare autointerrupt        int     outer 1
   /declare autoaura             int     outer 0
   /declare autoauraii           int     outer 0
   /declare automount            int     outer 0
   /declare autosit              int     outer 1
   /declare acheals              int     outer 0

   /declare autorez              int     outer 1
   /declare corpsecount          int     outer 0

   /declare buffbeg              int     outer 0
   /declare dobuff               int     outer 1

   /declare divarboor            int     outer 1

   /declare healafterdivarb      int     outer 1    
   /declare healpetmode          int     outer 1

   /declare interrupt2healself   int     outer 1 
   /declare lomspam              int     outer 1
   /declare lomannounced         int     outer 0

   /declare minorhurt            int     outer 1 
   /declare majorhurt            int     outer 1
 
   /declare noInvis              int     outer 0
   /declare nomtspam             int     outer 0
  
   /declare onlyhealfd           int     outer 1 
   /declare oomspam              int     outer 1
 
   /declare pallycount           int     outer 1
   /declare rodwait              int     outer 0
   /declare trickyda             int     outer 1

   /declare fastshield           int     outer 0
   /declare usedivarb            int     outer 1
   /declare usegroupheal         int     outer 1

   /declare medding              int     outer 0

   /declare worsthp              int     outer 100

   /declare ShieldDAUsed         int     outer 0
   /declare autocure             int     outer 1
   /declare idied                int     outer 0

   /declare ching                int     outer 1
 
|-----Healing-----|

   /declare casterhotpoint       int     outer 80 
   /declare casterpatchpoint     int     outer 75
   /declare divarbpoint          int     outer 75
   /declare selfhealpoint        int     outer 80 
   /declare tankhealpoint        int     outer 88
   /declare shamanpatchpoint     int     outer 55
   /declare pullerpatchpoint     int     outer 80
   /declare pethealpoint         int     outer 30
   /declare meleepatchpoint      int     outer 88
   /declare grouphealpoint       int     outer 75
   /declare majorhurtpoint       int     outer 64
   /declare minorhurtpoint       int     outer 80
   /declare validheal            int     outer 85

|-----Healing Ranges-----| 

   /declare healspellrange       int     outer 110
   /declare spamhealrange        int     outer 180
   /declare pethealspellrange    int     outer 50
   /declare patchhealrange       int     outer 110
   /declare fasthealrange        int     outer 110
   /declare hotspellrange        int     outer 100
   /declare grouphealrange       int     outer 100
   /declare fdhealrange          int     outer 100
   /declare fdhealmaxrange       int     outer 190 
   /declare shquitrange          int     outer 150

|-----Switch to Fast Heal-----|

   /declare healpct              int     outer 80
   /declare bhealpct             int     outer ${healpct} 

|-----Autosit//Yaulp-----| 

   /declare hpmanage             int     outer 90
   /declare distancetosit        int     outer 85
   /declare distancetobuff       int     outer 90
   /declare manamanage           int     outer 92
   /declare sitmana              int     outer 82
   /declare autochangeover       int     outer 30
   /declare agrorange            int     outer 150

|-----MANA LIMITS-----| 

   /declare manatohealpet        int     outer 70
   /declare grouphealmana        int     outer 35
   /declare recoverymana         int     outer 32  

|-----INTERRUPT & LIMITS-----| 
 
   /declare interrupt2healselfhp int     outer 65 
   /declare dacastpoint          int     outer 40 
   /declare SHInterrupt          int     outer 80

|-----Alt Abilities-----|

   /declare aacure               string  outer Radiant Cure
   /declare aatob                string  outer Harmonic Dissonance
   /declare aamgb                string  outer Mass Group Buff
   /declare aadrez               string  outer Divine Resurrection
   /declare aarez                string  outer Blessing of Resurrection
   /declare aaarb                string  outer Divine Arbitration
   /declare aapurity             string  outer Purify Soul
   /declare aacr                 string  outer Celestial Regeneration
   /declare aapet                string  outer Celestial Hammer
 
|-----Alt Ability Range-----| 
 
   /declare AARange              int     outer 85

|-----Follow Ranges-----| 
 
   /declare followrange          int     outer 150
   /declare stoprange            int     outer 100
   /declare followmin            int     outer 10
   /declare followmax            int     outer 15

|-----Other Ranges-----| 
 
   /declare maxbuffrange         int     outer 150
   /declare darange              int     outer 200
   /declare Vertical             int     outer 40

|-----CHAT CHANNEL-----|

   /declare mychannel            string  outer Grave
   /declare chatcontroller       string  outer Albe

|-----CHAT-----|

   /declare Verbose              int     outer 0
   /declare announce             int     outer 0

|-----Mount-----|
 
   /declare Mount                string  outer Black Chain Bridle and Barding
   /declare MountBuff            string  outer Summon Warhorse

|-----EPICS-----|

   /declare ShieldDA             string  outer Aegis of Superior Divinity
   /declare clickrez             string  outer Water Sprinkler of Nem Ankh

|-----Fellowship-----|

   /declare Fellowship           string  outer Fellowship Registration Insignia

|-----Modrods-----|

   /declare modroda              string  outer Wand of Elemental Transvergence
   /declare modrodb              string  outer Rod of Mystical Transvergance
   /declare modrodc              string  outer Rod of Prime Transvergence
   /declare modrodhp             int     outer 90
   /declare modrodmana           int     outer 85

   |------------------------------------------------------------ 
   |Exchange Items 
   |------------------------------------------------------------

   /declare Primary              string  outer Wyvern-Priest's Runed Censer
   /declare Secondary            string  outer Dark Phanton Buckler
   /declare ChestItem            string  outer Elaborate Dreadguard Cuirass
   /declare FaceItem             string  outer NULL
   /declare WaistItem            string  outer NULL
   /declare LegItem              string  outer NULL

   |------------------------------------------------------------ 
   |Item Buffs 
   |------------------------------------------------------------

   /declare BuffItemA            int     outer 1 
   /declare ExchangeA            int     outer 1 
   /declare SelfItemA            string  outer Lana's Crystal Shield
   /declare SelfBuffA            string  outer Aura of Taelosia
   /declare AExchange            string  outer "Secondary"
   /declare AReturn              string  outer ${Secondary}

   /declare BuffItemB            int     outer 0
   /declare ExchangeB            int     outer 0
   /declare SelfItemB            String  outer NULL
   /declare SelfBuffB            string  outer NULL
   /declare BExchange            string  outer NULL
   /declare BReturn              string  outer NULL

   /declare BuffItemC            int     outer 0
   /declare ExchangeC            int     outer 0
   /declare SelfItemC            string  outer NULL
   /declare SelfBuffC            string  outer NULL
   /declare CExchange            string  outer NULL
   /declare CReturn              string  outer NULL

   /declare BuffItemD            int     outer 1
   /declare ExchangeD            int     outer 1
   /declare SelfItemD            string  outer Breastplate of Superior Divinity
   /declare SelfBuffD            string  outer Pious Elixir
   /declare DExchange            string  outer "chest"
   /declare DReturn              string  outer ${ChestItem}

   /declare BuffItemE            int     outer 1
   /declare ExchangeE            int     outer 1
   /declare SelfItemE            string  outer NULL
   /declare SelfBuffE            string  outer NULL
   /declare EExchange            string  outer NULL
   /declare EReturn              string  outer NULL

|-----SETTING ALIAS-----| 
 
   /declare tankname             string  outer ${Target} 
   /declare tanknameid           int     outer 0
   /declare tankclass            string  outer NULL
 
   /declare worsthurt            string  outer NULL 
   /declare worsthurtid          int     outer 0
   /declare worstclass           string  outer NULL 

   /declare gmember              int     outer 0
   /declare shgmember            int     outer 0
   /declare mshgmember           int     outer 0
 
   /declare nohotforua           int     outer 0 
   /declare nohotforub           int     outer 0 
   /declare nohotforuc           int     outer 0 
   /declare nohotforud           int     outer 0

   /declare grouphurttotal       int     outer 3
   /declare ghealcountmin        int     outer 3
   /declare minorhurtvalue       int     outer 1
   /declare majorhurtvalue       int     outer 2

   /declare lostcausepcthp       int     outer 2

   /declare SHCount              int     outer 0
   /declare SHCountMax           int     outer 4
   /declare spam                 int     outer 0
   /declare SHTank               string  outer NULL
   /declare SHTankID             int     outer 0

|-----AUTO FOLLOW-----|

   /declare following            int     outer 0 
   /declare follname             string  outer NULL
 
|----- LOOTCORPSE -----|

   /declare t                    int     outer 0 
   /declare loottotal            int     outer 0
   /declare lootslot             int     outer 0
   /declare lootleft             int     outer 0

|-----MACRO SET UP-----|

   /leaveall
   /join ${mychannel}
   /delay 5
   /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}
       /varset bhealpct ${Param0}
       /echo healpct ${healpct}  
   } else /echo No Heal% specified, defaulting to 60% 
   /if (!${Defined[Param1]}) {    
       /echo Defaulting to ${healspell} at ${healpct}% 
   } else /if (!${Defined[Param2]}) { 
              /varset healspell ${Param1}
              /echo healspell ${healspell} 
   } else /if (!${Defined[Param3]}) { 
              /varset healspell ${Param1} ${Param2} 
              /echo healspell ${healspell} ${Param2}
   } else /if (!${Defined[Param4]}) { 
              /varset healspell ${Param1} ${Param2} ${Param3} 
              /echo healspell ${healspell} ${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 
 
   /call memspells
   /Popup GUARDING ${tankname} .... WITH MY LIFE
   /if (${Verbose}) /1 ***  I am here !  ***
   /tell ${chatcontroller} I am here! 
   /echo My master is ${chatcontroller}

|-----MAIN LOOP-----|
   
   :tankwatchloop 

   /if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0 
   /if (!${Spawn[${tanknameid}].ID}) {
       /if (${Spawn[${tankname}].ID} && ${Spawn[${tankname}].Distance}<=${healspellrange}) { 
           /if (${Spawn[${tankname}].Type.NotEqual[Corpse]}) /target ${tankname}
           /if (${Spawn[${tankname}].ID} && ${Spawn[${tankname}].Type.NotEqual[Corpse]}) {
               /varset tanknameid ${Target.ID} 
               /varset tankclass ${Target.Class.Name}
               /echo ${tankname} is the designated MT and has ID# ${tanknameid} ... one
           }
           /if (${SpawnCount[${tankname} ${tankclass}]}==1 && ${Spawn[${tankname}].Type.NotEqual[Corpse]}) { 
               /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID} 
               /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid} ... two
           } 
           /if (${SpawnCount[${tankname} ${tankclass}]}>1 && ${Spawn[${tankname}].Type.NotEqual[Corpse]}) { 
               /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. ... three 
               } else { 
                   /beep 
                   /echo Need to restart macro to correctly identify the MT 
               } 
           } 
       }
   } 
   /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].Distance}<=${healspellrange} && (${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight} || ${Spawn[${tanknameid}].PctHPs}<=${healpct})) {
       /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) { 
           /target id ${tanknameid} 
           /delay 6 ${Target.ID}==${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}. ... four 
           } 
       }
   } 
   /if (!${Target.ID} || ${Target.ID}!=${Spawn[${tanknameid}].ID}) { 
       /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].Distance}<=${healspellrange} && (${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight} || ${Spawn[${tanknameid}].PctHPs}<=${healpct})) {
           /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) { 
               /target id ${tanknameid} 
               /delay 6 ${Target.ID}==${Spawn[${tanknameid}].ID} 
           } 
       }
   } 
   /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 && ${lomspam}) { 
       /if (${announce}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) /g ${Me.PctMana}m
       /if (${lomannounced}==0) {
           /1 LOM
           /1 Hold Pulls
           /varset lomannounced 1
       } 
       /varset lomspam 0 
       /timed 300 /varset lomspam 1 
   } 
   /if (${Me.PctMana}<=7 && ${announce} && ${oomspam}) { 
       /g oom 
       /varset oomspam 0 
       /timed 300 /varset oomspam 1 
       /call MedTime 
   }
   /if (${Me.PctMana}>=80 && ${lomspam}==1 && ${lomannounced}==1) { 
       /if (${announce}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) /g ${Me.PctMana}m ... GTG
       /1 GTG
       /1 Resume Pulls
       /varset lomannounced 0
   } 
   /if (${GameState.Equal[CHARSELECT]}) /end
   :Hold_Main
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
   /if (${Me.Moving}) /goto :Hold_Main 
   /if (${Target.ID}==${tanknameid} && ${Target.Type.NotEqual[Corpse]}) {
       /if (${Target.Distance}<=${healspellrange} && ${Target.Type.NotEqual[Corpse]} && ${Target.PctHPs}<=${Math.Calc[0.58*${healpct}]}) { 
           /if ((${fastshield}==0 || ${Group}<${ghealcountmin} || (!${Cast.Ready[${ShieldDA}]} && !${Me.AltAbilityReady[${aaarb}]})) && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana} && ${Me.SpellReady[${fastheal}]}) {
               /if (${Target.ID}==${tanknameid} && ${announce}==1) /g ${fastheal} on %T 
               /if (${Target.ID}==${tanknameid}) /call Cast "${fastheal}" gem10 1s CheckTankHPFast 
               /if (${Target.ID}==${tanknameid}) /delay 5 ${Me.SpellReady[${fastheal}]}
               /if (${Target.ID}==${tanknameid}) /varset fastshield 1
               /if (${Target.ID}==${tanknameid}) /goto :Hold_Main
           } else /if (${fastshield}==1 && ${Group}>=${ghealcountmin} && ${FindItem[${ShieldDA}].ID} && ${Cast.Ready[${ShieldDA}]} && ${Group.Member[${tankname}]}) {
               /if (${Target.ID}==${tanknameid}) /echo Using "${ShieldDA}" *
               /if (${Target.ID}==${tanknameid} && ${announce}==1) /g EPIC USED
               /if (${Target.ID}==${tanknameid}) /call Cast "${ShieldDA}" item 1s CheckTankHPFast
               /if (${Target.ID}==${tanknameid}) /varset fastshield 0
               /if (${Target.ID}==${tanknameid}) /goto :Hold_Main
           } else /if (${usedivarb}==1 && ${Group}>=${ghealcountmin} && ${Me.AltAbilityReady[${aaarb}]} && ${Group.Member[${tankname}]}) {
               /if (${Target.ID}==${tanknameid}) /echo Using "${aaarb}" *
               /if (${Target.ID}==${tanknameid} && ${announce}==1) /g ${aaarb} USED
               /if (${Target.ID}==${tanknameid}) /call cast "${aaarb}" alt 1s CheckTankHPFast
               /if (${Target.ID}==${tanknameid}) /varset fastshield 0
               /if (${Target.ID}==${tanknameid}) /goto :Hold_Main
           }
       }
       /if (${Target.Distance}<=${healspellrange} && ${Target.Type.NotEqual[Corpse]} && ${Target.PctHPs}<=${Math.Calc[0.85*${healpct}]} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
           /if (${Target.ID}==${tanknameid} && ${announce}==1) /g ${patchheal} on %T 
           /if (${Target.ID}==${tanknameid}) /call Cast "${patchheal}" gem2 1s CheckTankHP 
           /if (${Target.ID}==${tanknameid}) /delay 15 ${Me.SpellReady[${patchheal}]}
           /if (${Target.ID}==${tanknameid}) /varset ching 1
           /call GH
           /if (${FindItem[${SelfItemD}].ID} && ${Cast.Ready[${SelfItemD}]} && ${BuffItemD}==1) {
               /if (${Target.ID}==${tanknameid} && ${ExchangeD}) /exchange "${SelfItemD}" "${DExchange}"
               /if (${Target.ID}==${tanknameid}) /echo Using "${SelfItemD}" 
               /if (${Target.ID}==${tanknameid} && ${Verbose}) /1 *** "${SelfBuffD}" on %t ***
               /if (${Target.ID}==${tanknameid}) /call Cast "${SelfItemD}" item 1s ChkEvent
               /if (${Target.ID}==${tanknameid} && ${ExchangeD}) /exchange "${DReturn}" "${DExchange}"   
           }
       } 
       /if (${Target.Distance}<=${healspellrange} && ${Target.Type.NotEqual[Corpse]} && ${Target.PctHPs}<=${healpct} && ${Me.CurrentMana}>=${Spell[${healspell}].Mana}) {
           /if (${Target.ID}==${tanknameid} && ${announce}==1 && ${Spell[${healspell}].Name.Equal[${bhealspell}]} && (${NearestSpawn[2,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} || ${NearestSpawn[1,NPC #].LineOfSight})) /g ${patchheal} on %T 
           /if (${Target.ID}==${tanknameid} && ${Spell[${healspell}].Name.Equal[${bhealspell}]} && (${NearestSpawn[2,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} || ${NearestSpawn[1,NPC #].LineOfSight})) /call Cast "${patchheal}" gem2 1s CheckTankHP 
           /if (${Target.ID}==${tanknameid} && ${announce}==1 && ((!${NearestSpawn[2,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && !${NearestSpawn[1,NPC #].LineOfSight}) || ${Spell[${healspell}].Name.NotEqual[${bhealspell}]})) /g ${healspell} on %T
           /if (${Target.ID}==${tanknameid} && ((!${NearestSpawn[2,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && !${NearestSpawn[1,NPC #].LineOfSight}) || ${Spell[${healspell}].Name.NotEqual[${bhealspell}]})) /call Cast "${healspell}" gem1 1s CheckTankHP 
           /if (${Target.ID}==${tanknameid}) /delay 15 ${Me.SpellReady[${healspell}]}
           /if (${Target.ID}==${tanknameid}) /varset ching 1
           /call GH
           /if (${FindItem[${SelfItemD}].ID} && ${Cast.Ready[${SelfItemD}]} && ${BuffItemD}==1) {
               /if (${Target.ID}==${tanknameid} && ${ExchangeD}) /exchange "${SelfItemD}" "${DExchange}"
               /if (${Target.ID}==${tanknameid}) /echo Using "${SelfItemD}" 
               /if (${Target.ID}==${tanknameid} && ${Verbose}) /1 *** "${SelfBuffD}" on %t ***
               /if (${Target.ID}==${tanknameid}) /call Cast "${SelfItemD}" item 1s ChkEvent
               /if (${Target.ID}==${tanknameid} && ${ExchangeD}) /exchange "${DReturn}" "${DExchange}"   
           }
       }
   }
   /if (${idied}==1 && ${dobuff}==0 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight} && ${Me.PctMana}>=${recoverymana}) {
       /varset idied 0 
       /varset dobuff 1
       /echo Recovery ${idied}
       /echo Do Buff ${dobuff}
   }
   /if (${autosit}==1 && ${Me.PctMana}<=${manamanage} && !${Me.Buff[${MountBuff}].ID} && !${Me.Casting.ID}) {
       /if (${Bool[${Me.Standing}]} && !${Me.Moving} && ${Me.PctMana}<=${sitmana} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctHPs}>${hpmanage} && ${medding}==1) { 
           /varset medding 0
           /echo Medding FALSE .... Mob Proxy Reset
       } 
       /if (${Bool[${Me.Standing}]} && ${Me.PctMana}<=${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctHPs}>${hpmanage} && ${medding}==0) { 
           /sit
           /varset medding 1
           /echo Medding: TRUE
       }
   }
   /if (${autosit}==1 && ${Bool[${Me.Sitting}]} && !${Window[SpellBookWnd].Open} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${medding}==1) { 
       /stand
       /varset medding 0
       /echo Medding: FALSE ... Mob too close
   } 
   /if (${autosit}==1 && ${Bool[${Me.Sitting}]} && !${Me.Buff[${MountBuff}].ID} && ${Me.PctMana}>${manamanage} && ${medding}==1) {
       /stand
       /varset medding 0
       /echo Medding: FALSE .... Mana GTG
   }
   /if (${autosit}==1 && ${Bool[${Me.Sitting}]} && !${Me.Buff[${MountBuff}].ID} && ${Me.PctHPs}<${hpmanage} && ${medding}==1) {
       /stand
       /varset medding 0
       /echo Medding FALSE .... HP too Low
   } 
   /if (${autohealmode}==0) { 
       /call CheckEvents 
       /goto :tankwatchloop 
   } 
   /if (${autohealmode}>=1 && ${Me.PctHPs}<=${selfhealpoint}) /call Healself 
   /if (${autohealmode}>=2) { 
       /if (${Spawn[${tanknameid}].PctHPs}>${healpct} || ${Spawn[${tanknameid}].Distance}>${healspellrange} || ${Spawn[${tanknameid}].PctHPs}<=${lostcausepcthp} || !${Target.ID} || !${Spawn[${tanknameid}].ID} || ${Target.ID}!=${Spawn[${tanknameid}].ID} || ${Spawn[tankname].Type.Equal[Corpse]}) { 
           /call Healgroup 
       } 
   } 
   /if (${autohealmode}<2 && ${Me.PctHPs}>${selfhealpoint} && ${Me.PctMana}<=${manamanage}) /call MedTime 
   /call CheckEvents 
   /if (${dobuff}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) /call MaintainSelfBuffs
   /if (${autocure}==1 && ${Debuff.Detrimentals} && !${Me.Buff[${SpellRezEffect}].ID} && !${Me.Buff[${SpellRevEffect}].ID}) /call autocures
   /if (${autorez}==1 && ${corpsecount}==0 && (${Spawn[${tanknameid}].Distance}<=${healspellrange} || ${Spawn[${tanknameid}].Type.Equal[Corpse]}) && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /call AutoRez
   /if (${acheals}==1 && ${Spell[${healspell}].ID}==${Spell[${bpatchheal}].ID} && ${Spawn[${healpartner}].ID} && ${Me.PctMana}<=${autochangeover}) /call Hpartner 
   /if (${Cursor.Name.Equal[${modroda}]} || ${Cursor.Name.Equal[${modrodb}]} || ${Cursor.Name.Equal[${modrodc}]}) /autoinventory
   /if (${Group}<1 && ${Me.PctHPs}>${selfhealpoint} && ${Me.PctMana}<=${manamanage}) /call MedTime
   /goto :tankwatchloop 
/return 

|-----END MAIN LOOP-----|

   |------------------------------------------------------------ 
   | AUTO REZ 
   |------------------------------------------------------------

Sub AutoRez
   /if (${Window[RespawnWnd].Open}) /doevents
   /echo Corpse Count
   /declare GC int local 1
   /for GC 1 to ${Group}
   /if (${Spawn[${Group.Member[${GC}]}].Type.Equal[Corpse]} && (${Spawn[${tanknameid}].Distance}<=${healspellrange} || ${Spawn[${tanknameid}].Type.Equal[Corpse]}) && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
       /target ${Group.Member[${GC}]}'s Corpse
       /delay 5 
       /corpsedrag
       /if (${Me.AltAbilityReady[${aarez}]}) {
           /if (${announce}==1) /g ${aarez} inc ... %t 
           /if (${Verbose}) /1 *** ${aarez} %t ! *** 
           /call cast "${aarez}" alt 1s CheckForNPC
       } else /if (${FindItem[${clickrez}].ID} && ${Me.AltAbilityReady[${aarez}]}==0) {
           /if (${announce}==1) /g Rez inc ... %t 
           /if (${Verbose}) /1 *** Rezzing %t ! *** 
           /call Cast "${clickrez}" item 1s CheckForNPC
       }
       /delay 3s
       /keypress esc
       /corpsedrop
    }
    /next GC
    /varset corpsecount 1
    /timed 500 /varset corpsecount 0
    /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
        /varset medding 1
        /echo Medding TRUE
    }
    /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
    /if (${Bool[${Me.Sitting}]} && ${medding}==0) /stand
/return

   |------------------------------------------------------------ 
   |meming spells from list. 
   |------------------------------------------------------------ 

Sub MemSpells
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
   /echo Memming spells. Hang on. 
   /if (!${Me.Gem[${bhealspell}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 1 "${bhealspell}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${bpatchheal}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 2 "${bpatchheal}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${groupheal}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 3 "${groupheal}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${hotspell}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 4 "${hotspell}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${selfbuff}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 5 "${selfbuff}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${spelldi}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 6 "${spelldi}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${daspell}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 7 "${daspell}" 
       /delay 25 
   } 
   /if (!${Me.Gem[${yaulpspell}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 8 "${yaulpspell}" 
       /delay 30 
   } 
   /if (!${Me.Gem[${longhpbuff}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 9 "${longhpbuff}" 
       /delay 30 
   }
   /if (!${Me.Gem[${bfastheal}]}) {
       /if (${Bool[${Me.Standing}]}) /sit 
       /memspell 10 "${bfastheal}" 
       /delay 30 
   }
   /delay 15 
   /echo Spells are memmed.
   /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
       /varset medding 1
       /echo Medding TRUE
   }
   /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
   /if (${Bool[${Me.Sitting}]} && ${medding}==0) /stand

/return 

     |------------------------------------------
     |Maintaining self buffs
     |------------------------------------------
    
Sub MaintainSelfBuffs
/if (${Window[RespawnWnd].Open}) /call CheckEvents 
/if (${dobuff}==0) {
    /return
    }else{ /if (${dobuff}==1) {
               /if (!${Me.Buff[${selfbuff}].ID} && ${Spell[${selfbuff}].Stacks} && !${Me.Buff[${druidbuff}].ID} && !${Me.Buff[${druidbuffrkii}].ID} && !${Me.Buff[${druidbuffrkiii}].ID} && !${Me.Buff[${druidgrpbuff}].ID} && !${Me.Buff[${druidgrpbuffrkii}].ID} && !${Me.Buff[${druidgrpbuffrkiii}].ID} && !${Me.Buff[${shmfocus}].ID} && !${Me.Buff[${shmfocusrkii}].ID} && !${Me.Buff[${shmfocusrkiii}].ID} && !${Me.Buff[${shmgrpfocus}].ID} && !${Me.Buff[${shmgrpfocusrkii}].ID} && !${Me.Buff[${shmgrpfocusrkiii}].ID} && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                   /if (${Me.CurrentMana}<${Spell[${selfbuff}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${selfbuff}"
                          /if (${Verbose}) /1 *** buffing ${selfbuff}  *** 
                          /call Cast "${selfbuff}" gem5 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        }  
                }
                /if (!${Me.Buff[${shieldspell}].ID} && ${Spell[${shieldspell}].Stacks} && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) { 
                   /if (${Me.CurrentMana}<${Spell[${shieldspell}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${shieldspell}"
                          /if (${Verbose}) /1 *** buffing ${shieldspell}  *** 
                          /call Cast "${shieldspell}" gem5 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        }  
                }
                /if (!${Me.Buff[${spellhastebuff}].ID} && ${Spell[${spellhastebuff}].Stacks} && !${Me.Buff[Blessing of Devotion].ID} && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) { 
                   /if (${Me.CurrentMana}<${Spell[${spellhastebuff}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${spellhastebuff}"
                          /if (${Verbose}) /1 ***  buffing ${spellhastebuff}  ***
                          /call Cast "${spellhastebuff}" gem5 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        } 
                }
                /if (!${Me.Buff[${longhpbuff}].ID} && ${Spell[${longhpbuff}].Stacks} && !${Me.Buff[${singlelonghpbuff}].ID} && !${Me.Buff[${singlesmybuff}].ID} && !${Me.Buff[${groupsmybuff}].ID} && !${Me.Buff[${druidbuff}].ID} && !${Me.Buff[${druidbuffrkii}].ID} && !${Me.Buff[${druidbuffrkiii}].ID} && !${Me.Buff[${druidgrpbuff}].ID} && !${Me.Buff[${druidgrpbuffrkii}].ID} && !${Me.Buff[${druidgrpbuffrkiii}].ID} && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                   /if (${Me.CurrentMana}<${Spell[${longhpbuff}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${longhpbuff}"
                          /if (${Verbose}) /1 ***  buffing ${longhpbuff}  ***
                          /keypress F1
                          /call Cast "${longhpbuff}" gem9 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        }
                }  
                /if (!${Me.Buff[${groupsmybuff}].ID} && ${Spell[${groupsmybuff}].Stacks} && !${Me.Buff[${singlesmybuff}].ID} && !${Me.Buff[${singlelonghpbuff}].ID} && !${Me.Buff[${longhpbuff}].ID} && !${Me.Buff[Hand of Temerity].ID} && !${Me.Buff[Temerity].ID} && !${Me.Buff[Hand of Temerity Rk. II].ID} && !${Me.Buff[Temerity Rk. II].ID} && (${Me.Buff[${druidbuff}].ID} || ${Me.Buff[${druidbuffrkii}].ID} || ${Me.Buff[${druidbuffrkiii}].ID} || ${Me.Buff[${druidgrpbuff}].ID} || ${Me.Buff[${druidgrpbuffrkii}].ID} || ${Me.Buff[${druidgrpbuffrkiii}].ID}) && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                   /if (${Me.CurrentMana}<${Spell[${groupsmybuff}].Mana}) { 
                       /return
                   }else{ /echo Buffing Self 
                          /if (${Verbose}) /1 ***  buffing ${groupsmybuff}  ***
                          /call Cast "${groupsmybuff}" gem9 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                         } 
                }
                /if (!${Me.Song[${auraeffect}].ID} && ${autoaura} && !${NearestSpawn[1,npc radius ${distancetobuff}].LineOfSight}) { 
                   /if (${Me.CurrentMana}<${Spell[${auraspell}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${auraspell}"
                          /if (${Verbose}) /1 *** buffing ${auraspell}  *** 
                          /call Cast "${auraspell}" gem5 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        }  
                }
                /if (!${Me.Song[${auraeffectii}].ID} && ${autoauraii} && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) { 
                   /if (${Me.CurrentMana}<${Spell[${auraspellii}].Mana}) { 
                       /return
                   }else{ /echo Buffing "${auraspellii}"
                          /if (${Verbose}) /1 *** buffing ${auraspellii}  *** 
                          /call Cast "${auraspellii}" gem5 1s CheckForNPC
                          /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                              /varset medding 1
                              /echo Medding
                          }
                          /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
                        }  
                }
                /if (${FindItem[${SelfItemA}].ID} && ${Cast.Ready[${SelfItemA}]} && ${BuffItemA}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                    /if (!${Me.Buff[${SelfBuffA}].ID} && ${Spell[${SelfBuffA}].Stacks}) {
                        /if (${ExchangeA}) /exchange "${SelfItemA}" "${AExchange}"
                        /echo Buffing "${SelfItemA}"
                        /if (${Verbose}) /1 ***  buffing with "${SelfItemA}"  ***
                        /call Cast "${SelfItemA}" item 1s CheckForNPC
                        /if (${ExchangeA}) /exchange "${AReturn}" "${AExchange}"
                        /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                            /varset medding 1
                            /echo Medding
                        }
                        /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit   
                    }
                }
                /if (${FindItem[${SelfItemB}].ID} && ${Cast.Ready[${SelfItemB}]} && ${BuffItemB}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                    /if (!${Me.Buff[${SelfBuffB}].ID} && ${Spell[${SelfBuffB}].Stacks}) {
                        /if (${ExchangeB}) /exchange "${SelfItemB}" "${BExchange}"
                        /echo Buffing "${SelfItemB}" 
                        /if (${Verbose}) /1 ***  buffing with "${SelfItemB}"  ***
                        /call Cast "${SelfItemB}" item 1s CheckForNPC
                        /if (${ExchangeB}) /exchange "${BReturn}" "${BExchange}"
                        /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                            /varset medding 1
                            /echo Medding
                        }
                        /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit  
                    }
                }
                /if (${FindItem[${SelfItemC}].ID} && ${Cast.Ready[${SelfItemC}]} && ${BuffItemC}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                    /if (!${Me.Buff[${SelfBuffC}].ID} && ${Spell[${SelfBuffC}].Stacks}) {
                        /if (${ExchangeC}) /exchange "${SelfItemC}" "${CExchange}"
                        /echo Buffing "${SelfItemC}" 
                        /if (${Verbose}) /1 ***  buffing with "${SelfItemC}"  ***
                        /call Cast "${SelfItemC}" item 1s CheckForNPC
                        /if (${ExchangeC}) /exchange "${CReturn}" "${CExchange}"
                        /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                            /varset medding 1
                            /echo Medding
                        }
                        /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit  
                    }
                }
                /if (${FindItem[${SelfItemF}].ID} && ${Cast.Ready[${SelfItemF}]} && ${BuffItemF}==1 && !${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight}) {
                    /if (!${Me.Buff[${SelfBuffF}].ID} && ${Spell[${SelfBuffF}].Stacks}) {
                        /if (${ExchangeF}) /exchange "${SelfItemF}" "${FExchange}"
                        /echo Buffing "${SelfItemF}" 
                        /if (${Verbose}) /1 ***  buffing with "${SelfItemF}"  ***
                        /call Cast "${SelfItemF}" item 1s CheckForNPC
                        /if (${ExchangeF}) /exchange "${FReturn}" "${FExchange}"
                        /if (${medding}==0 && ${Me.PctMana}<${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
                            /varset medding 1
                            /echo Medding
                        }
                        /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit  
                    }
                }
            }
         }  
/return

Sub Healself
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
   /if (${Me.PctHPs}>${selfhealpoint}) /return
   /call GH
   :Healselfloop
   /if (${Me.PctHPs}<=${selfhealpoint}) {
       /if (${Me.PctHPs}<=${dacastpoint} && ${Me.SpellReady[${daspell}]} && ${Me.CurrentMana}>=${Spell[${daspell}].Mana}) { 
       :retryda
           /echo Attempting to use "${daspell}" 
           /call Cast "${daspell}" gem8 1s ChkEvent
           /if (${announce}==1 && (${Me.Buff[${daspell}].ID} || ${Me.Song[${daspell}].ID} || ${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID})) /g *** ${daspell} USED ***
           /if (${Me.Buff[${daspell}].ID} || ${Me.Song[${daspell}].ID} || ${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) /echo "${daspell}" USED 
           /delay 1 
           /if (!${Me.Buff[${daproc}].ID} && !${Me.Song[${daproc}].ID} &&!${Me.Buff[${daspell}].ID} && !${Me.Song[${daspell}].ID} && ${Me.SpellReady[${daspell}]}) /goto :retryda 
           /if (${trickyda}==1 && (${Me.Buff[${daspell}].ID} || ${Me.Song[${daspell}].ID} || ${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID})) /call TrickyDA 
       :dawait 
           /if (${Me.Buff[${daspell}].ID} || ${Me.Song[${daspell}].ID} || ${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) { 
               /delay 1s !${Me.Buff[${daspell}].ID}
               /delay 1s !${Me.Song[${daspell}].ID}
               /delay 1s !${Me.Buff[${daproc}].ID}
               /delay 1s !${Me.Song[${daproc}].ID} 
               /goto :dawait 
           }
           /goto :Healselfloop 
       }
       /if (${Me.PctHPs}<=${Math.Calc[${selfhealpoint}*0.85]} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana} && ${Me.SpellReady[${fastheal}]}) { 
           /target myself 
           /delay 6 ${Target.Name.Equal[${Me}]} 
           /if (${Target.Name.Equal[${Me}]} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana}) { 
               /if (${announce}==1) /g ${fastheal} on %T 
               /call Cast "${fastheal}" gem10 1s CheckMyHP 
               /delay 15 ${Me.SpellReady[${fastheal}]} 
           }
           /goto :Healselfloop 
       }
       /if (${Me.PctHPs}<=${selfhealpoint} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
           /target myself 
           /delay 6 ${Target.Name.Equal[${Me}]} 
           /if (${Target.Name.Equal[${Me}]} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
               /if (${announce}==1) /g Casting ${patchheal} on %T 
               /call Cast "${patchheal}" gem2 1s CheckMyHP 
               /delay 15 ${Me.SpellReady[${patchheal}]} 
           }
           /goto :Healselfloop             
       }
   } 
   /if (${spam}==1) {
       /target id ${SHTankID}
       /delay 15
   } 
/return

Sub GH
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
       :GHMain 
       /varset minorhurt 0 
       /varset majorhurt 0
       /for mshgmember 0 to ${Group} 
            /if (${Group.Member[${mshgmember}].PctHPs}<=${minorhurtpoint} && ${Group.Member[${mshgmember}].PctHPs}>=${majorhurtpoint} && ${Group.Member[${mshgmember}].Distance}<${darange}) /varcalc minorhurt ${minorhurt}+${minorhurtvalue} 
            /if (${Group.Member[${mshgmember}].PctHPs}<=${majorhurtpoint} && ${Group.Member[${mshgmember}].PctHPs}>=2 && ${Group.Member[${mshgmember}].Distance}<${darange}) /varcalc majorhurt ${majorhurt}+${majorhurtvalue} 
            /if (${Group.Member[${mshgmember}].PctHPs}<=${lostcausepcthp} || ${Group.Member[${mshgmember}].Type.Equal[Corpse]}) /varcalc majorhurt ${majorhurt}-1
       /next mshgmember
       /if (${Math.Calc[${majorhurt}+${minorhurt}]}>=${grouphurttotal}) { 
           /if (${FindItem[${ShieldDA}].ID} && ${Cast.Ready[${ShieldDA}]} && ${Group}>=${ghealcountmin} && ${usedivarb}==1) {
               /echo Using "${ShieldDA}"
               /if (${announce}==1) /g EPIC USED
               /call Cast "${ShieldDA}" item 1s ChkEvent
               /goto :GHMain
           }
           /if (${Me.AltAbilityReady[${aaarb}]} && ${Group}>=${ghealcountmin} && ${usedivarb}==1) {
               /echo Using "${aaarb}"
               /if (${announce}==1) /g ${aaarb} USED
               /call cast "${aaarb}" alt 1s ChkEvent
               /goto :GHMain
           } 
           /if (${Me.PctMana}>=${grouphealmana} && ${Group}>=${ghealcountmin} && ${usegroupheal}==1) {
               /echo Casting "${groupheal}"
               /if (${announce}==1) /g Inc Grp Heal, get close 
               /call Cast "${groupheal}" 1s ChkEvent
               /goto :GHMain
           } else /if (${Me.AltAbilityReady[${aacr}]} && ${Me.PctMana}<${grouphealmana} && ${Group}>=${ghealcountmin} && ${usegroupheal}==1 && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {
               /echo Using "${aacr}"
               /if (${announce}==1) /g ${aacr} INC
               /call cast "${aacr}" alt 1s ChkEvent
           }    
       }
       /if (${Bool[${Me.Standing}]} && ${medding}==1 && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
/return 

Sub AutoCures
   /if (${Window[RespawnWnd].Open}) /call CheckEvents
   /if (${autocure} && ${Me.AltAbilityReady[${aacure}]} && ${Debuff.Detrimentals}) {
       /echo Using "${aacure}"
       /if (${announce}) /g ${aacure} INC 
       /call cast "${aacure}" alt 1s ChkCure
   } else /if (${FindItem[${ShieldDA}].ID} && ${Cast.Ready[${ShieldDA}]} && !${Me.AltAbilityReady[${aacure}]} && ${Debuff.Detrimentals} && ${autocure}) {
              /echo Using "${ShieldDA}"
              /if (${announce}) /g EPIC USED
              /call Cast "${ShieldDA}" item 1s ChkCure
          }
/return

Sub Healgroup
   /if (${Window[RespawnWnd].Open}) /call CheckEvents
   /call GH 
   :healgroup 
   /varset worsthurt NULL 
   /varset worsthp 100 
   /varset worstclass NULL 
   /for gmember 0 to ${Group} 
   /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 (${Group.Member[${gmember}].Class.Name.Equal[Monk]} || ${Group.Member[${gmember}].Class.Name.Equal[Necromancer]} || ${Group.Member[${gmember}].Class.Name.Equal[Shadow Knight]}) /if (${Group.Member[${gmember}].Distance}>=${fdhealrange} && ${Group.Member[${gmember}].Distance}<=${fdhealmaxrange}) { 
       /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} 
       } 
   } 
   /next gmember
   /if (${autohealmode}==3) { 
       /if (!${Target.ID} || ${Target.Name.NotEqual[${tankname}]}) {
           /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].Type.NotEqual[Corpse]} && ${Spawn[${tanknameid}].PctHPs}<=${healpct} && ${Spawn[${tanknameid}].Distance}<=${healspellrange}) { 
               /if (${NearestSpawn[NPC].Distance}<=${distancetobuff} || ${Spawn[${tanknameid}].PctHPs}<=${healpct}) /target id ${tanknameid} 
               /delay 6 ${Target.ID}==${tanknameid} 
               /delay 1 
               /if (${Target.ID}==${tanknameid} && ${Target.Type.NotEqual[Corpse]} && ${Target.PctHPs}<=${healpct} && ${Target.Distance}<=${healspellrange}) /return 
           } 
           /if (${Me.PctHPs}<=${selfhealpoint}) /return 
       }
   }
   /if (${worsthurtid}==${tanknameid}) /return 
   /if (${worsthurtid}==${Me.ID}) { 
       /call Healself 
       /return 
   }
   /if (${worstclass.Equal[Warrior]} || ${worstclass.Equal[Paladin]}) { 
       /if (${worsthp}<=${Math.Calc[0.78*${tankhealpoint}]}) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid}
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${fastheal} on %T 
               /call Cast "${fastheal}" gem10 1s CheckOfftankHP 
               /delay 15 ${Me.SpellReady[${fastheal}]} 
           } 
       } 
       /if (${worsthp}<=${tankhealpoint}) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid}
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${patchheal} on %T 
               /call Cast "${patchheal}" gem2 1s CheckOfftankHP 
               /delay 15 ${Me.SpellReady[${patchheal}]} 
           } 
       }
   }
   /if (${worstclass.Equal[Beastlord]} || ${worstclass.Equal[Rogue]} || ${worstclass.Equal[Berserker]} || ${worstclass.Equal[Ranger]}) {
       /if (${worsthp}<=${Math.Calc[0.78*${meleepatchpoint}]}) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${fastheal} on %T 
               /call Cast "${fastheal}" gem10 1s CheckMeleeHP 
               /delay 15 ${Me.SpellReady[${fastheal}]} 
           }
       } 
       /if (${worsthp}<=${meleepatchpoint}) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${patchheal} on %T 
               /call Cast "${patchheal}" gem2 1s CheckMeleeHP 
               /delay 15 ${Me.SpellReady[${patchheal}]} 
           }
       }
   } 
   /if (${worstclass.Equal[Magician]} || ${worstclass.Equal[Wizard]} || ${worstclass.Equal[Enchanter]} || ${worstclass.Equal[Druid]} || ${worstclass.Equal[Cleric]}) { 
       /if (${worsthp}<=${casterhotpoint} && ${worsthp}>${casterpatchpoint}) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${hotspellrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid}
           /if (${nohotforua}==${worsthurtid} || ${nohotforub}==${worsthurtid} || ${nohotforuc}==${worsthurtid} || ${nohotforud}==${worsthurtid}) /goto :nohotforu 
           /if (${nohotforua}==0) { 
               /delay 5 
               /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${hotspell}].Mana}) { 
                   /if (!${Target.ID}) /return 
                   /if (${Target.ID}!=${worsthurtid}) /return 
                   /varset nohotforua ${Target.ID} 
                   /if (${announce}==1) /g ${hotspell} on %T 
                   /call Cast "${hotspell}" gem3 1s CheckCasterHP 
                   /timed 1000 /varset nohotforua 0 
                   /delay 15 ${Me.SpellReady[${hotspell}]}
               }
           } else /if (${nohotforub}==0) { 
                      /delay 5 
                      /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${hotspell}].Mana}) { 
                          /if (!${Target.ID}) /return 
                          /if (${Target.ID}!=${worsthurtid}) /return 
                          /varset nohotforub ${Target.ID} 
                          /if (${announce}==1) /g ${hotspell} on %T 
                          /call Cast "${hotspell}" gem3 1s CheckCasterHP 
                          /timed 1000 /varset nohotforub 0 
                          /delay 15 ${Me.SpellReady[${hotspell}]} 
                      }
           } else /if (${nohotforuc}==0) { 
                      /delay 5 
                      /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${hotspell}].Mana})  { 
                          /if (!${Target.ID}) /return 
                          /if (${Target.ID}!=${worsthurtid}) /return 
                          /varset nohotforuc ${Target.ID} 
                          /if (${announce}==1) /g ${hotspell} on %T 
                          /call Cast "${hotspell}" gem3 1s CheckCasterHP 
                          /timed 1000 /varset nohotforuc 0 
                          /delay 15 ${Me.SpellReady[${hotspell}]}
                      } 
           } else /if (${nohotforud}==0) { 
                      /delay 5 
                      /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${hotspell}].Mana}) { 
                          /if (!${Target.ID}) /return 
                          /if (${Target.ID}!=${worsthurtid}) /return 
                          /varset nohotforud ${Target.ID} 
                          /if (${announce}==1) /g ${hotspell} on %T 
                          /call Cast "${hotspell}" gem3 1s CheckCasterHP 
                          /timed 1000 /varset nohotforud 0 
                          /delay 15 ${Me.SpellReady[${hotspell}]} 
                      }
           } 
           :nohotforu
       } else /if (${worsthp}<${casterpatchpoint} && ${worsthp}>=1) { 
                  /if (${Spawn[${worsthurtid}].Distance}<=${fasthealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
                  /delay 5 
                  /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana}) { 
                      /if (!${Target.ID}) /return 
                      /if (${Target.ID}!=${worsthurtid}) /return 
                      /if (${announce}==1) /g ${fastheal} on %T 
                      /call Cast "${fastheal}" gem10 1s CheckCasterHP 
                      /delay 15 ${Me.SpellReady[${fastheal}]} 
                  }
       }
   }
   /if (${worstclass.Equal[Bard]} || ${worstclass.Equal[Necromancer]} || ${worstclass.Equal[Monk]} || ${worstclass.Equal[Shadow Knight]}) { 
       /if (${worsthp}<=${Math.Calc[0.78*${pullerpatchpoint}]} && ${worsthp}>=1) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${fdhealrange}) {
               /if (${Spawn[${worsthurtid}].Type.NotEqual[Corpse]} && ${Target.PctHPs}>=${lostcausepcthp}) /target id ${worsthurtid} 
               /delay 5 
               /if (${Target.ID}!=${worsthurtid}) /return
               /if (${Target.ID}==${worsthurtid} && ${Target.Distance}<=${fdhealrange} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana} && ${Me.SpellReady[${fastheal}]}) { 
                   /if (!${Target.ID}) /return 
                   /if (${Target.ID}!=${worsthurtid}) /return 
                   /if (${announce}==1) /g ${fastheal} on %T 
                   /call Cast "${fastheal}" gem10 1s CheckMeleeHP 
                   /delay 15 ${Me.SpellReady[${fastheal}]} 
               }
           }
           /if (${Spawn[${worsthurtid}].Distance}<=${fdhealmaxrange} && ${Spawn[${worsthurtid}].Distance}>=${fdhealrange} && ${onlyhealfd}==1) {
               /if (${Spawn[${worsthurtid}].State.Equal[feign]} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid}
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${Target.ID}==${worsthurtid} && ${Target.Distance}>${fdhealrange} && ${Target.Distance}<=${fdhealmaxrange} && ${Target.State.Equal[feign]} && ${Target.PctHPs}>=${lostcausepcthp} && ${usedivarb}==1 && ${Me.AltAbilityReady[${aaarb}]}) {
                   /if (${announce}==1) /g ${aaarb} USED 
                   /call cast "${aaarb}" alt 1s CheckFDHP
               }
               /if (${Target.ID}==${worsthurtid} && ${Target.Distance}>${fdhealrange} && ${Target.Distance}<=${fdhealmaxrange} && ${Target.State.Equal[feign]} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana} && ${Me.SpellReady[${fastheal}]}) { 
                   /if (!${Target.ID}) /return 
                   /if (${Target.ID}!=${worsthurtid}) /return 
                   /if (${announce}==1) /g ${fastheal} on %T ... Stay FD Pls
                   /call Cast "${fastheal}" gem10 1s CheckFDHP 
                   /delay 15 ${Me.SpellReady[${fastheal}]} 
               }
           } 
       } 
       /if (${worsthp}<=${pullerpatchpoint} && ${worsthp}>=1) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${fdhealrange}) {
               /if (${Spawn[${worsthurtid}].Type.NotEqual[Corpse]} && ${Target.PctHPs}>=${lostcausepcthp}) /target id ${worsthurtid} 
               /delay 5
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${Target.ID}==${worsthurtid} && ${NearestSpawn[${Target} radius ${fdhealrange}].LineOfSight} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
                   /if (!${Target.ID}) /return 
                   /if (${Target.ID}!=${worsthurtid}) /return 
                   /if (${announce}==1) /g ${patchheal} on %T 
                   /call Cast "${patchheal}" gem2 1s CheckMeleeHP 
                   /delay 15 ${Me.SpellReady[${patchheal}]} 
               }
           }
           /if (${Spawn[${worsthurtid}].Distance}<=${fdhealmaxrange} && ${Spawn[${worsthurtid}].Distance}>=${fdhealrange} && ${onlyhealfd}==1) {
               /if (${Spawn[${worsthurtid}].State.Equal[feign]} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
               /if (${Target.ID}!=${worsthurtid}) /return
               /if (${Target.ID}==${worsthurtid} && ${Target.Distance}>${fdhealrange} && ${Target.Distance}<=${fdhealmaxrange} && ${Target.State.Equal[feign]} && ${Target.PctHPs}>=${lostcausepcthp} && ${usedivarb}==1 && ${Me.AltAbilityReady[${aaarb}]}) {
                   /if (${announce}==1) /g ${aaarb} USED 
                   /call cast "${aaarb}" alt 1s CheckFDHP
               }
               /if (${Target.ID}==${worsthurtid} && ${Target.Distance}>${fdhealrange} && ${Target.Distance}<=${fdhealmaxrange} && ${Target.State.Equal[feign]} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana} && ${Me.SpellReady[${fastheal}]}) { 
                   /if (!${Target.ID}) /return 
                   /if (${Target.ID}!=${worsthurtid}) /return 
                   /if (${announce}==1) /g ${patchheal} on %T ... Stay FD Pls
                   /call Cast "${patchheal}" gem2 1s CheckFDHP 
                   /delay 15 ${Me.SpellReady[${patchheal}]} 
               }
           } 
       }
   }
   /if (${worstclass.Equal[Shaman]}) { 
       /if (${worsthp}<=${Math.Calc[0.78*${shamanpatchpoint}]} && ${worsthp}>=1) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${fastheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${fastheal} on %T *
               /call Cast "${fastheal}" gem10 1s CheckCasterHP 
               /delay 15 ${Me.SpellReady[${fastheal}]} 
           }
       } 
       /if (${worsthp}<=${shamanpatchpoint} && ${worsthp}>=1) { 
           /if (${Spawn[${worsthurtid}].Distance}<=${patchhealrange} && ${Spawn[${worsthurtid}].Type.NotEqual[Corpse]}) /target id ${worsthurtid} 
           /delay 5 
           /if (${Target.ID}==${worsthurtid} && ${Target.PctHPs}>=${lostcausepcthp} && ${Me.CurrentMana}>=${Spell[${patchheal}].Mana}) { 
               /if (!${Target.ID}) /return 
               /if (${Target.ID}!=${worsthurtid}) /return 
               /if (${announce}==1) /g ${patchheal} on %T *
               /call Cast "${patchheal}" gem2 1s CheckCasterHP 
               /delay 15 ${Me.SpellReady[${patchheal}]} 
           }
       }
   }
   /if (${majorhurt}<=0 && ${minorhurt}==0) {
       /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].Distance}<=${healspellrange} && (${NearestSpawn[1,npc radius ${distancetobuff} zradius ${Vertical}].LineOfSight} || ${Spawn[${tanknameid}].PctHPs}<=${healpct}) && ${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) { 
           /target id ${tanknameid} 
           /delay 6 ${Target.ID}==${tanknameid} 
           /delay 1 
       } 
       /if (${Spawn[${tanknameid}].PctHPs}>${healpct} || ${Spawn[${tanknameid}].Distance}>${healspellrange} || ${Spawn[${tanknameid}].PctHPs}<=${lostcausepcthp} || !${Target.ID} || !${Spawn[${tanknameid}].ID} || ${Target.ID}!=${Spawn[${tanknameid}].ID}) { 
           /if (${Me.PctMana}<=${manamanage}) /call MedTime 
       } 
   }  
   /if (${healpetmode}>0 && ${Me.PctMana}>${manatohealpet} && ${Spawn[${tanknameid}].PctHPs}>${healpct}) /call HealPet 
/return 

Sub HealPet
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
   /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} && ${Me.CurrentMana}>=${Spell[${pethealspell}].Mana}) { 
           /if (${announce}==1) /g ${pethealspell} on %T 
           /call Cast "${pethealspell}" spell 1s CheckCasterHP 
           /delay 15 ${Me.SpellReady[${pethealspell}]} 
       } 
   } 
/return 

Sub CheckTankHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   } 
   /if (!${Window[CastingWindow].Open}) /return
   /if (${Me.Casting.ID}==13) {
       /if (${ching}==0 && ${autointerrupt}==1 && ${Spawn[${tanknameid}].PctHPs}>${Math.Calc[5+${healpct}]}) /call interrupt
       /if (${ching}==1) {
           /delay 50
           /if (${autointerrupt}==1 && ${Spawn[${tanknameid}].PctHPs}>${Math.Calc[5+${healpct}]}) /call interrupt
           /varset ching 0
       }
       /return
   } else /if (${ching}==1) {
              /delay 20 
              /if (${autointerrupt}==1 && ${Spawn[${tanknameid}].PctHPs}>${Math.Calc[5+${healpct}]}) /call Interrupt 
              /varset ching 0
   }
/return

Sub CheckTankHPFast
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   } 
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Spawn[${tanknameid}].PctHPs}>${Math.Calc[5+${healpct}]}) { 
        /call Interrupt 
   }
/return

Sub CheckMyHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Me.PctHPs}>${Math.Calc[5+${selfhealpoint}]}) { 
       /call Interrupt 
   }
/return

Sub CheckOfftankHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   } 
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Spawn[${worsthurtid}].PctHPs}>${Math.Calc[5+${tankhealpoint}]}) { 
       /call Interrupt 
   }
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub CheckFDHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${onlyhealfd}==1) { 
       /if (${Spawn[${worsthurtid}].State.NotEqual[feign]} || ${Spawn[${worsthurtid}].PctHPs}>${Math.Calc[5+${pullerpatchpoint}]}) { 
           /if (${Announce}) /g Gah ... almost healed you %T ... thought you were FD 
           /call Interrupt
       } 
   }
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   } 
/return 

Sub CheckMeleeHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   } 
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Spawn[${worsthurtid}].PctHPs}>${Math.Calc[5+${meleepatchpoint}]}) {
       /call Interrupt
   } 
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub CheckCasterHP
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   } 
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Spawn[${worsthurtid}].PctHPs}>${Math.Calc[5+${casterhotpoint}]}) { 
       /call Interrupt 
   }
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub CheckValidHeal 
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${Target.PctHPs}>${validheal}) {
       /call Interrupt
   } 
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub CheckForNPC
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) {  
       /call Interrupt
       /call Healgroup 
   }
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub ChkCure
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${autointerrupt}==1 && !${Debuff.Detrimentals}) { 
       /call Interrupt 
   }
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return 

Sub ChkEvent
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /if (${interrupt2healself}==1 && ${Me.PctHPs}<${interrupt2healselfhp}) { 
       /call Interrupt
       /call Healself 
   }
/return

Sub ChkSH 
   /if (${Window[RespawnWnd].Open}) {
       /call Interrupt
       /call CheckEvents
   }
   /if (${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) {
       /call Interrupt
       /call TrickyDA
   }
   /if (!${Window[CastingWindow].Open}) /return
   /delay 20
   /if (${Target.PctHPs}>=${SHInterrupt}) { 
       /call Interrupt 
   }
/return

Sub MedTime 
   :oomwait 
   /call CheckEvents 
   /If (${FindItem[${modroda}].ID} && ${Cast.Ready[${modroda}]} && ${Bool[${Me.Standing}]} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctMana}<=${modrodmana} && ${Me.PctHPs}>=${modrodhp}) { 
       /echo Using "${modroda}"
       /exchange "${modroda}" "mainhand"
       /call Cast "${modroda}" item
       /exchange "${Primary}" "mainhand"
       /if (${Bool[${Me.Standing}]} && ${medding} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit 
   } 
   /If (${FindItem[${modrodb}].ID} && ${Cast.Ready[${modrodb}]} && ${Bool[${Me.Standing}]} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctMana}<=${modrodmana} && ${Me.PctHPs}>=${modrodhp} && ${rodwait}==0) { 
       /echo Using "${modrodb}"
       /exchange "${modrodb}" "mainhand"
       /call Cast "${modrodb}" item 
       /exchange "${Primary}" "mainhand"
       /if (${Bool[${Me.Standing}]} && ${medding} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit 
   } 
   /If (${FindItem[${modrodc}].ID} && ${Cast.Ready[${modrodc}]} && ${Bool[${Me.Standing}]} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctMana}<=${modrodmana} && ${Me.PctHPs}>=${modrodhp} && ${rodwait}==0) { 
       /echo Using "${modrodc}"
       /exchange "${modrodc}" "mainhand"
       /call Cast "${modrodc}" item 
       /exchange "${Primary}" "mainhand" 
       /if (${Bool[${Me.Standing}]} && ${medding} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
   }  
   /if (${autosit}==1 && ${Me.PctMana}<=${manamanage} && !${Me.Buff[${MountBuff}].ID} && !${Me.Casting.ID}) {
       /if (${Bool[${Me.Standing}]} && !${Me.Moving} && ${Me.PctMana}<=${sitmana} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctHPs}>${hpmanage} && ${medding}==1) { 
           /varset medding 0
           /echo Medding FALSE .... Mob Proxy Reset *
       } 
       /if (${Bool[${Me.Standing}]} && ${Me.PctMana}<=${sitmana} && !${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${Me.PctHPs}>${hpmanage} && ${medding}==0) { 
           /sit
           /varset medding 1
           /echo Medding: TRUE *
       }
   }
   /if (${autosit}==1 && ${Bool[${Me.Sitting}]} && !${Window[SpellBookWnd].Open} && ${NearestSpawn[1,npc radius ${distancetosit} zradius ${Vertical}].LineOfSight} && ${medding}==1) { 
       /stand
       /varset medding 0
       /echo Medding: FALSE ... Mob too close *
   } 
   /if (${Bool[${Me.Sitting}]} && ${autosit}==1 && !${Me.Buff[${MountBuff}].ID} && ${Me.PctMana}>${manamanage} && ${medding}==1) {
       /stand
       /varset medding 0
       /echo Medding: FALSE ... Mana GTG *
   }
   /if (${Bool[${Me.Sitting}]} && ${autosit}==1 && !${Me.Buff[${MountBuff}].ID} && ${Me.PctHPs}<${hpmanage} && ${medding}==1) {
       /stand
       /varset medding 0
       /echo Medding: FALSE ... HP too low *
   } 
   /if (${Bool[${Me.Standing}]} && !${Me.Mount.ID} && ${Me.SpellReady[${yaulpspell}]} && !${Me.Buff[${yaulpspell}].ID} && ${Spell[${yaulpspell}].Stacks}) /call Cast "${yaulpspell}" 
   /if (${buffbeg}==1) /call Buffbeg 
   /if (${Me.PctHPs}<=${selfhealpoint}) /call healself 
   /if (${Me.PctMana}<=8) /goto :oomwait 
/return

Sub TrickyDA 
   /if (${Window[RespawnWnd].Open}) /call CheckEvents
   /if (${Me.PctHPs}<40 && ${Me.Buff[${singlelonghpbuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${singlelonghpbuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${longhpbuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${longhpbuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmfocus}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmfocus}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmfocusrkii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmfocusrkii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmfocusrkiii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmfocusrkiii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmgrpfocus}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmgrpfocus}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmgrpfocusrkii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmgrpfocusrkii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${shmgrpfocusrkiii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${shmgrpfocusrkiii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidbuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidbuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidbuffrkii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidbuffrkii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidbuffrkiii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidbuffrkiii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidgrpbuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidgrpbuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidgrpbuffrkii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidgrpbuffrkii}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${druidgrpbuffrkiii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${druidgrpbuffrkiii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${groupsmybuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${groupsmybuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${singlesmybuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${singlesmybuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${pallybuff}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${pallybuff}].ID}-1].Int} leftmouseup 
   /if (${Me.PctHPs}<40 && ${Me.Buff[${pallybuffrkii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${pallybuffrkii}].ID}-1].Int} leftmouseup
   /if (${Me.PctHPs}<40 && ${Me.Buff[${pallybuffrkiii}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${pallybuffrkiii}].ID}-1].Int} leftmouseup
   /if (${Me.Buff[${daspell}].ID} || ${Me.Song[${daspell}].ID} || ${Me.Buff[${daproc}].ID} || ${Me.Song[${daproc}].ID}) { 
       :waitalittle 
       /delay 1s ${Me.Buff[${daspell}].Duration}<2
       /delay 1s ${Me.Song[${daspell}].Duration}<2
       /delay 1s ${Me.Buff[${daproc}].Duration}<2
       /delay 1s ${Me.Song[${daproc}].Duration}<2 
       /if (${Me.Buff[${daspell}].Duration}>=2 || ${Me.Song[${daspell}].Duration}>=2 || ${Me.Buff[${daproc}].Duration}>=2 || ${Me.Song[${daproc}].Duration}>=2) /goto :waitalittle 
   } 
   /if (${buffbeg}==1) /call Buffbeg
/return 

Sub Buffbeg
   /if (${Window[RespawnWnd].Open}) /call CheckEvents 
   /if (${buffbeg}==0) /return 
   /echo Begging for buffs now 
   /if (!${Me.Buff[${druidbuff}].ID} && !${Me.Buff[${druidbuffrkii}].ID} && !${Me.Buff[${druidbuffrkiii}].ID} && !${Me.Buff[${druidgrpbuff}].ID} && !${Me.Buff[${druidgrpbuffrkii}].ID} && !${Me.Buff[${druidgrpbuffrkiii}].ID} && !${Me.Buff[${singlelonghpbuff}].ID} && !${Me.Buff[${longhpbuff}].ID}) { 
       /if (${NearestSpawn[PC guild druid].Name.NotEqual[NULL]}) /if (${NearestSpawn[PC guild druid].Distance}<=100) { 
           /tell ${NearestSpawn[PC guild druid]} skin
           /delay 5
           /tell ${NearestSpawn[PC guild druid]} plz
           /delay 20 
           /if (${Me.Song[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Song[${daspell}].ID}-1].Int} leftmouseup 
       } else /echo No guild Druid available for skin 
   } 
   /if (!${Me.Buff[${daspell}].ID} && ${Me.PctHPs}<=75) /call Healself 
   /if (!${Me.Buff[${shmfocus}].ID} && !${Me.Buff[${shmfocusrkii}].ID} && !${Me.Buff[${shmfocusrkiii}].ID} && !${Me.Buff[${shmgrpfocus}].ID} && !${Me.Buff[${shmgrpfocusrkii}].ID} && !${Me.Buff[${shmgrpfocusrkiii}].ID}) { 
       /if (${NearestSpawn[PC guild shaman].Name.NotEqual[NULL]}) /if (${NearestSpawn[PC guild shaman].Distance}<=100) { 
           /tell ${NearestSpawn[PC guild shaman]} focus
           /delay 5
           /tell ${NearestSpawn[PC guild shaman]} plz 
           /delay 20 
           /if (${Me.Song[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Song[${daspell}].ID}-1].Int} leftmouseup 
       } else /echo No guild Shaman available for Focus 
   } 
   /if (!${Me.Buff[${daspell}].ID} && ${Me.PctHPs}<=75) /call Healself 
   /if (!${Me.Buff[${pallybuff}].ID} && !${Me.Buff[${pallybuffrkii}].ID} && !${Me.Buff[${pallybuffrkiii}].ID} && !${Me.Buff[${beastcrack}].ID} && !${Me.Buff[${beastcrackrkii}].ID} && !${Me.Buff[${beastcrackrkiii}].ID}) { 
       /if (${NearestSpawn[PC guild paladin].Name.NotEqual[NULL]}) /if (${NearestSpawn[PC guild paladin].Distance}<=100) { 
           /tell ${NearestSpawn[PC guild paladin]} Brells plz 
           /delay 20 
           /if (${Me.Song[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Song[${daspell}].ID}-1].Int} leftmouseup 
       } else /echo No guild Paladin available for Brells 
   } 
   /if (!${Me.Buff[${daspell}].ID} && ${Me.PctHPs}<=75) /call Healself 
   /if (!${Me.Buff[${chantercrack}].ID} && !${Me.Buff[${chantercrackrkii}].ID} && !${Me.Buff[${chantercrackrkiii}].ID}) { 
       /if (${NearestSpawn[PC guild enchanter].Name.NotEqual[NULL]}) /if (${NearestSpawn[PC guild enchanter].Distance}<=100) { 
           /tell ${NearestSpawn[PC guild enchanter]} mind buff plz 
           /delay 20 
           /if (${Me.Song[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Song[${daspell}].ID}-1].Int} leftmouseup 
       } else /echo No guild Enchanter available for C5 
   } 
   /if (!${Me.Buff[${daspell}].ID} && ${Me.PctHPs}<=75) /call Healself 
   /if (!${Me.Buff[${beastcrack}].ID} && !${Me.Buff[${beastcrackrkii}].ID} && !${Me.Buff[${beastcrackrkiii}].ID}) { 
       /if (${NearestSpawn[PC guild beastlord].Name.NotEqual[NULL]}) /if (${NearestSpawn[PC guild beastlord].Distance}<=100) { 
           /tell ${NearestSpawn[PC guild beastlord]} beast crack plz 
           /if (${Me.Song[${daspell}].ID}) /notify BuffWindow Buff${Math.Calc[${Me.Song[${daspell}].ID}-1].Int} leftmouseup 
       } else /echo No guild Beastlord available for crack 
   } 
/return

Sub Hpartner
   /if (${Window[RespawnWnd].Open}) /call CheckEvents
   /if (${acheals}==1 && ${Spell[${healspell}].ID}==${Spell[${bpatchheal}].ID} && ${Spawn[${healpartner}].ID} && ${Me.PctMana}<=${autochangeover}) {
       /tell ${healpartner} Change to fast heals
       /varset patchheal ${bpatchheal}
       /varset healspell ${bhealspell}
       /delay 15
       /echo Primary Heal: "${healspell}"
       /varset acheals 0
       /timed 1000 /varset acheals 1
       /varset healpct ${bhealpct}
       /if (${Verbose}) /1 Healing ${tankname} at ${healpct}
       /echo Healing ${tankname} at ${healpct}
   }
/return

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

Sub Event_Invited 
   /invite 
/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}) { 
      /echo ${Sender} is not in the zone 
      /return 
   }
   /if (${ChatText.Equal[Spam]} || ${ChatText.Equal[Spam heal]}) {
       /call FindExactPC ${Sender} 
       /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /assist ${Sender}
       /delay 5
       /if (${Target.Type.Equal[NPC]}) {
           /echo Aborting Spam Healing ... target type INVALID  *** NPC ***
           /return
       } else /if (${Target.Type.Equal[PC]}) {
           /varset SHTank ${Target}
           /varset SHTankID ${Target.ID}
           /varset SHCount 0
           /varset spam 1
           /echo Target Type Validation Confirmed *** PC ***
           /echo Spam Healing *** ${SHTank} ***
       }
       :SHLoop
       /if (${Target.Name.NotEqual[${SHTank}]} || !${Target.ID} || ${Target.Type.Equal[Corpse]} || ${NearestSpawn[NPC].Distance}>=${shquitrange} || ${Target.Distance}>${spamhealrange}) {
           /echo Aborting Spam Healing
           /varset SHTank NULL
           /varset SHTankID 0
           /varset spam 0 
           /return
       }
       /if (${Target.Distance}<=${spamhealrange} && ${Target.Type.NotEqual[Corpse]} && ${Me.CurrentMana}>=${Spell[${shhealspell}].Mana}) { 
           /if (${announce}==1) /g ${shhealspell} *** %T ***
           /if (${verbose}==1) /1 ${shhealspell} on %t 
           /call Cast "${shhealspell}" gem2 1s ChkSH 
           /if (${FindItem[${SelfItemD}].ID} && ${Cast.Ready[${SelfItemD}]} && ${BuffItemD}==1) {
               /if (${Target.ID}==${SHTankID} && ${ExchangeD}) /exchange "${SelfItemD}" "${DExchange}"
               /if (${Target.ID}==${SHTankID}) /echo Using "${SelfItemD}" 
               /if (${Target.ID}==${SHTankID} && ${Verbose}) /1 *** "${SelfBuffD}" on %t ***
               /if (${Target.ID}==${SHTankID}) /call Cast "${SelfItemD}" item 1s ChkEvent
               /if (${Target.ID}==${SHTankID} && ${ExchangeD}) /exchange "${DReturn}" "${DExchange}"   
           }
           /varcalc SHCount ${SHCount}+1
           /if (${autocure}==1 && ${Debuff.Detrimentals} && !${Me.Buff[${SpellRezEffect}].ID} && ${SHCount}>=${SHCountMax}) /call autocures
           /if (${Me.PctHPs}<=${selfhealpoint}) /call Healself
           /if (${Me.PctHPs}>${selfhealpoint} && ${Me.PctMana}<=${manamanage} && !${Me.Buff[${yaulpspell}].ID}) /call MedTime 
           /if (${SHCount}>=${SHCountMax} && ${Group}>0) {
               /call GH
               /varset SHCount 0
           }
           /if (${SHCount}>=${SHCountMax} && ${Group}==0) /varset SHCount 0
           /call CheckEvents
           /goto :SHLoop 
       } else /if (${Me.CurrentMana}<${Spell[${shhealspell}].Mana} && ${Me.PctMana}<=${manamanage}) /call MedTime
       /goto :SHLoop
       /return
   }
   /if (${ChatText.Equal[Stop Spam]} || ${ChatText.Equal[Hold Spam]}) {
       /call FindExactPC ${Sender} 
       /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /varset SHTank NULL
       /varset SHTankID 0
       /varset spam 0
       /keypress esc
       /return
   } 
   /if (${ChatText.Equal[Follow]}) {
       /call FindExactPC ${Sender} 
       /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
       /if (${Target.Type.Equal[PC]} && ${Target.Distance}<=${followrange}) { 
           /delay 5 
           /if (!${Spawn[${Sender}].ID}) { 
               /echo ${Sender} is not in zone for me to follow! 
               /return 
           } 
           /varset follname ${Sender} 
           /varset following 1
           /if (${Me.Buff[${MountBuff}].ID}) /dismount
           /if (${Bool[${Me.Sitting}]}) /stand
    :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}>${followmax}) /keypress forward hold 
           /if (${Target.Distance}<${followmin}) /keypress back 
           /if (!${Target.ID}) /varset following 0 
           /call CheckEvents 
           /if ((${Target.Name.Equal[${follname}]})&&(${following}>0)) { 
               /goto :Loop 
           } else { 
           /keypress forward 
           /keypress back
           } 
      }
   /return 
   } 
   /if (${ChatText.Equal[Stop]}) {
       /if (${following}==1 && ${Target.Name.Equal[${Sender}]} && ${Target.Distance}<=${stoprange}) { 
           /varset following 0 
           /keypress forward 
           /keypress back 
           /timed 50 /face pc ${follname}
       }
       /if (${Bool[${Me.Standing}]} && ${medding} && !${NearestSpawn[1,NPC radius ${distancetosit} zradius ${Vertical}].LineOfSight}) /sit
   /return  
   }
   |-------------------------------------------------------------
   |Veteran's Rewards
   |-------------------------------------------------------------
   /if (${ChatText.Equal[Turn on Lesson]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /if (${Verbose}) /1 Good idea ... turning lesson on 
       /delay 5
       /aa act Lesson of the Devoted
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
       /return 
   }
   /if (${ChatText.Equal[Turn on Jester]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /if (${Verbose}) /1 *** INC Jester *** 
       /delay 5
       /aa act Chaotic Jester
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
       /return 
   }
   /if (${ChatText.Equal[Turn on Servant]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /if (${Verbose}) /1 *** INC Servant *** 
       /delay 5
       /aa act Steadfast Servant
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
       /return 
   }
   |-------------------------------------------------------------
   |Buff Requests for others - single or groups
   |-------------------------------------------------------------

   /if (${ChatText.Equal[Give em virtue]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${virtuebuff} on %t  *** 
      /call Cast "${virtuebuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give em conv]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
      /call Cast "${singlelonghpbuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give them conv]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${longhpbuff} on %t  *** 
      /call Cast "${longhpbuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give em Tem]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
      /call Cast "${singlelonghpbuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give them tem]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${longhpbuff} on %t  *** 
      /call Cast "${longhpbuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[mgb tem]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Me.AltAbilityReady[${aamgb}]}) { 
          /call cast "${aamgb}" alt  
          /if (${Verbose}) /1 *** ${aamgb} ${longhpbuff} is incomming !!! ***
          /delay 15
          /call cast "${longhpbuff}" gem9 30s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      } else /if (${Verbose}) /1 *** ${aamgb} not ready *** 
      /return 
   }  
   /if (${ChatText.Equal[Give em sym]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${singlesmybuff} on %t  *** 
      /call Cast "${singlesmybuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   } 
   /if (${ChatText.Equal[Give them sym]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${groupsmybuff} on %t  *** 
      /call Cast "${groupsmybuff}" gem9 10s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[mgb sym]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Me.AltAbilityReady[${aamgb}]}) { 
          /call cast "${aamgb}" alt  
          /if (${Verbose}) /1 *** ${aamgb} ${groupsmybuff} is incomming !!! ***
          /call cast "${groupsmybuff}" gem9 30s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      } else /if (${Verbose}) /1 *** ${aamgb} not ready ***
      /delay 15
      /return 
   }  
   /if (${ChatText.Equal[Give em Vie]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Verbose}) /1 ***  Casting ${shieldspell} on %t  ***
      /call Cast "${shieldspell}" gem5 15s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Give them Vie]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Verbose}) /1 ***  Casting ${shieldspell} on %t's group  ***
      /call Cast "${shieldspell}" gem5 15s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Give em AC]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  ***
      /call Cast "${acbuff}" gem5 7s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Give them AC]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5
      /if (${Verbose}) /1 ***  Casting ${grpacbuff} on %t's group  ***
      /call Cast "${grpacbuff}" gem5 7s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Give em aop]} || ${ChatText.Equal[Give em aor]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  *** 
      /call Cast "${spellhastebuff}" gem5 5s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give them aop]} || ${ChatText.Equal[Give them aor]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t's group  *** 
      /call Cast "${spellhastebuff}" gem5 5s 
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return 
   }
   /if (${ChatText.Equal[Give em di]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${spelldi} on %t  *** 
      /call Cast "${spelldi}" gem6 30s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give them ivu]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${ivuspell} on %t  *** 
      /call Cast "${ivuspell}" gem9 5s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[Give em rgc]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${rgcspell} on %t  *** 
      /call Cast "${rgcspell}" gem9 5s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[rgc em]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${rgcspell} on %t  *** 
      /call Cast "${rgcspell}" gem9 5s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return 
   }
   /if (${ChatText.Equal[AE CR]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /delay 5
      /if (${Me.AltAbilityReady[${aamgb}]} && ${Me.AltAbilityReady[${aacr}]}) { 
          /call cast "${aamgb}" alt  
          /if (${Verbose}) /1 *** AE CR INC ! ***
          /delay 15
          /call cast "${aacr}" alt
          /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      } else /if (${Verbose}) /1 *** AE CR not ready *** 
      /return 
   }
   |-------------------------------------------------------------
   |Group buff Request - auto
   |------------------------------------------------------------- 
   /if (${ChatText.Equal[buff us]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /echo Rebuff request
      /varset pallycount 0 
      /target myself 
      /delay 5
      /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  ***
      /call Cast "${acbuff}" gem5 10s
      /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]}) {
               /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  ***
               /call Cast "${acbuff}" gem5 10s 
            }
            /if (${Target.Class.Name.Equal[Paladin]}) {
               /delay 5 
               /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  ***
               /call Cast "${singlelonghpbuff}" gem9 10s 
               /varcalc pallycount ${pallycount}+1 
            } 
         } 
      /next gmember
      /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  *** 
      /call Cast "${spellhastebuff}" gem5 5s  
      /if (${Math.Calc[${Group}-${pallycount}]}>=2) {
          /delay 5
          /if (${Verbose}) /1 ***  Casting ${groupsmybuff}  *** 
          /call Cast "${groupsmybuff}" gem9 10s
      } 
      /if (${Math.Calc[${Group}-${pallycount}]}<2) { 
         /for gmember 0 to ${Group} 
            /delay 5
            /target id ${Group.Member[${gmember}].ID} 
            /delay 1s ${Target.ID}==${Group.Member[${gmember}].ID} 
            /if (${Target.Class.Name.NotEqual[Paladin]}) {
               /if (${Verbose}) /1 ***  Casting ${singlesmybuff} on %t  *** 
               /call Cast "${singlesmybuff}" gem9 7s 
            }
         /next gmember
      }
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return 
   }
   |-------------------------------------------------------------
   |Buff another group in auto mode
   |-------------------------------------------------------------  
   /if (${ChatText.Equal[buff them]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /assist ${Sender}
      /delay 5 
      /if (${Verbose}) /1 ***  Casting ${longhpbuff} on %t's group  *** 
      /call Cast "${longhpbuff}" gem9 10s
      /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  ***
      /call Cast "${spellhastebuff}" gem5 5s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit  
      /return 
   }
   |-------------------------------------------------------------
   |Rebuff individual in automode
   |-------------------------------------------------------------  
   /if (${ChatText.Equal[buff em]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /assist ${Sender}
      /delay 5
      /if (${Target.Class.Name.Equal[Paladin]}) {
         /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
         /call Cast "${singlelonghpbuff}" gem9 10s 
         /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  ***
         /call Cast "${spellhastebuff}" gem5 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 (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  *** 
         /call Cast "${spellhastebuff}" gem5 5s 
      }
      /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  *** 
      /call Cast "${acbuff}" gem5 10s
      /if (${Verbose}) /1 ***  Casting ${singlesmybuff} on %t  *** 
      /call Cast "${singlesmybuff}" gem9 7s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit 
      /return
   }
   /if (${ChatText.Equal[buff me]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /target ${Sender}
      /delay 5
      /if (${Target.Class.Name.Equal[Paladin]}) {
         /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
         /call Cast "${singlelonghpbuff}" gem9 10s 
         /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  ***
         /call Cast "${spellhastebuff}" gem5 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 (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  *** 
         /call Cast "${spellhastebuff}" gem5 5s 
      }
      /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  *** 
      /call Cast "${acbuff}" gem5 10s
      /if (${Verbose}) /1 ***  Casting ${singlesmybuff} on %t  *** 
      /call Cast "${singlesmybuff}" gem9 7s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return 
   }
   |-------------------------------------------------------------
   |Fast heals on Request
   |------------------------------------------------------------- 
   /if ((${ChatText.Equal[heal]})||(${ChatText.Equal[heal me]})) { 
      /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 CheckValidHeal 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else /tell ${Sender} your OOR
   /return 
   } 
   |-------------------------------------------------------------
   |Routine buff Requests
   |-------------------------------------------------------------
   /if (${ChatText.Equal[sym]} || ${ChatText.Equal[VIE]} || ${ChatText.Equal[IVU]} || ${ChatText.Equal[AC]} || ${ChatText.Equal[tem]} || ${ChatText.Equal[conv]} || ${ChatText.Equal[aop]} || ${ChatText.Equal[aor]} || ${ChatText.Equal[rgc]} || ${ChatText.Equal[hot]} || ${ChatText.Equal[aura]} || ${ChatText.Equal[HP aura]} || ${ChatText.Equal[ch me]} || ${ChatText.Equal[cure]} || ${ChatText.Equal[di]}) { 
      /if (${Spawn[pc ${Sender}].Distance}>${maxbuffrange}) /return 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /echo buff request
   } 
   /if (${ChatText.Equal[sym]}) {
      /if (${Verbose}) /1 ***  Casting ${singlesmybuff} on %t  *** 
      /call Cast "${singlesmybuff}" gem9 7s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Vie]}) {
      /if (${Verbose}) /1 ***  Casting ${shieldspell} on %t  ***
      /call Cast "${shieldspell}" gem5 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   } 
   /if (${ChatText.Equal[IVU]}) {
      /if (${Verbose}) /1 ***  Casting ${ivuspell} on %t  ***
      /call Cast "${ivuspell}" gem9 7s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[AC]}) {
      /if (${Verbose}) /1 ***  Casting ${acbuff} on %t  ***
      /call Cast "${acbuff}" gem5 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[DI]}) {
      /if (${announce}==1) /g DI on *** %T ***
      /if (${Verbose}) /1 ***  Casting ${spelldi} on %t  *** 
      /call Cast "${spelldi}" gem6 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   } 
   /if (${ChatText.Equal[Aura]}) {
      /if (${Verbose}) /1 ***  Casting ${auraspell}  *** 
      /call Cast "${auraspell}" gem9 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   } 
   /if (${ChatText.Equal[HP Aura]}) {
      /if (${Verbose}) /1 ***  Casting ${auraspellii}  *** 
      /call Cast "${auraspellii}" gem9 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Conv]}) {
      /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
      /call Cast "${singlelonghpbuff}" gem9 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   }
   /if (${ChatText.Equal[Tem]}) {
      /if (${Verbose}) /1 ***  Casting ${singlelonghpbuff} on %t  *** 
      /call Cast "${singlelonghpbuff}" gem9 10s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return
   } 
   /if (${ChatText.Equal[Aop]} || ${ChatText.Equal[Aop]}) {
      /if (${Verbose}) /1 ***  Casting ${spellhastebuff} on %t  *** 
      /call Cast "${spellhastebuff}" gem5 5s
      /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
      /return 
   } 
   /if (${ChatText.Equal[rgc]}) {
       /if (${Verbose}) /1 ***  Casting ${rgcspell} on %t  *** 
       /call Cast "${rgcspell}" gem9 5s
       /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
       /return 
   }
   /if (${ChatText.Equal[cure]}) {
       /delay 5
       /if (${Me.AltAbilityReady[${aacure}]}) {
           /if (${Verbose}) /1 ***  ${aacure} INC  ***
           /if (${announce}==1) /g *** ${aacure} INC *** 
           /call cast "${aacure}" alt
           /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
       } else /if (${Me.AltAbilityReady[${aapurity}]} && ${Me.AltAbilityReady[${aacure}]}==0) {
                  /if (${Verbose}) /1 ***  ${aapurity} INC  ***
                  /if (${announce}==1) /g *** ${aapurity} INC *** 
                  /call cast "${aapurity}" alt
                  /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
              } else /if (${Me.AltAbilityReady[${aapurity}]}==0 && ${Me.AltAbilityReady[${aacure}]}==0 && ${FindItem[${ShieldDA}].ID}) {
                         /if (${Verbose}) /1 EPIC USED
                         /if (${announce}==1) /g EPIC USED
                         /call Cast "${ShieldDA}" item
                         /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
                     }
   /return
   } 
   |-------------------------------------------------------------
   |CH - HOT Requests
   |-------------------------------------------------------------
   /if (${ChatText.Equal[hot]}) { 
      /if (${Target.Distance}<=${hotspellrange}) { 
         /if (${announce}==1) /g ${hotspell} on %T 
            /call Cast "${hotspell}" gem3 2s CheckValidHeal 
            /delay 15 ${Me.SpellReady[${hotspell}]} 
         } else /tell ${Sender} your OOR 
   } 
   /if (${ChatText.Equal[ch me]}) { 
      /if (${Target.Distance}<=${healspellrange}) { 
         /if (${announce}==1) /g CH on %T 
            /call Cast ${healspell} gem1 1s CheckValidHeal
            /delay 15 ${Me.SpellReady[${healspell}]} 
         } else /tell ${Sender} your OOR 
   } 
   |-------------------------------------------------------------
   |Mana Check
   |-------------------------------------------------------------
   /if (${ChatText.Equal[mana check]}) {
       /call FindExactPC ${Sender} 
       /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
       /1 ${Me.PctMana}m
   }

   /if (${ChatText.Equal[camp]}) {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Verbose}) /1 *** Camping ***
      /if (${announce}==1) /g Night Everyone ! 
      /if (${Me.Buff[${MountBuff}].ID}) /dismount
      /if (${Me.Standing}) /sit 
      /delay 2
      /disband
      /delay 5 
      /camp
      /delay 2 
      /endmacro 
   }

   |------------------------------------------------------------ 
   | Call to fellowship camp 
   |------------------------------------------------------------ 

      /if (${ChatText.Equal[come to campfire]}) {
          /echo heading to camp
          /if (${FindItem[${Fellowship}].ID}) {
              /if (${Verbose}) /1 Sweet theres a camp ? ... OMW !
              /delay 10
              /call Cast "${Fellowship}" item
          }  
          /delay 3s    
          /return 
        }
      /if (${ChatText.Equal[go to campfire]}) {
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
              /if (${Verbose}) /1 Moving to Campfire!
              /if (${Me.Buff[${MountBuff}].ID}) /dismount
              /if (${FindItem[${Fellowship}].ID}) {
                  /echo heading to camp
                  /delay 10
                  /call Cast "${Fellowship}" item 
              } 
              /delay 3s
              /return 
      }

   |------------------------------------------------------------ 
   | Mount 
   |------------------------------------------------------------ 
 
      /if (${ChatText.Equal[mount]}) { 
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
             /echo summoning mount
             /if (${Verbose}) /1 *** summoning mount ***
             /if (${FindItem[${Mount}].ID}) /call Cast "${Mount}" item 
             /delay 3s
             /return 
         } 
      /if (${ChatText.Equal[dismount]}) { 
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
             /echo dismounting
             /if (${Verbose}) /1 dismounting 
             /if (${Me.Buff[${MountBuff}].ID}) /dismount 
             /delay 3s
             /return 
        }
   |------------------------------------------------------------ 
   | Sit/Stand 
   |------------------------------------------------------------ 
 
      /if (${ChatText.Equal[sit]}) { 
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
             /if (${Me.Buff[${MountBuff}].ID}) /dismount
             /echo sitting .... 
             /if (${Verbose}) /1 *** medding ***
             /sit  
             /delay 3s   
             /return 
        } 

      /if (${ChatText.Equal[stand]}) { 
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
             /echo standing .... 
             /if (${Verbose}) /1 *** ready ***
             /stand  
             /delay 3s
             /return 
        } 

   |------------------------------------------------------------ 
   | Toggle Autosit 
   |------------------------------------------------------------ 
   /if (${ChatText.Equal[hold sitting]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset autosit 0
      /delay 5
      /if (${Verbose}) /1 Gonna keep standing
      /delay 5
      /echo Autosit: False
      /return 
   } 
   /if (${ChatText.Equal[Resume sitting]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset autosit 1
      /delay 5
      /if (${Verbose}) /1 I'll rest when i can  
      /delay 5
      /echo Autosit: TRUE
      /return 
   }

   |------------------------------------------------------------ 
   | Toggle auto cures 
   |------------------------------------------------------------ 
   /if (${ChatText.Equal[hold cures]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset autocure 0
      /delay 5
      /if (${Verbose}) /1 You dont want cures???   FINE ... NO CURES :P
      /delay 5
      /echo Do Cure: FALSE
      /return 
   } 
   /if (${ChatText.Equal[Resume Cures]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset autocure 1
      /delay 5
      /if (${Verbose}) /1 Will keep group cured NP !  
      /delay 5
      /echo Do Cure: TRUE 
      /return
   } 
 
   |------------------------------------------------------------ 
   | Toggle self buffs 
   |------------------------------------------------------------ 
   /if (${ChatText.Equal[hold buffs]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset dobuff 0
      /delay 5
      /if (${Verbose}) /1 You dont want buffs???   FINE ... NO BUFFS :P
      /delay 5
      /echo Do Buff: FALSE
      /return 
   } 
   /if (${ChatText.Equal[Resume buffs]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset dobuff 1
      /delay 5
      /if (${Verbose}) /1 cleric buffs INC WMP  
      /delay 5
      /echo Do Buff: TRUE
      /return 
   } 

   |------------------------------------------------------------ 
   | Toggle Interrupt 
   |------------------------------------------------------------ 

   /if (${ChatText.Equal[hold interrupt]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset autointerrupt 0
      /delay 5
      /if (${Verbose}) /1 Full heals ... NP 
      /delay 5
      /echo autointerrupt: FALSE
      /return 
   } 
   /if (${ChatText.Equal[Resume interrupt]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset autointerrupt 1
      /delay 5
      /if (${Verbose}) /1 Conserving Mana on heals ...  
      /delay 5
      /echo autointerrupt: TRUE
      /return 
   }

   |------------------------------------------------------------ 
   | Toggle Aura 
   |------------------------------------------------------------ 

   /if (${ChatText.Equal[hold aura]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset autoaura 0
      /delay 5
      /if (${Verbose}) /1 No Aura's 
      /delay 5
      /echo autoaura: FALSE
      /return 
   } 
   /if (${ChatText.Equal[Resume aura]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset autoaura 1
      /delay 5
      /if (${Verbose}) /1 Keeping Aura up   
      /delay 5
      /echo autoaura: TRUE
      /return 
   }

   /if (${ChatText.Equal[hold hp aura]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset autoauraii 0
      /delay 5
      /if (${Verbose}) /1 No hp Aura
      /delay 5
      /echo autoaura: FALSE
      /return 
   } 
   /if (${ChatText.Equal[Resume hp aura]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /Varset autoauraii 1
      /delay 5
      /if (${Verbose}) /1 Keeping hp Aura up   
      /delay 5
      /echo autoaura: TRUE
      /return 
   }

   |------------------------------------------------------------ 
   | Turn channel chat on and off
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[be quiet]})  {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Verbose}) /1 *** WhatEVER ***  
      /varset Verbose 0 
      /echo Chat:   ${Verbose} 
      /return
   }
 /if (${ChatText.Equal[talk to me]})  { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset Verbose 1 
      /echo Chat:   ${Verbose}
      /if (${Verbose}) /1 i am here 
      /return
   }

   |------------------------------------------------------------ 
   | Turn group chat on and off
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[be quiet in group]})  {
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${announce}) /g !!!  
      /varset announce 0 
      /echo GroupChat:   ${announce} 
      /return
   }
 /if (${ChatText.Equal[talk to me in group]})  { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /varset announce 1 
      /echo GroupChat:   ${announce}
      /if (${announce}) /g :) 
      /return
   }

   |------------------------------------------------------------ 
   | Click the zone in 
   |------------------------------------------------------------ 
   /if (${ChatText.Equal[click in]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /keypress U
      /return 
   } 

   |------------------------------------------------------------ 
   | Gate 
   |------------------------------------------------------------ 
   /if (${ChatText.Equal[gate]}) {  
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Me.Buff[${MountBuff}].ID}) /dismount
      /if (${Verbose}) /1 *** Gating *** 
      /call cast ${spellgate} gem9  8s
      /return 
   } 
   /if (${ChatText.Equal[tob]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
      /if (${Me.Buff[${MountBuff}].ID}) /dismount
      /if (${Verbose}) /1 Heading to TOB ! 
      /delay 5
      /if (${Me.AltAbilityReady[${aatob}]}) {
          /echo self Port
          /call cast "${aatob}" alt
      } else /if (${Verbose}) /1 *** ${aatob} not ready ***    
      /delay 15 
      /return
   }    
   
   |------------------------------------------------------------ 
   | Rez Fallen Group Member 
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[rez em]}) { 
    /echo Request to rez the fallen 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /assist
    /delay 5 
    /corpsedrag
    /if (${Me.AltAbilityReady[${aarez}]}) {
        /if (${announce}==1) /g ${aarez} inc ... %t 
        /if (${Verbose}) /1 *** ${aarez} %t ! *** 
        /call cast "${aarez}" alt
    } else /if (${FindItem[${clickrez}].ID} && ${Me.AltAbilityReady[${aarez}]}==0) {
        /if (${announce}==1) /g Rez inc ... %t 
        /if (${Verbose}) /1 *** Rezzing %t ! *** 
        /call Cast "${clickrez}" item
    }
    /delay 3s
    /keypress esc
    /corpsedrop
    /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
    /return
 }
 /if (${ChatText.Equal[rez me]}) { 
    /echo Request to rez the fallen 
    /target ${Sender}'s Corpse
    /delay 5 
    /corpsedrag
    /if (${Me.AltAbilityReady[${aarez}]}) {
        /if (${announce}==1) /g ${aarez} inc ... %t 
        /if (${Verbose}) /1 *** ${aarez} %t ! *** 
        /call cast "${aarez}" alt
    } else /if (${FindItem[${clickrez}].ID} && ${Me.AltAbilityReady[${aarez}]}==0) {
        /if (${announce}==1) /g Rez inc ... %t 
        /if (${Verbose}) /1 *** Rezzing %t ! *** 
        /call Cast "${clickrez}" item
    }
    /delay 3s
    /keypress esc
    /corpsedrop
    /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
    /return
 }
 /if (${ChatText.Equal[Re rez]}) {
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /echo Request rerez myself 
    /squelch /target mycorpse
    /delay 5 
    /corpsedrag
    /if (${Me.AltAbilityReady[${aarez}]}) {
        /if (${announce}==1) /g ${aarez} inc ... %t 
        /if (${Verbose}) /1 *** ${aarez} %t ! *** 
        /call cast "${aarez}" alt
    } else /if (${FindItem[${clickrez}].ID} && ${Me.AltAbilityReady[${aarez}]}==0) {
        /if (${announce}==1) /g Rez inc ... %t 
        /if (${Verbose}) /1 *** Rezzing %t ! *** 
        /call Cast "${clickrez}" item
    }  
    /delay 3s 
    /call Wait4Rez 
    /delay 20 
    /call MemSpells 
    /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
    /varset dobuff 0
    /delay 5
    /echo do buffs: ${dobuff}
    /varset idied 1
    /echo Recovery enabled ${idied} 
    /return
 }
 /if (${ChatText.Equal[divine rez em]}) { 
    /echo Request to rez the fallen 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /assist
    /delay 5 
    /corpsedrag
    /if (${Me.AltAbilityReady[${aadrez}]}) {
        /if (${announce}==1) /g ${aadrez} inc ... %t 
        /if (${Verbose}) /1 *** ${aadrez} %t ! *** 
        /call cast "${aadrez}" alt
    } else /if (${Verbose}) /1 *** ${aadrez} not ready ***
    /keypress esc
    /corpsedrop  
    /delay 3s
    /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
    /return
 }
 /if (${ChatText.Equal[divine rez]}) {
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /echo Request rerez myself 
    /squelch /target mycorpse
    /delay 5 
    /corpsedrag
    /if (${Me.AltAbilityReady[${aadrez}]}) {
        /if (${announce}==1) /g ${aadrez} inc ... %t 
        /if (${Verbose}) /1 *** ${aadrez} %t ! *** 
        /call cast "${aadrez}" alt
        /delay 3s 
        /call Wait4Rez 
        /delay 20 
        /call MemSpells 
        /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit
        /varset dobuff 0
        /delay 5
        /echo do buffs: ${dobuff}
        /varset idied 1
        /echo Recovery enabled ${idied} 
    } else /if (${Verbose}) /1 *** ${aadrez} not ready ***
    /keypress esc
    /corpsedrop
    /if (${Bool[${Me.Standing}]} && ${medding} && ${NearestSpawn[NPC].Distance}>=${distancetosit}) /sit   
    /return
 }


   |------------------------------------------------------------ 
   |  Command to Loot corpse  
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[Loot corpse]})  { 
    /echo Need to loot my gear ....
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return
        /call Loot_Corpse
        /delay 20 
        /call MemSpells 
        /if (${Me.State.Equal[Stand]}) /sit
        /varset combat 1
        /delay 5
        /echo combat: TRUE
        /return 
    }

   |------------------------------------------------------------ 
   | Change Heal Mode 
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[Raise heal mode]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${autohealmode}<=2) {
         /varset autohealmode ${Math.Calc[1+${autohealmode}]}
     } else /if (${autohealmode}>=3) {
                /echo Cant go any higher ... sorry
            }
     /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      
     /return 
     }

 /if (${ChatText.Equal[Lower heal mode]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${autohealmode}>=1) {
         /varset autohealmode ${Math.Calc[${autohealmode}-1]}
     } else /if (${autohealmode}<=0) {
                /echo Cant go any lower ... sorry
            }
     /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      
     /return 
     }

   |------------------------------------------------------------ 
   | Switch Healing Strat 
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[change to fast heals]}) { 
    /echo Request for fast healing 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /varset patchheal ${bfastheal}
    /varset healspell ${bpatchheal}
    /delay 15
    /echo Primary Heal: "${healspell}"
    /if (${acheals}==1) {
        /varset healpct ${Math.Calc[${healpct}-10]}
        /if (${Verbose}) /1 Healing ${tankname} at ${healpct}
        /echo Healing ${tankname} at ${healpct}
    }
    /return 
 }

 /if (${ChatText.Equal[change to complete heals]}) { 
    /echo Request for fast healing 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /varset patchheal ${bpatchheal}
    /varset healspell ${bhealspell}
    /delay 15
    /echo Primary Heal: "${healspell}"
    /return 
  }

   |-------------------------------------------------------------
   |make a heal partner
   |-------------------------------------------------------------  

   /if (${ChatText.Equal[Link up]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /assist
      /delay 15
      /varset healpartner ${cleanName}
      /if (${Target.Type.Equal[NPC]}) {
          /tell ${Sender} ${Target} is not a PC :P
          /return
      }
      /if (${Target.Class.Name.NotEqual[Cleric]}) {
          /tell ${Sender} ${Target} is not a cleric :P
          /return
      }
      /if (${Target.Class.Name.Equal[Cleric]}) {
          /varset healpartner ${Target}
          /echo Activating heal parnter routine
          /delay 5
          /echo Designated heal partner *** ${healpartner} ***
          /tell ${healpartner} Make me your partner
          /varset acheals 1
          /varset patchheal ${bfastheal}
          /varset healspell ${bpatchheal}
          /delay 5
          /echo Primary Heal: "${healspell}"
          /varset healpct ${Math.Calc[${healpct}-10]}
          /if (${Verbose}) /1 Healing ${tankname} at ${healpct}
          /echo Healing ${tankname} at ${healpct}
          /return
      }
    }

   /if (${ChatText.Equal[make me your partner]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /delay 5
      /varset healpartner ${cleanName}
      /if (${Target.Type.Equal[NPC]}) /return
      /if (${Target.Class.Name.NotEqual[Cleric]}) {
          /tell ${Sender} ${Target} is not a cleric :P
          /return
      }
      /if (${Target.Class.Name.Equal[Cleric]}) {
          /varset healpartner ${Target}
          /echo Activating heal parnter routine
          /delay 5
          /echo Designated heal partner *** ${healpartner} ***
          /varset acheals 1
          /return
      }
    }
   /if (${ChatText.Equal[End Link]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /delay 5
      /tell ${healpartner} end partnership
      /varset healpartner NULL
      /varset acheals 0
      /echo partnership ended ... partner notified
      /return
   }
   /if (${ChatText.Equal[end partnership]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /delay 5
      /varset healpartner NULL
      /varset acheals 0
      /echo partnership ended
      /return
   }
 
   |------------------------------------------------------------ 
   | Change Main Assist 
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[change assist]}) { 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /echo Request to change main assist 
    /assist
    /delay 5
    /varset tankname  ${cleanName}
    /varset tankclass ${cleanName}        
   /if (!${Target.ID}) { 
      /echo No Tank targeted ... Ending macro ... 
      /end 
   } else {
      /varset tankname ${Target} 
      /varset tankclass ${Target.Class.Name} 
   }  
   /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 
   /delay 5
   /if (${Verbose}) /1 ${tankname} is main assist
   /return  
   }
 
   |------------------------------------------------------------ 
   | Change Main Assist to me
   |------------------------------------------------------------ 

 /if (${ChatText.Equal[change assist to me]}) { 
    /call FindExactPC ${Sender} 
    /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
    /echo Request to change main assist to sender
    /target ${Sender}
    /delay 5       
    /varset tankname  ${cleanName}
    /varset tankclass ${cleanName}        
   /if (!${Target.ID}) { 
      /echo No Tank targeted ... Ending macro ... 
      /end 
   } else {
      /varset tankname ${Target} 
      /varset tankclass ${Target.Class.Name} 
   } 
   /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 
   /delay 5
   /if (${Verbose}) /1 ${tankname} is main assist
   /return 
   }

   |------------------------------------------------------------ 
   |   Change Healing settings in chat  
   |------------------------------------------------------------       

 /if (${ChatText.Equal[Raise tank heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${healpct}<=89) {
         /varset healpct ${Math.Calc[10+${healpct}]}
         /if (${Verbose}) /1 Healing ${tankname} at ${healpct}
         /echo Healing ${tankname} at ${healpct}
     } else /if (${healpct}>=90) {
                /if (${Verbose}) /1 Cant go any higher ... sorry
                /echo Cant go any higher ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[Raise caster heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${casterpatchpoint}<=89) {
         /varset casterpatchpoint ${Math.Calc[10+${casterpatchpoint}]}
         /varset casterhotpoint ${Math.Calc[10+${casterhotpoint}]}
         /if (${Verbose}) /1 Caster patch heal at ${casterpatchpoint}
         /if (${Verbose}) /1 Caster hot at ${casterhotpoint}
         /echo Healing Casters at ${casterpatchpoint}
     } else /if (${casterhotpoint}>=90) {
                /if (${Verbose}) /1 Cant go any higher ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[Raise melee heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${meleepatchpoint}<=89) {
         /varset meleepatchpoint ${Math.Calc[10+${meleepatchpoint}]}
         /varset tankhealpoint ${Math.Calc[10+${tankhealpoint}]}
         /if (${Verbose}) /1 Healing melee at ${meleepatchpoint}
         /if (${Verbose}) /1 Healing offtanks at ${tankhealpoint}
         /echo Healing melee at ${meleepatchpoint}
         /echo Healing offtanks at ${tankhealpoint}
     } else /if (${tankhealpoint}>=90) {
                /if (${Verbose}) /1 Cant go any higher ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[Raise self heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${selfhealpoint}<=89) {
         /varset selfhealpoint ${Math.Calc[10+${selfhealpoint}]}
         /if (${Verbose}) /1 Healing myself at ${selfhealpoint}
         /echo Healing myself at ${selfhealpoint}
     } else /if (${selfhealpoint}>=90) {
               /if (${Verbose}) /1 Cant go any higher ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[Raise puller heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${pullerpatchpoint}<=89) {
         /varset pullerpatchpoint ${Math.Calc[10+${pullerpatchpoint}]}
         /if (${Verbose}) /1 Healing pullers at ${pullerpatchpoint}
         /echo Healing pullers at ${pullerpatchpoint}
     } else /if (${pullerpatchpoint}>=90) {
               /if (${Verbose}) /1 Cant go any higher ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[Raise shaman heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${shamanpatchpoint}<=89) {
         /varset shamanpatchpoint ${Math.Calc[10+${shamanpatchpoint}]}
         /if (${Verbose}) /1 Healing shaman at ${shamanpatchpoint}
         /echo Healing shaman at ${shamanpatchpoint}
     } else /if (${shamanpatchpoint}>=90) {
               /if (${Verbose}) /1 Cant go any higher ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[Raise range]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${distancetosit}<=89 || ${distancetobuff}<=89) {
         /varset distancetosit ${Math.Calc[10+${distancetosit}]}
         /varset distancetobuff ${Math.Calc[10+${distancetobuff}]}
         /echo Distance to Sit ${distancetosit}
         /echo Distance to Buff ${distancetobuff}
     } else /if (${distancetosit}>=90 || ${distancetobuff}>=90) {
                /if (${Verbose}) /1 Cant go any higher ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[Raise spam]} || ${ChatText.Equal[Raise Interrupt]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${SHInterrupt}<=94) {
         /varset SHInterrupt ${Math.Calc[5+${SHInterrupt}]}
         /echo Interrupting Spam above  ${SHInterrupt}%
     } else /if (${SHInterrupt}>=95) {
               /if (${Verbose}) /1 Cant go any higher ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[Lower tank heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${healpct}>=11) {
         /varset healpct ${Math.Calc[${healpct}-10]}
         /if (${Verbose}) /1 Healing ${tankname} at ${healpct}
         /echo Healing ${tankname} at ${healpct}
     } else /if (${healpct}<=10) {
                /if (${Verbose}) /1 Cant go any lower ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[lower caster heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${casterpatchpoint}>=11) {
         /varset casterpatchpoint ${Math.Calc[${casterpatchpoint}-10]}
         /varset casterhotpoint ${Math.Calc[${casterhotpoint}-10]}
         /if (${Verbose}) /1 Patch Healing Casters at ${casterpatchpoint}
         /if (${Verbose}) /1 HOT on Casters at ${casterhotpoint}
         /echo Healing Casters at ${casterpatchpoint}
         /echo HOT on Casters at ${casterhotpoint}
     } else /if (${casterpatchpoint}<=10) {
                /if (${Verbose}) /1 Cant go any lower ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[lower melee heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${meleepatchpoint}>=11) {
         /varset meleepatchpoint ${Math.Calc[${meleepatchpoint}-10]}
         /varset tankhealpoint ${Math.Calc[${tankhealpoint}-10]}
         /if (${Verbose}) /1 Healing melee at ${meleepatchpoint}
         /if (${Verbose}) /1 Healing offtanks at ${tankhealpoint}
         /echo Healing melee at ${meleepatchpoint}
         /echo Healing Offtanks at ${tankhealpoint}
     } else /if (${meleepatchpoint}<=10) {
                /if (${Verbose}) /1 Cant go any lower ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[lower self heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${selfhealpoint}>=11) {
         /varset selfhealpoint ${Math.Calc[${selfhealpoint}-10]}
         /if (${Verbose}) /1 Healing myself at ${selfhealpoint}
         /echo Healing myself at ${selfhealpoint}
     } else /if (${selfhealpoint}<=10) {
               /if (${Verbose}) /1 Cant go any lower ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[lower puller heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${pullerpatchpoint}>=11) {
         /varset pullerpatchpoint ${Math.Calc[${pullerpatchpoint}-10]}
         /if (${Verbose}) /1 Healing pullers at ${pullerpatchpoint}
         /echo Healing pullers at ${pullerpatchpoint}
     } else /if (${pullerpatchpoint}<=10) {
               /if (${Verbose}) /1 Cant go any lower ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[lower shaman heals]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${shamanpatchpoint}>=11) {
         /varset shamanpatchpoint ${Math.Calc[${shamanpatchpoint}-10]}
         /if (${Verbose}) /1 Healing shaman at ${shamanpatchpoint}
         /echo Healing shaman at ${shamanpatchpoint}
     } else /if (${shamanpatchpoint}<=10) {
               /if (${Verbose}) /1 Cant go any higher ... sorry
           }      
     /return 
     }

 /if (${ChatText.Equal[lower range]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${distancetosit}>=11 || ${distancetobuff}>=11) {
         /varset distancetosit ${Math.Calc[${distancetosit}-10]}
         /varset distancetobuff ${Math.Calc[${distancetobuff}-10]}
         /echo Distance to Sit ${distancetosit}
         /echo Distance to Buff ${distancetobuff}
     } else /if (${distancetosit}<=10 || ${distancetobuff}<=10) {
                /if (${Verbose}) /1 Cant go any lower ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[lower spam]} || ${ChatText.Equal[lower interrupt]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /if (${SHInterrupt}>=6) {
         /varset SHInterrupt ${Math.Calc[${SHInterrupt}-5]}
         /echo Interrupt above ${SHInterrupt}%
     } else /if (${SHInterrupt}<=5) {
                /if (${Verbose}) /1 Cant go any lower ... sorry
            }      
     /return 
     }

 /if (${ChatText.Equal[Drop range]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /varset distancetosit 40
     /varset distancetobuff 40
     /echo Distance to Sit ${distancetosit}
     /echo Distance to Buff ${distancetobuff}
     /return 
 }

 /if (${ChatText.Equal[Drop puller range]})  { 
     /call FindExactPC ${Sender} 
     /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
     /varset fdhealrange 40
     /echo Puller healing range at ${fdhealrange}
     /return 
 }
        
   |------------------------------------------------------------ 
   |   Auto Return Home
   |------------------------------------------------------------ 

      /if (${ChatText.Equal[Go Home]}) { 
          /call FindExactPC ${Sender} 
          /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
          /echo Time to leave 
          /if (${Verbose}) /1 i am leaving! Thank for the group!
          /if (${Me.Buff[${MountBuff}].ID}) /dismount
          /disband
          /call cast ${spellgate} gem9  8s
          /delay 100
          /camp
          /endmacro 
          /return 
      }
/return 

| ################## I Died 

Sub Event_ImDead 
   /echo Bummer ! 
   :Zone_Loop 
   /delay 5s

| -- Consent Group --

   /echo Consenting group .... 
   /consent group 
   /delay 5 
   /if (${Verbose}) /1 Im ready for rez. 
   /if (${Verbose}) /1 I have consented group.

| -- Hold for Rez --

   /echo holding for rez 
   /call Wait4Rez 
   /delay 20 
   /call MemSpells 
   /if (${Me.State.Equal[Stand]}) /sit

| -- Turn off Autobuff --
 
   /varset dobuff 0
   /timed 2500 /varset dobuff 1
   /delay 5
   /echo Do Buff: FALSE
   /varset idied 1
   /echo Recovery enabled ${idied}
   /return 

   |------------------------------------------------------------ 
   |  WAIT FOR REZ 
   |------------------------------------------------------------  

Sub Wait4Rez 

| -- Auto-accept Rez -- 

   :waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
       /delay 5s ${Window[ConfirmationDialogBox].Open} 
       /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
       /delay 5s 
   /if (${Window[RespawnWnd].Open}) /notify RespawnWnd RW_OptionsList listselect 2 
       /delay 5s 
   /if (${Window[RespawnWnd].Open}) /notify RespawnWnd RW_SelectButton leftmouseup

/return 

| -- Zone in  -- 

   :zonein 
        /delay 5 
        /target mycorpse 
        /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]} 
        /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
        /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
            /delay 3s 
            /call Loot_Corpse 
        } else /goto :zonein 
/return 

   |------------------------------------------------------------ 
   |  AUTOLOOT CORPSE 
   |------------------------------------------------------------ 

Sub Loot_Corpse 

| -- Pull corpse  -- 

   :corpsepull 
   /target mycorpse 
   /delay 5 ${Target.CleanName.Equal[${Me}'s corpse]} 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) { 
       /echo No corpse in this zone 
       /return 
   } 
   /delay 3s 
   /corpse 
   /delay 1s ${Target.Distance}<20 
   /if (${Target.Distance}>20) { 
       /echo Corpse is too far away 
       /return 
   } 
 
| -- Open the corpse -- 
 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
       /loot 
   } else { 
       /echo where did my corpse go? 
       /return 
   } 
   /delay 5s ${Me.State.Equal[BIND]} 
   /if (${Me.State.NotEqual[BIND]}) /goto :corpsepull 
   /varset loottotal 0 
 
| -- Count items -- 
 
   /delay 3s 
   :LootLag 
   /if (${loottotal}!=${Corpse.Items}) { 
       /varset loottotal ${Corpse.Items} 
       /delay 2s 
       /goto :LootLag 
   } 
   /if (${loottotal}<=${lootleft}) { 
       /echo Looting aborted.  Error in number of items to be left on corpse. 
       /notify LootWnd DoneButton leftmouseup 
       /return 
   } 
   /varset loottotal ${Math.Calc[${Corpse.Items}-${lootleft}]} 
 
| -- Loot the corpse -- 

   /echo Looting all but ${lootleft} item(s) 
   /for lootslot 1 to ${loottotal} 
   :LootItem 
   /itemnotify loot${lootslot} rightmouseup 
   /delay 5 !${Corpse.Item[${lootslot}].ID} 
   /if (!${Corpse.Item[${lootslot}].ID}) { 
       /next lootslot 
   } else /goto :LootItem 
 
| -- Doublecheck -- 

   /if (${Math.Calc[${Corpse.Items}-${lootleft}]}>0) /goto :LootLag 
   /notify LootWnd DoneButton leftmouseup 
   /echo Done looting.  ${lootleft} Items left on your corpse. 
/return  
 

Sub Event_Zoned 
    /echo PAUSING MACRO. We Zoned. 
    /delay 100

/return
 
When ever you post code you should use code blocks [ code ] and [ /code ] (no spaces)

They preserve the formatting which makes code easier to read.
 
this was such a workhorse of a mac, it lasted almost 2 decades :p
 
Lol that was a couple-too-tree swipes to scroll on my phone. &#55357;&#56833;
 
Just glancing the loot code can be removed/revamped for the advloot window that eq has now.
 
The macro can be made to work but likely needs to be updated in a few places. Near the top you see

#include spell_routines.ini

When they created this back in 2005 it was expected that you would define variables if you wanted to change the default behavior. Now its mandatory.

eqMule also changed the way missing parameters are 'filled in'.


Between those two changes the macro you have will not function correctly.

The good news is that with a relatively small set of changes they will work as expected, the bad news is ... it WILL take some work to find the spots.

Please edit your first post to include YOUR version of spell_routines.inc as there are many different versions floating around.
 
The macro can be made to work but likely needs to be updated in a few places. Near the top you see

#include spell_routines.ini

When they created this back in 2005 it was expected that you would define variables if you wanted to change the default behavior. Now its mandatory.

eqMule also changed the way missing parameters are 'filled in'.


Between those two changes the macro you have will not function correctly.

The good news is that with a relatively small set of changes they will work as expected, the bad news is ... it WILL take some work to find the spots.

Please edit your first post to include YOUR version of spell_routines.inc as there are many different versions floating around.

I hardly glanced at it. Spell_routines.inc file in it's most up to date version that I'm aware of would be found on bot40.mac thread per my own updates to the file. I'm unaware of anyone else that's updated it other than myself.
 
As always thanks

As always thanks, crazy to see names that have been around for so long. Thanks, I will try to dissect things this weekend and compare current bot mac to it and see if I can get it running. Your input gives me some direction on where to start. I have several versions of various classes. It was great when they worked. Thanks