AFCleric Macro

Kalle

Ummmm.....
Joined
Jan 9, 2006
Messages
826
Reaction score
0
Points
16
Plugin's

Code:
will update soon

AFCleric.mac

Code:
#Event GotHit       "#*# YOU for#*#" 
#Event MobDead      "#*#You have slain#*#" 
#Event MobDead      "#*#has been slain by#*#" 
#Event Zoned        "#*#You have entered#*#" 
#Event ImDead       "You have been slain by#*#" 
#Chat  Chat 
#Chat  Tell 
#Chat  Group 

#include spell_routines.inc 
#include wait4rez.inc 
#include irc.inc 

Sub Main 

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

   /declare MasterList string outer "MASTERLIST" 
   /declare MasterOnly outer TRUE 
   /call IRCDeclares 

   /declare spellset             string outer spells 
   /declare patchheal            string outer Ancient: Hallowed Light 
   /declare patchhealgem         string outer gem1 
   /declare healspell            string outer Complete Healing 
   /declare healspellgem         string outer gem2 
   /declare hotspell             string outer Pious Elixir 
   /declare hotspellgem          string outer gem3 
   /declare groupheal            string outer Word of Replenishment 
   /declare grouphealgem         string outer gem4 
   /declare daspell              string outer Divine Barrier 
   /declare daspellgem           string outer gem5 
   /declare yaulpspell           string outer Yaulp VII 
   /declare yaulpspellgem        string outer gem6 
   /declare mitigationspell      string outer Panoply of Vie 
   /declare mitigationspellgem   string outer gem7 
   /declare selfbuff             string outer Armor of the Pious 
   /declare selfbuffgem          string outer gem8 
   /declare grouplonghpbuff      string outer Hand of Conviction 
   /declare grouplonghpbuffgem   string outer gem9 
   /declare nukeone              string outer Reproach 
   /declare nuketwo              string outer Order 
   /declare stunone              string outer Sound of Divinity 
   /declare stuntwo              string outer Shock of Wonder 
   /declare spellhaste           string outer Blessing of Devotion 
   /declare acbuff               string outer Ward of Valiance 
   /declare longhpbuff           string outer Conviction 
   /declare singlesymbuff        string outer Symbol of Balikor 
   /declare groupsymbuff         string outer Balikor's Mark 
   /declare spellhastebuff       string outer Blessing of Devotion 
   /declare rgcspell             string outer Remove Greater Curse 
    
   /declare AnnounceChannel      string outer i say 
   /declare Verbose                     outer FALSE 
   /declare autohealmode         int    outer 3 
   /declare lootleft             int    outer 0 
   /declare healspellrange       int    outer 120 
   /declare patchhealrange       int    outer 200 
   /declare hotspellrange        int    outer 120 
   /declare groupspellrange      int    outer 100 
   /declare usegroupheal         int    outer 1 
   /declare usedivarb            int    outer 1 
   /declare healafterdivarb      int    outer 0 
   /declare announce             int    outer 1 
   /declare autosit              int    outer 1 
   /declare distancetosit        int    outer 40 
   /declare autointerrupt        int    outer 1 
   /declare onlyhealfd           int    outer 0 
   /declare interrupt2healself   int    outer 1 
   /declare interrupt2healselfhp int    outer 40 
   /declare noInvis              int    outer 1 
   /declare defaultstophealpoint int    outer 80 
   /declare healpetmode          int    outer 0 
   /declare pethealpoint         int    outer 65 
   /declare manatohealpet        int    outer 90 
   /declare pethealspell         string outer Pious Light 
   /declare pethealspellrange    int    outer 200 
   /declare followid             int    outer 
   /declare meleeClasses         string outer "Warrior/Shadow Knight/Paladin" 
   /declare casterClasses        string outer "Cleric/Druid/Enchanter/Wizard/Magician" 
   /declare dpsClasses           string outer "Rogue/Monk/Beastlord/Berserker" 
   /declare canniClasses         string outer "Necromancer/Shaman" 
   /declare NoHotID[6]           int    outer 0 

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

   /declare selfhealpoint        int outer 70 
   /declare dacastpoint          int outer 29 
   /declare divarbpoint          int outer 25 
   /declare interrupt2divarb     int outer 20 
   /declare tankhealpoint        int outer 65 
   /declare casterhotpoint       int outer 85 
   /declare casterpatchpoint     int outer 70 
   /declare necshmpatchpoint     int outer 60 
   /declare defaultpatchpoint    int outer 70 

| ############ Self Buff List.    
  /declare SelfBuffRecheck   int    outer 600 
  /declare SelfBuffTimer     timer  outer 0 

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

   /declare MovingCamp            outer FALSE 
   /declare Following             outer FALSE 
   /declare FollowName     string outer 
   /declare StaticCamp            outer TRUE 
   /declare askforbuffs           outer TRUE 
   /declare HomeX          int    outer ${Me.X} 
   /declare HomeY          int    outer ${Me.Y} 
   /declare healpct        int    outer 50 
   /declare tanknameid     int    outer 0 
   /declare minorhurt      int    outer 0 
   /declare majorhurt      int    outer 0 
   /declare worsthurtid    int    outer 0 
   /declare worsthp        int    outer 100 
   /declare gmember        int    outer 0 
   /declare worsthurt      string outer NULL 
   /declare worstclass     string outer NULL 
   /declare nohotforua     string outer NoOne 
   /declare nohotforub     string outer NoOne 
   /declare nohotforuc     string outer NoOne 
   /declare nohotforud     string outer NoOne 
   /declare tankname       string outer ${Target} 
   /declare DefaultMT      string outer DEFAULTMT 
   /declare tankclass      string outer 
   /declare rodwait        int    outer 0 
   /declare pallycount     int    outer 0 
   /declare stophealpoint  int    outer ${defaultstophealpoint} 
   /declare oomspam        timer  outer 600 
   /declare duckspam       timer  outer 100 
   /declare duckfdspam     timer  outer 400 
   /declare duckselfspam   int    outer 1 
   /declare nomtspam       timer  outer 300 
   /declare aetime         int    outer 0 
   /declare helpspam       timer  outer 50 
    
  /if (!${Target.ID} && ${Spawn[pc ${DefaultMT}].ID}) { 
    /varset tanknameid ${Spawn[pc ${DefaultMT}].ID} 
    /varset tankclass ${Spawn[pc ${DefaultMT}].Class.Name} 
  } else { 
      /varset tanknameid ${Target.ID} 
      /varset tankclass ${Target.Class.Name} 
  } 
  /if (${Defined[Param0]}) {    
    /varset healpct ${Param0} 
  } else { 
    /echo No Heal% specified, defaulting to 60% 
  } 
  /if (!${Defined[Param1]}) {    
    /echo Usage: /mac AFCleric % healspell 
    /echo Example: /mac AFCleric 40 Complete Heal 
    /echo Defaulting to ${healspell} at ${healpct}% 
  } else {    
    /if (!${Defined[Param2]}) { 
       /varset healspell ${Param1} 
    } else /if (!${Defined[Param3]}) { 
       /varset healspell ${Param1} ${Param2} 
    } else /if (!${Defined[Param4]}) { 
       /varset healspell ${Param1} ${Param2} ${Param3} 
    } else { 
     /varset healspell ${Param1} ${Param2} ${Param3} ${Param4} 
    } 
  } 

  /echo AFCleric Active, running in Autohealmode ${autohealmode} 
  /echo Casting ${healspell} on ${tankname} at ${healpct}% HP 
  /if (${autohealmode}==0) /echo ONLY ${tankname} will be healed 
  /if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed 
  /if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed 
  /if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group 
  /if (!${InvSlot[charm].Item.Name.Length} && !${InvSlot[chest].Item.Name.Length} && !${InvSlot[head].Item.Name.Length} ) /call Event_ImDead 
  /memspellset ${spellset} 
  
  :loop 
  /if (${GameState.Equal[CHARSELECT]}) /end 
  /if (!${Spawn[${tanknameid}].ID} || ${Spawn[${tanknameid}].Type.Equal[NPC]}) /call TankCheck 
  /if (!${Target.ID} || ${Target.ID}!=${tanknameid} && ${Spawn[${tanknameid}].Type.NotEqual[Corpse]} && ${Spawn[${tanknameid}].ID} && !${Spawn[${tanknameid}].Type.Equal[NPC]}) { 
    /target id ${tanknameid} 
    /delay 5 ${Target.ID} == ${tanknameid} 
  } 
  /doevents 
  /if (${Me.Invis} || ${Following} || ${Me.Buff[Divine Aura].ID} || ${Me.Buff[Sacred Barrier].ID} || ${Me.Buff[Divine Barrier].ID}) /goto :loop 
  /if (${Me.PctHPs} > ${selfhealpoint} && ${Me.PctMana} < 95) /call MedTime 
  /if (${Target.ID}==${tanknameid} && ${Target.Type.NotEqual[corpse]}) { 
    /if (${Target.Distance} <= ${patchhealrange} && ${Target.PctHPs} <= ${healpct}*.7 && ${Me.SpellReady[${patchheal}]}) { 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /call Cast "${patchheal}" ${patchhealgem} 0 CheckHP 
    }  
    /if (${Target.Distance} <= ${healspellrange} && ${Target.PctHPs}<= ${healpct} && ${Target.PctHPs} >= ${healpct}*.7 && ${Me.SpellReady[${healspell}]}) { 
      /if (${announce}) /${AnnounceChannel} Casting "${healspell}" on ${Target.CleanName} in ${Spell[${healspell}].CastTime} seconds! 
      /call Cast "${healspell}" ${healspellgem} 0 CheckHP 
    } 
  } 
  /if (!${autohealmode}) /goto :loop 
  /if (${autohealmode} == 1 && ${Me.PctHPs} <= ${selfhealpoint}) { 
    /call Healself 
    /goto :loop 
  } 
  /if (${autohealmode} >= 2) { 
    /if (${Me.PctHPs} <= ${selfhealpoint}) /call Healself 
    /call Healgroup 
  } 
  /if (${NearestSpawn[npc].Distance} > ${distancetosit} && !${SelfBuffTimer}) /call BuffSelf 
  /goto :loop 
/return 

Sub TankCheck 
  /if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0 
  /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) { 
    /if (${SpawnCount[${tankname} ${tankclass}]}) { 
      /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID} 
      /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid} 
    } 
    /if (${SpawnCount[${tankname} ${tankclass}]}>1) { 
      /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
        /beep 
        /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
        /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro 
      } else { 
        /beep 
        /echo Need to restart macro to correctly identify the MT 
      } 
    } 
  } 
  /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) { 
    /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
      /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
      /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro 
    } 
  } 
  /if (!${Spawn[${tanknameid}].ID} && !${nomtspam}) { 
    /e Warning No Designated MT is available 
    /varset nomtspam 300 
  } 
/return 

Sub Healself 
  /if (${usedivarb} && ${Me.PctHPs} <= ${divarbpoint}) /call Divarbcast 
  /if (${Me.PctHPs} > ${selfhealpoint} || ${Me.Buff[Divine Aura].ID} || ${Me.Buff[Sacred Barrier].ID} || ${Me.Buff[Divine Barrier].ID}) /return 
  /target myself 
  /delay 1s ${Target.ID} == ${Me.ID} 
  /if (${Me.PctHPs} < ${selfhealpoint} && ${Me.PctHPs} > ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
    /call Cast "${patchheal}" ${patchhealgem} 0 
  } 
  /if (${Me.PctHPs} <= ${dacastpoint} && ${Me.AltAbilityReady[Sanctuary]}) { 
    /if (${announce}) /${AnnounceChannel} Sanctuary!  Sanctuary! 
    /call cast "Sanctuary" alt 
    /delay 1s 
    /if (${Me.Buff[Sanctuary].ID}) { 
      /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
      /call Cast "${patchheal}" ${patchhealgem} 0 
    } 
  } else /if (${Me.AltAbilityReady[Bestow Divine Aura]} && ${Me.PctHPs} <= ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Bestowing Divine Aura on myself!  NO HEALS FOR 30 SECONDS! 
    /call cast "Bestow Divine Aura" alt 
  } else /if (${Me.SpellReady[${daspell}]} && !${Me.Buff[Divine Aura].ID} && !${Me.Buff[Sacred Barrier].ID} && !${Me.Buff[Divine Barrier].ID}  && ${Me.PctHPs} <= ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS 
    :retryda 
    /call Cast "${daspell}" 1s 
    /if (${Macro.Return.Equal[CAST_INTERRUPTED]}) /goto :retryda 
    /if ((${trickyda}==1)&&(${Me.Buff[${daspell}].ID})) /call TrickyDA 
    :dawait 
    /if (${Me.Buff[${daspell}].ID}) { 
      /delay 1s !${Me.Buff[${daspell}].ID} 
      /doevents 
      /goto :dawait 
    } 
  }            
/return 

Sub Healgroup 
  :healgroup 
  /varset worsthurt NULL 
  /varset worsthp 100 
  /varset worstclass NULL 
  /varset minorhurt 0 
  /varset majorhurt 0 
  /for gmember 0 to ${Group.Members} 
    /if (!${onlyhealfd}) { 
      /if (${Group.Member[${gmember}].Distance}<=${patchhealrange} && ${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} 
       } 
    } else { 
      /if (${Group.Member[${gmember}].Distance}<=${patchhealrange} && ${Group.Member[${gmember}].PctHPs}<=${worsthp}) { 
        /if (!${Select[${Group.Member[${gmember]}.Class.ShortName}],MNK,NEC}) { 
          /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} 
        } else /if (${Group.Member[${gmember}].State.Equal[feign]}) { 
          /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}].PctHPs} < 80 && ${Group.Member[${gmember}].PctHPs} > 60 && ${Group.Member[${gmember}].Distance} < ${groupspellrange}) /varcalc minorhurt ${minorhurt}+1 
    /if (${Group.Member[${gmember}].PctHPs} < 60 && ${Group.Member[${gmember}].PctHPs} > 1 && ${Group.Member[${gmember}].Distance} < ${groupspellrange}) /varcalc majorhurt ${majorhurt}+1 
  /next gmember 
  /if (${autohealmode}==3) { 
    /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].PctHPs} < ${tankhealpoint} && ${Spawn[${tanknameid}].Distance} < ${healspellrange}) /return 
    /if (${Me.PctHPs} <= ${selfhealpoint}) /return 
  } 
  /if (!${majorhurt} && !${minorhurt}) /return 
  /if (${usedivarb} && ${worsthp} && ${worsthp} <= ${divarbpoint}) /call Divarbcast 
  /if (${majorhurt}+${minorhurt} >= 3 && ${usegroupheal} && ${Me.SpellReady[${groupheal}]}) { 
    /if (${announce}==1) /${AnnounceChannel} Inc Grp Heal, get close 
    /call Cast "${groupheal}" ${grouphealgem} 1s 
    /return 
  } 
  /if (${meleeClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].ID}) { 
    /if (${worsthp} <= ${tankhealpoint} && ${worsthp} >= ${tankhealpoint}*.7 && ${majorhurt} <= 1 && ${Me.SpellReady[${healspell}]}&& ${Spawn[${worsthurtid}].Distance} < ${healspellrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${healspell} on ${Target.CleanName} 
      /call Cast "${healspell}" ${healspellgem} 0 CheckHP 
      /return 
    } else /if (${worsthp} <= ${tankhealpoint}*.7 && ${majorhurt} <= 1 && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
      /call Cast "${patchheal}" ${patchhealgem} 4s CheckHP 
      /return 
    } 
  } else /if (${casterClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].ID} && ${worsthurtid} != ${Me.ID}) { 
    /if (${worsthp} < ${casterhotpoint} && ${worsthp} > ${casterpatchpoint} && ${worsthp} && ${Me.SpellReady[${hotspell}]} && ${Spawn[${worsthurtid}].Distance} < ${hotspellrange} && !${NoHotID[${Group.Member[${worsthurt}]}]}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${hotspell} on ${Target.CleanName} 
      /call Cast "${hotspell}" ${hotspellgem} 0 CheckHP 
      /varset NoHotID[${Group.Member[${worsthurt}]}] ${worsthurtid} 
      /timed 400 NoHotID[${Group.Member[${worsthurt}]}] 0 
      /return 
    } else /if (${worsthp} < ${casterpatchpoint} && ${worsthp} && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
      /call Cast "${patchheal}" ${patchhealgem} 0 CheckHP 
      /return 
    } 
  } else /if (${canniClasses.Find[${worstclass}]} && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].ID}&& ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
    /if (${worsthp} <= ${necshmpatchpoint} && ${worsthp}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
      /call Cast "${patchheal}" ${patchhealgem} 0 CheckHP 
      /return 
    } 
  } else /if (${worsthp} <= ${defaultpatchpoint} && ${worsthp} && ${Spawn[${worsthurtid}].ID} && ${Me.SpellReady[${patchheal}]}&& ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
    /squelch /target id ${worsthurtid} 
    /delay 5 ${Target.ID}==${worsthurtid} 
    /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
    /call Cast "${patchheal}" ${patchhealgem} 0 CheckHP 
    /return 
  } 
  /if (${Spawn[${tanknameid}].PctHPs} > ${healpct} || !${Spawn[${tanknameid}].ID} || ${Spawn[${tanknameid}].Type.Equal[corpse]} && ${healpetmode} && ${Me.PctMana} > ${manatohealpet}) /call HealPet 
/return 

Sub Divarbcast 
  /if (${Me.Casting.ID}) /call Interrupt 
  /if (${announce}) /${AnnounceChannel} Inc Divine Arbitration / Epic 
  /if (${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) { 
    /call Cast "Aegis of Superior Divinity" item 0 
    /return 
  } else /if (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) { 
    /call Cast "Harmony of the Soul" item 0 
    /return 
  } else /if (${Me.AltAbilityReady[Divine Arbitration]}) { 
    /call Cast "Divine Arbitration" alt 0 
    /return 
  } 
  /declare q int local 
  /for q 0 to ${Group} 
    /if (${Group.Member[${q}].PctHPs}<=${DivArbHPs} && ${Me.AltAbilityReady[Bestow Divine Aura]} && ${Group.Member[${q}].ID}!=${tanknameid} && ${Group.Member[${q}].Distance} < 200) { 
      /if (${Me.Casting.ID}) /call Interrupt 
      /squelch /target id ${Group.Member[${q}].ID} 
      /delay 1s ${Target.ID}==${Group.Member[${q}].ID} 
      /if (${announce}) /${AnnounceChannel} Bestowing Divine Aura on: ${Target.CleanName} 
      /call Cast "Bestow Divine Aura" alt 5s 
    } 
  /next q 
/return 

Sub HealPet 
   /if (${Me.Invis}) /return 
   /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.Length}) { 
      /if (${Spawn[${worsthurtid}].Type.NotEqual[Pet]}) /return 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (!${Target.ID}) /return 
      /if (${Target.ID}!=${worsthurtid}) /return 
      /delay 3 
      /if (${Target.PctHPs} < ${pethealpoint}) { 
         /if (${announce}==1) /${AnnounceChannel} Casting ${pethealspell} on ${Target.CleanName} 
         /varcalc stophealpoint ${pethealpoint}+5 
         /call Cast "${pethealspell}" spell 0 CheckHP 
         /varset stophealpoint ${defaultstophealpoint} 
         /delay 15 ${Me.SpellReady[${pethealspell}]} 
      } 
   } 
/return 

Sub MedTime 
  /if (${FindItem["Rod of Mystical Transvergance"].InvSlot} && ${Me.PctMana}<=70 && ${Me.PctHPs} > 70 && !${FindItem["Rod of Mystical Transvergance"].Timer}) /call Cast "Rod of Mystical Transvergance" item 
  /if (${autosit} && ${Me.PctMana}<=98 && !${Me.Casting.ID} && ${Me.Standing} && !${Following} && !${NearestSpawn[1,npc radius ${distancetosit} zradius 30].Distance} && !${Me.Buff[${yaulpspell}].ID} && !${Me.Moving}) /sit 
  /if (${Me.Standing} && !${Me.Mount.ID} && ${Me.SpellReady[${yaulpspell}]} && !${Me.Buff[${yaulpspell}].ID} && !${Me.Buff[Spiritual Vigor].ID} && !${Me.Buff[Strength of Tunare].ID} && !${Me.Buff[Spiritual Vitality].ID}) /call Cast "${yaulpspell}" ${yaulpgem} 
  /if (${Me.Sitting} && !${Window[SpellBookWnd].Open} && (${NearestSpawn[1,npc radius ${distancetosit} zradius 30].Distance} || ${Me.PctMana} > 95)) /stand 
  /if (${Me.PctMana} < 20 && ${announce} && !${oomspam}) { 
    /${AnnounceChannel} ${Me.PctMana} Mana 
    /varset oomspam 600 
  } 
/return 

Sub BuffSelf 
  /if (${Me.Invis}) /return 
  /declare i int local 
  /for i 1 to ${SelfBuffTotal} 
    /if (${Spell[${SelfBuffIcon${i}}].Stacks} && ((${SelfBuffGem${i}.Find[gem]} && ${Me.CurrentMana} > ${Spell[SelfBuff${i}].Mana}) || (${SelfBuffGem${i}.Equal[item]} && !${FindItem[${SelfBuff${i}}].Timer}) || (${SelfBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff${i}}]}))) { 
      /if (${SelfBuffGem${i}.Find[gem]} && ${Me.Gem[${SelfBuff${i}}]} && (!${Me.SpellReady[${SelfBuff${i}}]} || ${Me.CurrentMana} < ${Spell[${SeflBuff${i}}].Mana})) /next i 
      /squelch /target id ${Me.ID} 
      /delay 1s ${Target.ID}==${Me.ID} 
      /if (${Verbose}) /${AnnounceChannel} Buffing myself with ${SelfBuffIcon${i}} 
      /call Cast "${SelfBuff${i}}" ${SelfBuffGem${i}} 6s 
      /squelch /target clear 
    }    
  /next i 
  /varset SelfBuffTimer 10 
/return 

Sub CheckHP 
  /if (${autointerrupt} && ${Target.PctHPs} >= ${stophealpoint} && (${Me.Casting.Name.Equal[${healspell}]} || ${Me.Casting.Name.Equal[${patchheal}]} || ${Me.Casting.Name.Equal[${hotspell}]})) { 
    /if (${announce} && !${duckspam}) /${AnnounceChannel} Ducking heal on ${Target.CleanName} 
    /if (!${duckspam}) /varset duckspam 100 
    /call Interrupt 
    /return 
  } 
  /if (${interrupt2healself} && ${Me.PctHPs} < ${interrupt2healselfhp}) { 
    /if (${usedivarb} && ${Me.PctHPs} < ${divarbpoint} && ((${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) || (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) || (${Me.AltAbilityReady[Divine Arbitration]}))) { 
      /call Interrupt 
      /call Divarbcast 
      /return 
    } else { 
      /if (!${duckselfspam}) /docommand /${AnnounceChannel} Ducking heal on ${Target.CleanName} so I can heal myself 
      /varset duckselfspam 100 
      /call Interrupt 
      /call HealSelf 
      /return 
    } 
  } 
  /if (${onlyhealfd} && ${Select[${Target.Class.ShortName}],MNK,NEC} && ${Target.State.NotEqual[feign]}) { 
    /if (${announce} && !${duckfdspam}) /${AnnounceChannel} Ducking heal on ${Target.CleanName} because they won't stay down! 
    /if (!${duckfdspam}) /varset duckfdspam 400 
    /call Interrupt 
    /return 
  } 
  /if (${Me.Casting.Name.Equal[${hotspell}]} && ${casterClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].PctHPs} < ${casterpatchpoint}) { 
    /if (${announce} && !${duckspam}) /${AnnounceChannel} Ducking HoT on ${Target.CleanName} to patch heal! 
    /if (!${duckfdspam}) /varset duckfdspam 400 
    /call Interrupt 
    /return 
  } 
  /if (${usedivarb} && ${castEndTime}>=${interrupt2divarb} && ((${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) || (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) || (${Me.AltAbilityReady[Divine Arbitration]}))) { 
    /for gmember 0 to ${Group} 
      /if (${Group.Member[${gmember}].PctHPs} < ${divarbpoint} && ${Group.Member[${gmember}].Distance} < 200 && ${Spawn[${Group.Member[${gmember}].ID}].ID}) { 
        /call Interrupt 
        /call Divarbcast 
        /return 
      } 
    /next gmember 
  } 
/return 

Sub TrickyDA 
   /for intcount 1 to 20 
      /if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup 
   /next intcount 
   /if (${Me.Buff[${daspell}].ID}) { 
      :waitalittle 
      /delay 1s ${Me.Buff[${daspell}].Duration}<2 
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle 
   } 
/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}]}) { 
      /squelch /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 (${MasterOnly}) /if (!${MasterList.Find[${Sender}]} ) /return 
  /if (!${Spawn[${Sender}].ID}) { 
    /e ${Sender} is not in the zone 
    /return 
  } 
  /if (${ChatText.Equal[Follow me]}) { 
    /target ${Sender} 
    /delay 3 
    /varset followid ${Target.ID} 
    /varset Following TRUE 
    /varset FollowName ${ChatSender} 
    /squelch /stick 20 hold 
    /doevents 
  } 
  /if (${ChatText.Equal[Stay Here]}) { 
    /varset FollowTank    FALSE 
    /varset StaticCamp    FALSE 
    /squelch /stick off 
    /timed 50 /face pc ${follname} 
  } 
  /if (${ChatText.Equal[Make Camp]}) { 
    /varset MovingCamp    FALSE 
    /varset Following FALSE 
    /squelch /stick off 
    /varset  HomeX ${Me.X} 
    /varset  HomeY ${Me.Y} 
  } 
   /if (${ChatText.Equal[nuke]}) { 
      /if (${Me.PctMana}<30) { 
         /${AnnounceChannel} Cleric Mana ${Me.PctMana}%, holding on nukes! 
      } else { 
         /assist ${Sender} 
         /delay 5 
         /if (${Target.Type.NotEqual[NPC]}) { 
            /assist ${Sender} 
            /delay 5 ${Target.Type.Equal[NPC]} 
         } 
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
            /if (${Me.SpellReady[${nukeone}]}) { 
               /if (${announce}==1) /${AnnounceChannel} Casting ${nukeone} on ${Target.CleanName} 
               /call Cast "${nukeone}" spell 3s 
            } else /if (${Me.SpellReady[${nuketwo}]}) { 
               /if (${announce}==1) /${AnnounceChannel} Casting ${nuketwo} on ${Target.CleanName} 
               /call Cast "${nuketwo}" spell 3s 
            } else { 
              /${AnnounceChannel} nukes not ready 
            } 
            /if (${Me.PctMana}<=60) /${AnnounceChannel} FYI Cleric Mana ${Me.PctMana}% 
         } else { 
           /${AnnounceChannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
         } 
      } 
   } 
   /if (${ChatText.Equal[stun]}) { 
      /assist ${Sender} 
      /delay 5 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /assist ${Sender} 
         /delay 5 ${Target.Type.Equal[NPC]} 
      } 
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
         /if (${Me.SpellReady[${stunone}]}) { 
            /if (${announce}==1) /${AnnounceChannel} Casting ${stunone} on ${Target.CleanName} 
            /call Cast "${stunone}" spell 3s 
         } else /if (${Me.SpellReady[${stuntwo}]}) { 
            /if (${announce}==1) /${AnnounceChannel} Casting ${stuntwo} on ${Target.CleanName} 
            /call Cast "${stuntwo}" spell 3s 
         } else { 
           /${AnnounceChannel} stuns not ready 
         } 
      } else { 
        /${AnnounceChannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
      } 
   } 
   /if (${ChatText.Equal[wov]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${announce}) /${AnnounceChannel} Casting ${acbuff} on ${Target.CleanName} 
      /call Cast "${acbuff}" gem9 0 CheckHP 
   } 
   /if ((${ChatText.Equal[patch me]})||(${ChatText.Equal[heal]})||(${ChatText.Equal[heal me]})||(${ChatText.Equal[heal plz]})||(${ChatText.Equal[heal me plz]})||(${ChatText.Equal[need heal]})) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=${patchhealrange}) { 
         /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
         /call Cast "${patchheal}" ${patchhealgem} 2s 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else { 
        /tell ${Sender} you're out of range 
      } 
   } 
   /if ((${ChatText.Equal[balikor]})||(${ChatText.Equal[conviction]})||(${ChatText.Equal[devotion]})||(${ChatText.Equal[rgc]})||(${ChatText.Equal[hot me]})||(${ChatText.Equal[ch me]})||(${ChatText.Equal[pb]})) { 
      /if (${Spawn[pc ${Sender}].Distance}>200) /return 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
   } 
   /if (${ChatText.Equal[balikor]}) { 
     /if (${announce}) /${AnnounceChannel} Casting ${singlesymbuff} on ${Target.CleanName} 
     /call Cast "${singlesymbuff}" gem9 0 CheckHP 
   } 
   /if (${ChatText.Equal[conviction]}) { 
     /if (${announce}) /${AnnounceChannel} Casting ${longhpbuff} on ${Target.CleanName} 
     /call Cast "${longhpbuff}" gem9 0 CheckHP 
   } 
   /if (${ChatText.Equal[devotion]} || ${ChatText.Find[spell haste]}) { 
      /call Cast "${spellhastebuff}" gem9 0 CheckHP 
   } 
   /if (${ChatText.Equal[rgc]}) { 
      /if (${FindItem[Blackflame Sphere].ID}) { 
         /call Cast "Blackflame Sphere" item 
      } else /if (${FindItem[Wand of Casual Blessings].ID}) { 
         /call Cast "Wand of Casual Blessings" item 
      } else { 
        /call Cast "${rgcspell}" gem7 0 CheckHP 
      } 
   } 
   /if (${ChatText.Equal[buff pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 8 
      /target ${Spawn[pc ${Sender}].Pet} 
      /if (${announce}) /${AnnounceChannel} Casting ${acbuff} on ${Target.CleanName} 
      /call Cast "${acbuff}" gem9 0 CheckHP 
      /if (${announce}) /${AnnounceChannel} Casting ${singlesymbuff} on ${Target.CleanName} 
      /call Cast "${singlesymbuff}" gem9 0 CheckHP 
   } 
   /if (${ChatText.Equal[da pet]}) { 
      /if (${DEBUG}) /echo Target 25 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 6 
      /if (${DEBUG}) /echo Target 26 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 3 
      /if (${Me.AltAbilityReady[Bestow Divine Aura]} && ${Target.Name.Equal[${Spawn[pc ${Sender}].Pet.Name}]}) { 
         /call Cast "39" alt 
      } else { 
         /${AnnounceChannel} Bestow Divine Aura is not ready, or Target (${Target.CleanName}) OOR or wrong target 
      } 
   } 
   /if (${ChatText.Equal[pb]}) /call Cast "Pure Blood" gem9 10s 
   /if (${ChatText.Equal[hot me]} && !${Me.Invis}) { 
      /if (${Target.Distance}<=${hotspellrange}&&  ${Me.SpellReady[${hotspell}]}) { 
         /if (${announce}==1) /${AnnounceChannel} Casting ${hotspell} on ${Target.CleanName} 
         /call Cast "${hotspell}" ${patchhealgem} 2s 
      } else { 
        /tell ${Sender} You're out of range. 
      } 
   } 
   /if (${ChatText.Equal[ch me]} && !${Me.Invis} && ${Me.SpellReady[${healspell}]}) { 
      /if (${Target.Distance}<=100) { 
         /if (${announce}==1) /${AnnounceChannel} Casting Complete Healing on ${Target.CleanName} 
         /call Cast ${healspell} ${healspellgem} 0 CheckHP 
      } else { 
        /tell ${Sender} You're out of range. 
      } 
   } 
   /if (${ChatText.Equal[mana check]}) /${AnnounceChannel} Cleric Mana ${Me.PctMana}% 
/return 

Sub ReturnHome 
  /if (${Following} || ${MovingCamp} || !${StaticCamp}) /return 
  /if (${Me.Sitting}) /stand 
  /if (${Math.Distance[${HomeY},${HomeX}]}<10) { 
    /keypress back 
    /return 
  } 
  :MoveHome 
  /delay 1 
  /doevents 
  /face fast nolook loc ${HomeY},${HomeX} 
  /if (${Math.Distance[${HomeY},${HomeX}]}>10) /keypress forward hold 
  /call AreWeStuck 
  /if (${Math.Distance[${HomeY},${HomeX}]}<10) { 
    /keypress forward 
    /keypress back 
    /return 
  } 
  /goto :MoveHome 
  /squelch /target ${tankname} 
  /face fast nolook 
  /squelch /target clear 
/return 

Sub AreWeStuck 
   /doevents 
  /declare  StuckXLoc      int local ${Me.X} 
  /declare  StuckYLoc      int local ${Me.Y} 
  /delay 4 
  /if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) /call MoveAround 
/return 

Sub MoveAround 
  /doevents 
  /keypress forward 
  /keypress back hold 
  /delay 3 
  /keypress back 
  /if (${Math.Rand[2]}) { 
     /keypress strafe_right hold 
  } else { 
     /keypress strafe_left hold 
  } 
  /delay 10 
  /keypress strafe_right 
  /keypress strafe_left 
/return 

Sub Event_MobDead 
  /squelch /stick off 
  /keypress forward 
  /keypress back 
  /if (${Math.Distance[${HomeY},${HomeX}]}>25) /call ReturnHome 
/return 

Sub Event_Zoned 
  /varset  HomeX ${Me.X} 
  /varset  HomeY ${Me.Y} 
  /if (${Following}) { 
    :WaitForLead 
    /delay 10 
    /doevents 
    /squelch /target ${FollowName} 
    /if (!${Target.ID}) /goto :WaitForLead 
    /squelch /stick 20 moveback 
  } 
/return 

Sub Event_ImDead 
  /varset Following FALSE 
  /delay 20s 
  /memspellset ${spellset} 
  /call Wait4Rez 
/return 

Sub Event_GotHit(string line, string attacker) 
  /if (${Me.AltAbility[Divine Retribution]} && ${Me.AltAbilityReady[Divine Retribution]}) /call cast "Divine Retribution" alt 
  /if (!${helpspam}) { 
    /if (${announce}) /${AnnounceChannel} Help Help!  I am being beaten on by ${ClosestSpawn[npc].CleanName} 
    /varset helpspam 100 
  } 
/return

AFCleric.ini

Code:
will update soon
 
Last edited:
cant find IRC inc. and probably spellgem inc. would love to test this out I like to duo warrior cleric but can also do whole group

Ill be your guinea pig if you supply the codes :)
 
ok saw the other post about irc ini not being around so I took out the Irc inc But I noticed it tries to load a spellset but I cant find where to change that. I saw the /declare spell listing but not sure what to change.. any help herE?
 
working somewhat. Im getting tons of spam when my tank falls below he 50% mark but the Complete heal does cast is there a way to output the mq2 window spam to a log file?
 
I actually have an updated version of this that I have spent some time modifying. I have some buggy code I am still working out (parsing issues) but they haven't stopped the macro from running either so that is good.

With mine I made most of the settings adjustable on the fly from ingame instead of having to go into the ini file all the time aswell as make it so you have a seperate ini for all the clerics you might play. Has things like a rez command and I took the icast, iclick, ibounce from rogue helper and built it in aswell.

Biggest thing is cleaning it up and making sure it runs smooth. Anyway, once I am happy with it i will post it.
 
are you getting the spam must have an item on cursor to Identify?


to stop the spam I actually kept my spit on cursor hehe funny seeing it pop up every 15 seconds or so when getting hit
 
LOL no I am not getting that. The parsing issues are with the group healing (which it does anyway) so once again it is just some dirty code that needs to be cleaned up. Also I added XPtracking but I am getting the spam twice so I gotta straighten that out and all should be good at that point.
 
FatHead change this line to get rid of the identify problem

/declare AnnounceChannel string outer i say

to

/declare AnnounceChannel string outer echo
 
I kept forgetting to attach this for those who can't find the IRC plugin....

Sample INI (which it will create when you load anyway):
Code:
[Settings]
Version=MQ2Irc 120703
Username=What-Ini
Realname=mq2irc
UseWnd=No          <------ Sep. window or mq window
ChatTop=0
ChatBottom=210
ChatLeft=0
ChatRight=410
[Last Connect]
Server=irc.serveraddy.net  <----IRC Server
Port=6667           <--------- Port
Chan=#Animalsneedlove    <----------Channel you use
Nick=Ohsmackyo   <--------Your nickname for that channel (use Toon name)

- Chatting with IRC plugin is the command /i say
- Connecting to a server/chan command is /iconnect SERVER PORT CHANNEL NICKNAME
- Type /i help for help list
- Once you type /iconnect w/ all the parameters it will be saved in INI and from then on you can just do /iconnect and whatever's listed in INI under [Last Connect] it will use those values.
 

Attachments

  • MQ2IRC.dll
    116.1 KB · Views: 108
Troll said:
I actually have an updated version of this that I have spent some time modifying. I have some buggy code I am still working out (parsing issues) but they haven't stopped the macro from running either so that is good.

With mine I made most of the settings adjustable on the fly from ingame instead of having to go into the ini file all the time aswell as make it so you have a seperate ini for all the clerics you might play. Has things like a rez command and I took the icast, iclick, ibounce from rogue helper and built it in aswell.

Biggest thing is cleaning it up and making sure it runs smooth. Anyway, once I am happy with it i will post it.

Can u post yours, this one works but would like th ability to adjust on the fly and maybe set MA and or SA etc
 
Ya give me some time. I am still working out the group healing kinx but haven't had time lately.
 
Would it be possible to add a battle cleric version of this? Say, cast pet hammer, step into combat, cast yalp, and melee while watching MA's health and still do all the heal stuff it does now? That would just rock.

-Drak
 
My version casts Yalp already.... I manually added the ability to cast MoB and MoR and Summon Hammer when I tell it too....

But I never had mine step in and start swingin. I also no longer have the desire to try and do this either due to retirement. Sry.
 
Troll said:
My version casts Yalp already.... I manually added the ability to cast MoB and MoR and Summon Hammer when I tell it too....

But I never had mine step in and start swingin. I also no longer have the desire to try and do this either due to retirement. Sry.

Could u post your Version, troll ?
 
Troll, would you mind shareing your version? It would be much appreciated :)

-Drak
 
Okay here is my highly modified version. Yes there is still a few kinks in it such as.... Group Heals tend to give errors I never fixed. doesn't end macro but IIRC it doesn't cast the group heal either... it is because of the way it determines who is the most hurt etc.... and the XP Msgs are messed up giving doubles outputs.... probable because of Leadership XP but I never fixed this either.

It has 2 announces. 1 was for a private channel I had so I could still see things moving to monitor it and then standard group announce.

Basically EVERYTHING is dynamic/setable in game without having to restart macro. If you change the % or which spell to heal with though you need to still restart it.

also has a /tell <CLR> rezthis command where it will rez the corpse you have targeted.

INI files personalized for each CLR you may play. I played alot and they weren't all the same gearwise etc...

Also added Rogue Helpers /icast /ibounce /iset commands for clickies such as PG Mana Regen Belts and the likes.

Will use 1.5/2.0/dva/divine retribution if you have them aswell

I will try to answer questions you may have but someone else will have to screw with the code now because I don't play anymore.

Hope it works out for you.

OH you need Moveutils and MQ2Exchange loaded

Code:
|**---------------------------------------------------------- 
 AFC.mac 

 Run the macro with Main Tank targeted.    
    Usage: /mac AFC <%health> <Heal spell> 
    Defaults to casting Complete Healing at 60% 

 This Cleric macro operates in 4 modes: 

    autohealmode=0 will watch a single target's health 
    relentlessly. The cleric will not heal self or group, only 
    the specified Tankname at the specified %health. 
    If the Tank takes dmg fast enough that HP is less than 70% 
    of the specified %health, the patchspell will be cast. 
    The Tank does not need to be in your group. 
    
    autohealmode=1 will watch Tank as above, but also heal 
    self and even attempt to cast DA if self HP get too low. 
    
    autohealmode=2 will watch Tank, self, and also the rest of 
    the group. Heals will go first to the person in group with 
    lowest HP percentage. Healtypes for people other than Tank 
    and self will be based on Class and HP percentage. 
    
    autohealmode=3 is exactly the same as mode 2, except that 
    Tank HP and self HP are double checked immediately before 
    healing anyone else. If Tank or self HP are low enough to 
    justify a heal, they get it first even if other group 
    members have lower HP. IE: it tries not to let Tank or 
    self die while healing that overnuking wizard. =) 
 
 ----------------------------------------------------------** 

**********************************************************************************
 COMMANDS FOR IN GAME CHANGES
**********************************************************************************
 /setspellset <SpellSetName>
 /sethealspell <SpellName>
 /sethealspellgem <Gem1…9>
 /setpatchheal <SpellName>
 /setpatchhealgem <Gem1…9>
 /sethotspell <SpellName>
 /sethotspellgem <Gem1…9>
 /setgrouplonghpbuff <SpellName>
 /setgrouplonghpbuffgem <Gem1…9>
 /setyaulpspell <SpellName>
 /setyaulpspellgem <Gem1…9>
 /setgroupheal <SpellName>
 /setgrouphealgem <Gem1…9>
 /setmitigationspell <SpellName>
 /setmitigationspellgem <Gem1…9>
 /setselfbuff <SpellName>
 /setselfbuffgem <Gem1…9>
 /setdaspell <SpellName>
 /setdaspellgem <Gem1…9>
 /setnukeone <SpellName>
 /setnuketwo <SpellName>
 /setstunone <SpellName>
 /setstuntwo <SpellName>
 /setspellhaste <SpellName>
 /setacbuff <SpellName>
 /setlonghpbuff <SpellName>
 /setsinglesymbuff <SpellName>
 /setgroupsymbuff <SpellName>
 /setspellhastebuff <SpellName>
 /setmainitem <ItemName>
 /setsecondaryitem <ItemName>
 /setannouncechannel <1….0>
 /setautohealmode <0,1,2, or 3>
 /setusegroupheal <0 or 1>
 /setusedivarb <0 or 1>
 /sethealafterdivarb <0 or 1>
 /setannounce <0 or 1>
 /setgroupannounce <0 or 1>
 /setautosit <0 or 1>
 /setautointerrupt <0 or 1>
 /setonlyhealfd <0 or 1>

 Slot Names= charm, leftear, rightear, hand, face, neck, shoulder, arms, back,
 leftwrist, rightwrist, ranged, hands, mainhand, offhand, leftfinger, rightfinger,
 chest, legs, waist, ammo, pack1, pack2, pack3, pack4, pack5, pack6, pack7, pack8
 **********************************************************************************
 Target a Corpse and send a tell you Cleric that says "rezthis" to have cleric
 switch to corpse and rez then go back to healing

 Send a tell to the Cleric that says "tanking" to have the cleric cast Mark of the
 Blameless, Mark of the Righteous, and Unswerving Hammer of Retribution on your
 target 
 **********************************************************************************|

#Event GotHit       "#*# YOU for#*#" 
|#Event MobDead      "#*#You have slain#*#" 
|#Event MobDead      "#*#has been slain by#*#" 
#Event Zoned        "#*#You have entered#*#" 
#Event ImDead       "You have been slain by#*#" 
#Event Exp          "#*#You gain#*#experience#*#"
#Event ItemSet      "[MQ2] ItemSet#*#"
#Event ItemBounce   "[MQ2] ItemBounce#*#"
#Event ItemCast     "[MQ2] ItemCast#*#"
#Event TogPause     "[MQ2] Pause#*#"

#Chat  Chat 
#Chat  Tell 
#Chat  Group 

#include spell_routines.inc

#include gen_routines.inc 
#include wait4rez.inc
#turbo 40  

Sub Main 

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

|   /declare MasterList string outer "MASTERLIST" 
|   /declare MasterOnly outer TRUE 
|   /call IRCDeclares

   /declare z int outer
   /declare Exper float outer 
   /declare AAExp float outer 
   /declare LDRExp float outer
   /declare ialias string outer None
   /declare doIclick bool outer FALSE
   /declare bouncenum int outer 1
   /declare ibounce string outer None  
   /declare clicktimer timer outer 0
   /declare lastevent string outer None
   /declare verbosity int outer 2
   /declare channel string outer echo
   /declare isPaused bool outer FALSE
   /declare itemspellname string outer None

   /varset Exper ${Me.PctExp} 
   /varset AAExp ${Me.PctAAExp} 
   /varset LDRExp ${Me.PctGroupLeaderExp}

   /squelch /alias /iset /echo ItemSet
   /squelch /alias /ibounce /echo ItemBounce
   /squelch /alias /iclick /echo ItemCast
   /squelch /alias /pause /echo Pause
   
   /call GeneralDeclares 

   /call DeclareIniVar spellset             string Settings "Default" /setspellset
   /call DeclareIniVar healspell            string Settings "Complete Healing" /sethealspell
   /call DeclareIniVar healspellgem         string Settings gem1 /sethealspellgem
   /call DeclareIniVar patchheal            string Settings "Pious Light" /setpatchheal
   /call DeclareIniVar patchhealgem         string Settings gem2 /setpatchhealgem
   /call DeclareIniVar hotspell             string Settings "Pious Elixir" /sethotspell
   /call DeclareIniVar hotspellgem          string Settings gem3 /sethotspellgem
   /call DeclareIniVar grouplonghpbuff      string Settings "Hand of Conviction" /setgrouplonghpbuff
   /call DeclareIniVar grouplonghpbuffgem   string Settings gem4 /setgrouplonghpbuffgem
   /call DeclareIniVar yaulpspell           string Settings "Yaulp VII" /setyaulpspell
   /call DeclareIniVar yaulpspellgem        string Settings gem5 /setyaulpspellgem
   /call DeclareIniVar groupheal            string Settings "Word of Vivification" /setgroupheal
   /call DeclareIniVar grouphealgem         string Settings gem6 /setgrouphealgem
   /call DeclareIniVar mitigationspell      string Settings "Panoply of Vie" /setmitigationspell
   /call DeclareIniVar mitigationspellgem   string Settings gem7 /setmitigationspellgem
   /call DeclareIniVar selfbuff             string Settings "Armor of the Pious" /setselfbuff
   /call DeclareIniVar selfbuffgem          string Settings gem8 /setselfbuffgem
   /call DeclareIniVar daspell              string Settings "Divine Barrier" /setdaspell
   /call DeclareIniVar daspellgem           string Settings gem9 /setdaspellgem
   /call DeclareIniVar nukeone              string Settings "Reproach" /setnukeone
   /call DeclareIniVar nuketwo              string Settings "Order" /setnuketwo
   /call DeclareIniVar stunone              string Settings "Sound of Divinity" /setstunone
   /call DeclareIniVar stuntwo              string Settings "Shock of Wonder" /setstuntwo
   /call DeclareIniVar spellhaste           string Settings "Blessing of Devotion" /setspellhaste
   /call DeclareIniVar acbuff               string Settings "Ward of Valiance" /setacbuff
   /call DeclareIniVar longhpbuff           string Settings "Conviction" /setlonghpbuff
   /call DeclareIniVar singlesymbuff        string Settings "Symbol of Balikor" /setsinglesymbuff
   /call DeclareIniVar groupsymbuff         string Settings "Balikor's Mark" /setgroupsymbuff
   /call DeclareIniVar spellhastebuff       string Settings "Blessing of Devotion" /setspellhastebuff
   /call DeclareIniVar rgcspell             string Settings "Remove Greater Curse"
   /call DeclareIniVar mainitem             string Settings "Crystallized Mind" /setmainitem
   /call DeclareIniVar secondaryitem        string Settings "Blood Defender" /setsecondaryitem
    
   /call DeclareIniVar AnnounceChannel      int    Settings 1 /setannouncechannel
   /call DeclareIniVar autohealmode         int    Settings 2 /setautohealmode
   /call DeclareIniVar lootleft             int    Settings 0
   /call DeclareIniVar healspellrange       int    Settings 120 
   /call DeclareIniVar patchhealrange       int    Settings 200 
   /call DeclareIniVar hotspellrange        int    Settings 120 
   /call DeclareIniVar groupspellrange      int    Settings 100 
   /call DeclareIniVar usegroupheal         int    Settings 0 /setusegroupheal
   /call DeclareIniVar usedivarb            int    Settings 1 /setusedivarb
   /call DeclareIniVar healafterdivarb      int    Settings 0 /sethealafterdivarb
   /call DeclareIniVar announce             int    Settings 0 /setannounce
   /call DeclareIniVar groupannounce        int    Settings 0 /setgroupannounce
   /call DeclareIniVar autosit              int    Settings 1 /setautosit
   /call DeclareIniVar distancetosit        int    Settings 40 
   /call DeclareIniVar autointerrupt        int    Settings 1 /setautointerrupt
   /call DeclareIniVar onlyhealfd           int    Settings 1 /setonlyhealfd
   /call DeclareIniVar interrupt2healself   int    Settings 1 
   /call DeclareIniVar interrupt2healselfhp int    Settings 40 
   /call DeclareIniVar noInvis              int    Settings 1 
   /call DeclareIniVar defaultstophealpoint int    Settings 100 
   /call DeclareIniVar healpetmode          int    Settings 0 
   /call DeclareIniVar pethealpoint         int    Settings 65 
   /call DeclareIniVar manatohealpet        int    Settings 90 
   /call DeclareIniVar pethealspell         string Settings "Pious Light" 
   /call DeclareIniVar pethealspellrange    int    Settings 200 
   /declare followid             int    outer 
   /declare meleeClasses         string outer "Warrior/ShadowKnight/Paladin" 
   /declare casterClasses        string outer "Cleric/Druid/Enchanter/Wizard/Magician" 
   /declare dpsClasses           string outer "Rogue/Monk/Beastlord/Berserker/Bard/Ranger" 
   /declare canniClasses         string outer "Necromancer/Shaman" 
   /declare NoHotID[6]           int    outer 0 

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

   /declare selfhealpoint        int outer 70 
   /declare dacastpoint          int outer 25 
   /declare divarbpoint          int outer 30 
   /declare interrupt2divarb     int outer 20 
   /declare tankhealpoint        int outer 60 
   /declare casterhotpoint       int outer 85 
   /declare casterpatchpoint     int outer 70 
   /declare necshmpatchpoint     int outer 60 
   /declare defaultpatchpoint    int outer 70 

| ############ Self Buff List.    
  /declare SelfBuffRecheck   int    outer 600 
  /declare SelfBuffTimer     timer  outer 0 

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

   /declare MovingCamp            outer FALSE 
   /declare Following             outer FALSE 
   /declare FollowName     string outer 
   /declare StaticCamp            outer TRUE 
   /declare askforbuffs           outer TRUE 
   /declare HomeX          int    outer ${Me.X} 
   /declare HomeY          int    outer ${Me.Y} 
   /declare healpct        int    outer 50 
   /declare tanknameid     int    outer 0 
   /declare minorhurt      int    outer 0 
   /declare majorhurt      int    outer 0 
   /declare worsthurtid    int    outer 0 
   /declare worsthp        int    outer 100 
   /declare gmember        int    outer 0 
   /declare worsthurt      string outer NULL 
   /declare worstclass     string outer NULL 
   /declare nohotforua     string outer NoOne 
   /declare nohotforub     string outer NoOne 
   /declare nohotforuc     string outer NoOne 
   /declare nohotforud     string outer NoOne 
   /declare tankname       string outer ${Target} 
   /declare DefaultMT      string outer DEFAULTMT 
   /declare tankclass      string outer 
   /declare rodwait        int    outer 0 
   /declare pallycount     int    outer 0 
   /declare stophealpoint  int    outer ${defaultstophealpoint} 
   /declare oomspam        timer  outer 600 
   /declare duckspam       timer  outer 100 
   /declare duckfdspam     timer  outer 400 
   /declare duckselfspam   int    outer 1 
   /declare nomtspam       timer  outer 300 
   /declare aetime         int    outer 0 
   /declare helpspam       timer  outer 50 
    
  /if (!${Target.ID} && ${Spawn[pc ${DefaultMT}].ID}) { 
    /varset tanknameid ${Spawn[pc ${DefaultMT}].ID} 
    /varset tankclass ${Spawn[pc ${DefaultMT}].Class.Name} 
  } else { 
      /varset tanknameid ${Target.ID} 
      /varset tankclass ${Target.Class.Name} 
  } 
  /if (${Defined[Param0]}) {    
    /varset healpct ${Param0} 
  } else { 
    /echo No Heal% specified, defaulting to 60% 
  } 
  /if (!${Defined[Param1]}) {    
    /echo Usage: /mac AFCleric % healspell 
    /echo Example: /mac AFCleric 40 Complete Heal 
    /echo Defaulting to ${healspell} at ${healpct}% 
  } else {    
    /if (!${Defined[Param2]}) { 
       /varset healspell ${Param1} 
    } else /if (!${Defined[Param3]}) { 
       /varset healspell ${Param1} ${Param2} 
    } else /if (!${Defined[Param4]}) { 
       /varset healspell ${Param1} ${Param2} ${Param3} 
    } else { 
     /varset healspell ${Param1} ${Param2} ${Param3} ${Param4} 
    } 
  } 

  /echo AFCleric Active, running in Autohealmode ${autohealmode} 
  /echo Casting ${healspell} on ${tankname} at ${healpct}% HP 
  /if (${autohealmode}==0) /echo ONLY ${tankname} will be healed 
  /if (${autohealmode}==1) /echo ONLY ${tankname} and myself will be healed 
  /if (${autohealmode}==2) /echo ${tankname}, myself and my group will be healed 
  /if (${autohealmode}==3) /echo ${tankname} and myself will be healed before the rest of the group 
  /if (!${InvSlot[charm].Item.Name.Length} && !${InvSlot[chest].Item.Name.Length} && !${InvSlot[head].Item.Name.Length} ) /call Event_ImDead 
  /memspellset ${spellset} 
  
  :loop 
  /if (${GameState.Equal[CHARSELECT]}) /end 
  /if (!${Spawn[${tanknameid}].ID} || ${Spawn[${tanknameid}].Type.Equal[NPC]}) /call TankCheck 
  /if (!${Target.ID} || ${Target.ID}!=${tanknameid} && ${Spawn[${tanknameid}].Type.NotEqual[Corpse]} && ${Spawn[${tanknameid}].ID} && !${Spawn[${tanknameid}].Type.Equal[NPC]}) { 
    /target id ${tanknameid} 
    /delay 5 ${Target.ID} == ${tanknameid} 
  } 
  /doevents 
  /if (${Me.Invis} || ${Following} || ${Me.Buff[Divine Aura].ID} || ${Me.Buff[Sacred Barrier].ID} || ${Me.Buff[Divine Barrier].ID}) /goto :loop 
  /if (${Me.PctHPs} > ${selfhealpoint} && ${Me.PctMana} < 95) /call MedTime 
  /if (${Target.ID}==${tanknameid} && ${Target.Type.NotEqual[corpse]}) { 
    /if (${Target.Distance} <= ${patchhealrange} && ${Target.PctHPs} <= ${healpct}*.7 && ${Me.SpellReady[${patchheal}]}) { 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${patchheal}" ${patchhealgem} 1s CheckHP 
    }  
    /if (${Target.Distance} <= ${healspellrange} && ${Target.PctHPs}<= ${healpct} && ${Target.PctHPs} >= ${healpct}*.7 && ${Me.SpellReady[${healspell}]}) { 
      /if (${announce}) /${AnnounceChannel} Casting "${healspell}" on ${Target.CleanName} in ${Spell[${healspell}].CastTime} seconds! 
      /if (${groupannounce}) /g ${healspell} on ${Target.CleanName} Incoming
      /call Cast "${healspell}" ${healspellgem} 1s CheckHP 
    } 
  } 
  /if (!${autohealmode}) /goto :loop 
  /if (${autohealmode} == 1 && ${Me.PctHPs} <= ${selfhealpoint}) { 
    /call Healself 
    /goto :loop 
  } 
  /if (${autohealmode} >= 2) { 
    /if (${Me.PctHPs} <= ${selfhealpoint}) /call Healself 
    /call Healgroup 
  } 
  /if (${NearestSpawn[npc].Distance} > ${distancetosit} && !${SelfBuffTimer}) /call BuffSelf
  /goto :loop 
/return 

Sub TankCheck 
  /if (${Spawn[${tanknameid}].Name.NotEqual[${tankname}]}) /varset tanknameid 0 
  /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) { 
    /if (${SpawnCount[${tankname} ${tankclass}]}) { 
      /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID} 
      /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid} 
    } 
    /if (${SpawnCount[${tankname} ${tankclass}]}>1) { 
      /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
        /beep 
        /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
        /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro 
      } else { 
        /beep 
        /echo Need to restart macro to correctly identify the MT 
      } 
    } 
  } 
  /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) { 
    /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
      /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
      /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro 
    } 
  } 
  /if (!${Spawn[${tanknameid}].ID} && !${nomtspam}) { 
    /e Warning No Designated MT is available 
    /varset nomtspam 300 
  } 
/return 

Sub Healself 
  /if (${usedivarb} && ${Me.PctHPs} <= ${divarbpoint}) /call Divarbcast 
  /if (${Me.PctHPs} > ${selfhealpoint} || ${Me.Buff[Divine Aura].ID} || ${Me.Buff[Sacred Barrier].ID} || ${Me.Buff[Divine Barrier].ID}) /return 
  /target myself 
  /delay 1s ${Target.ID} == ${Me.ID} 
  /if (${Me.PctHPs} < ${selfhealpoint} && ${Me.PctHPs} > ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
    /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
    /call Cast "${patchheal}" ${patchhealgem} 1s 
  } 
  /if (${Me.PctHPs} <= ${dacastpoint} && ${Me.AltAbilityReady[Sanctuary]}) { 
    /if (${announce}) /${AnnounceChannel} Sanctuary!  Sanctuary! 
    /if (${announce}) /g Sanctuary Used!
    /call cast "Sanctuary" alt 
    /delay 1s 
    /if (${Me.Buff[Sanctuary].ID}) { 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${patchheal}" ${patchhealgem} 1s 
    } 
  } else /if (${Me.SpellReady[${daspell}]} && !${Me.Buff[Divine Aura].ID} && !${Me.Buff[Sacred Barrier].ID} && !${Me.Buff[Divine Barrier].ID}  && ${Me.PctHPs} <= ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Casting DA!! <<WARNING>> DA!! 
    /if (${groupannounce}) /g Casting DA!! <<WARNING>> DA!!
  } else /if (${Me.AltAbilityReady[Bestow Divine Aura]} && ${Me.PctHPs} <= ${dacastpoint}) { 
    /if (${announce}) /${AnnounceChannel} Bestowing Divine Aura on myself! 
    /if (${groupannounce}) /g Bestowing Divine Aura on myself!
    /call cast "Bestow Divine Aura" alt
    :retryda 
    /call Cast "${daspell}" 1s 
    /if (${Macro.Return.Equal[CAST_INTERRUPTED]}) /goto :retryda 
    /if ((${trickyda}==1)&&(${Me.Buff[${daspell}].ID})) /call TrickyDA 
    :dawait 
    /if (${Me.Buff[${daspell}].ID}) { 
      /delay 1s !${Me.Buff[${daspell}].ID} 
      /doevents 
      /goto :dawait 
    } 
  }            
/return 

Sub Healgroup 
  :healgroup 
  /varset worsthurt NULL 
  /varset worsthp 100 
  /varset worstclass NULL 
  /varset minorhurt 0 
  /varset majorhurt 0 
  /for gmember 0 to ${Group.Members} 
    /if (!${onlyhealfd}) { 
      /if (${Group.Member[${gmember}].Distance}<=${patchhealrange} && ${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} 
       } 
    } else { 
      /if (${Group.Member[${gmember}].Distance}<=${patchhealrange} && ${Group.Member[${gmember}].PctHPs}<=${worsthp}) { 
        /if (!${Select[${Group.Member[${gmember}].Class.ShortName},MNK,NEC]}) { 
          /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} 
        } else /if (${Group.Member[${gmember}].State.Equal[feign]}) { 
          /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}].PctHPs} < 80 && ${Group.Member[${gmember}].PctHPs} > 60 && ${Group.Member[${gmember}].Distance} < ${groupspellrange}) /varcalc minorhurt ${minorhurt}+1 
    /if (${Group.Member[${gmember}].PctHPs} < 60 && ${Group.Member[${gmember}].PctHPs} > 1 && ${Group.Member[${gmember}].Distance} < ${groupspellrange}) /varcalc majorhurt ${majorhurt}+1 
  /next gmember 
  /if (${autohealmode}==3) { 
    /if (${Spawn[${tanknameid}].ID} && ${Spawn[${tanknameid}].PctHPs} < ${tankhealpoint} && ${Spawn[${tanknameid}].Distance} < ${healspellrange}) /return 
    /if (${Me.PctHPs} <= ${selfhealpoint}) /return 
  } 
  /if (!${majorhurt} && !${minorhurt}) /return 
  /if (${usedivarb} && ${worsthp} && ${worsthp} <= ${divarbpoint}) /call Divarbcast 
  /if (${majorhurt}+${minorhurt} >= 3 && ${usegroupheal} && ${Me.SpellReady[${groupheal}]}) { 
    /if (${announce}) /${AnnounceChannel} Inc Grp Heal, get close 
    /if (${groupheal}) /g Incoming Group Heal
    /call Cast "${groupheal}" ${grouphealgem} 1s 
    /return 
  } 
  /if (${meleeClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].ID}) { 
    /if (${worsthp} <= ${tankhealpoint} && ${worsthp} >= ${tankhealpoint}*.7 && ${majorhurt} <= 1 && ${Me.SpellReady[${healspell}]}&& ${Spawn[${worsthurtid}].Distance} < ${healspellrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting "${healspell}" on ${Target.CleanName} in ${Spell[${healspell}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${healspell}" ${healspellgem} 1s CheckHP 
      /return 
    } else /if (${worsthp} <= ${tankhealpoint}*.7 && ${majorhurt} <= 1 && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${patchheal}" ${patchhealgem} 4s CheckHP 
      /return 
    } 
  } else /if (${casterClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].ID} && ${worsthurtid} != ${Me.ID}) { 
    /if (${worsthp} < ${casterhotpoint} && ${worsthp} > ${casterpatchpoint} && ${worsthp} && ${Me.SpellReady[${hotspell}]} && ${Spawn[${worsthurtid}].Distance} < ${hotspellrange} && !${NoHotID[${Group.Member[${worsthurt}]}]}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting ${hotspell} on ${Target.CleanName} 
      /call Cast "${hotspell}" ${hotspellgem} 1s CheckHP 
      /varset NoHotID[${Group.Member[${worsthurt}]}] ${worsthurtid} 
      /timed 400 NoHotID[${Group.Member[${worsthurt}]}] 0 
      /return 
    } else /if (${worsthp} < ${casterpatchpoint} && ${worsthp} && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${patchheal}" ${patchhealgem} 1s CheckHP 
      /return 
    } 
  } else /if (${canniClasses.Find[${worstclass}]} && ${Me.SpellReady[${patchheal}]} && ${Spawn[${worsthurtid}].ID}&& ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
    /if (${worsthp} <= ${necshmpatchpoint} && ${worsthp}) { 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
      /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
      /call Cast "${patchheal}" ${patchhealgem} 1s CheckHP 
      /return 
    } 
  } else /if (${worsthp} <= ${defaultpatchpoint} && ${worsthp} && ${Spawn[${worsthurtid}].ID} && ${Me.SpellReady[${patchheal}]}&& ${Spawn[${worsthurtid}].Distance} < ${patchhealrange}) { 
    /squelch /target id ${worsthurtid} 
    /delay 5 ${Target.ID}==${worsthurtid} 
    /if (${announce}) /${AnnounceChannel} Casting "${patchheal}" on ${Target.CleanName} in ${Spell[${patchheal}].CastTime} seconds! 
    /if (${groupannounce}) /g ${patchheal} on ${Target.CleanName} Incoming
    /call Cast "${patchheal}" ${patchhealgem} 1s CheckHP 
    /return 
  } 
  /if (${Spawn[${tanknameid}].PctHPs} > ${healpct} || !${Spawn[${tanknameid}].ID} || ${Spawn[${tanknameid}].Type.Equal[corpse]} && ${healpetmode} && ${Me.PctMana} > ${manatohealpet}) /call HealPet 
/return 

Sub Divarbcast 
  /if (${Me.Casting.ID}) /call Interrupt 
  /if (${announce}) /${AnnounceChannel} Inc Divine Arbitration / Epic 
  /if (${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) { 
    /if (${groupannounce}) /g Epic Click Inc!
    /call Cast "Aegis of Superior Divinity" item 0 
    /return 
  } else /if (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) { 
    /if (${groupannounce}) /g Epic Click Inc!
    /call Cast "Harmony of the Soul" item 0 
    /return 
  } else /if (${Me.AltAbilityReady[Divine Arbitration]}) { 
    /if (${groupannounce}) /g Divine Arbitration Inc!
    /call Cast "Divine Arbitration" alt 0 
    /return 
  } 
|  /declare q int local 
|  /for q 0 to ${Group} 
|    /if (${Group.Member[${q}].PctHPs}<=${DivArbHPs} && ${Me.AltAbilityReady[Bestow Divine Aura]} && ${Group.Member[${q}].ID}!=${tanknameid} && ${Group.Member[${q}].Distance} < 200) { 
|      /if (${Me.Casting.ID}) /call Interrupt 
|      /squelch /target id ${Group.Member[${q}].ID} 
|      /delay 1s ${Target.ID}==${Group.Member[${q}].ID} 
|      /if (${announce}) /${AnnounceChannel} Bestowing Divine Aura on: ${Target.CleanName} 
|      /call Cast "Bestow Divine Aura" alt 5s 
|    } 
|  /next q 
/return 

Sub HealPet 
   /if (${Me.Invis}) /return 
   /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.Length}) { 
      /if (${Spawn[${worsthurtid}].Type.NotEqual[Pet]}) /return 
      /squelch /target id ${worsthurtid} 
      /delay 5 ${Target.ID}==${worsthurtid} 
      /if (!${Target.ID}) /return 
      /if (${Target.ID}!=${worsthurtid}) /return 
      /delay 3 
      /if (${Target.PctHPs} < ${pethealpoint}) { 
         /if (${announce}) /${AnnounceChannel} Casting ${pethealspell} on ${Target.CleanName} 
         /varcalc stophealpoint ${pethealpoint}+5 
         /call Cast "${pethealspell}" spell 1s CheckHP 
         /varset stophealpoint ${defaultstophealpoint} 
         /delay 15 ${Me.SpellReady[${pethealspell}]} 
      } 
   } 
/return 

Sub MedTime 
  /if (${FindItem["Rod of Mystical Transvergance"].InvSlot} && ${Me.PctMana}<=70 && ${Me.PctHPs} > 70 && !${FindItem["Rod of Mystical Transvergance"].Timer}) /call Cast "Rod of Mystical Transvergance" item 
  /if (${autosit} && ${Me.PctMana}<=98 && !${Me.Casting.ID} && ${Me.Standing} && !${Following} && !${NearestSpawn[1,npc radius ${distancetosit} zradius 30].Distance} && !${Me.Buff[${yaulpspell}].ID} && !${Me.Moving}) /sit 
  /if (${Me.Standing} && !${Me.Mount.ID} && ${Me.SpellReady[${yaulpspell}]} && !${Me.Buff[${yaulpspell}].ID} && !${Me.Buff[Spiritual Vigor].ID} && !${Me.Buff[Strength of Tunare].ID} && !${Me.Buff[Spiritual Vitality].ID}) /call Cast "${yaulpspell}" ${yaulpgem} 
  /if (${Me.Sitting} && !${Window[SpellBookWnd].Open} && (${NearestSpawn[1,npc radius ${distancetosit} zradius 30].Distance} || ${Me.PctMana} > 95)) /stand 
  /if (${Me.PctMana} < 20 && ${announce} && !${oomspam}) { 
    /if (${announce}) /${AnnounceChannel} ${Me.PctMana} Mana 
    /varset oomspam 600 
  } 
/return 

Sub BuffSelf 
  /if (${Me.Invis}) /return 
  /declare i int local 
  /for i 1 to ${SelfBuffTotal} 
    /if (${Spell[${SelfBuffIcon${i}}].Stacks} && ((${SelfBuffGem${i}.Find[gem]} && ${Me.CurrentMana} > ${Spell[SelfBuff${i}].Mana}) || (${SelfBuffGem${i}.Equal[item]} && !${FindItem[${SelfBuff${i}}].Timer}) || (${SelfBuffGem${i}.Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff${i}}]}))) { 
      /if (${SelfBuffGem${i}.Find[gem]} && ${Me.Gem[${SelfBuff${i}}]} && (!${Me.SpellReady[${SelfBuff${i}}]} || ${Me.CurrentMana} < ${Spell[${SeflBuff${i}}].Mana})) /next i 
      /squelch /target id ${Me.ID} 
      /delay 1s ${Target.ID}==${Me.ID} 
      /if (${announce}) /${AnnounceChannel} Buffing myself with ${SelfBuffIcon${i}} 
      /call Cast "${SelfBuff${i}}" ${SelfBuffGem${i}} 6s 
      /squelch /target clear 
    }    
  /next i 
  /varset SelfBuffTimer 10 
/return 

Sub CheckHP 
  /if (${autointerrupt} && ${Target.PctHPs} >= ${stophealpoint} && (${Me.Casting.Name.Equal[${healspell}]} || ${Me.Casting.Name.Equal[${patchheal}]} || ${Me.Casting.Name.Equal[${hotspell}]})) { 
    /if (${announce} && !${duckspam}) /${AnnounceChannel} Ducking heal on ${Target.CleanName} 
    /if (!${duckspam}) /varset duckspam 100 
    /call Interrupt 
    /return 
  } 
  /if (${interrupt2healself} && ${Me.PctHPs} < ${interrupt2healselfhp}) { 
    /if (${usedivarb} && ${Me.PctHPs} < ${divarbpoint} && ((${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) || (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) || (${Me.AltAbilityReady[Divine Arbitration]}))) { 
      /call Interrupt 
      /call Divarbcast 
      /return 
    } else { 
      /if (!${duckselfspam}) /docommand /${AnnounceChannel} Ducking heal on ${Target.CleanName} so I can heal myself 
      /varset duckselfspam 100 
      /call Interrupt 
      /call HealSelf 
      /return 
    } 
  } 
  /if (${onlyhealfd} && ${Select[${Target.Class.ShortName},MNK,NEC]} && ${Target.State.NotEqual[feign]}) { 
    /if (${announce} && !${duckfdspam}) /${AnnounceChannel} Ducking heal on ${Target.CleanName} because they won't stay down! 
    /if (!${duckfdspam}) /varset duckfdspam 400 
    /call Interrupt 
    /return 
  } 
  /if (${Me.Casting.Name.Equal[${hotspell}]} && ${casterClasses.Find[${worstclass}]} && ${Spawn[${worsthurtid}].PctHPs} < ${casterpatchpoint}) { 
    /if (${announce} && !${duckspam}) /${AnnounceChannel} Ducking HoT on ${Target.CleanName} to patch heal! 
    /if (!${duckfdspam}) /varset duckfdspam 400 
    /call Interrupt 
    /return 
  } 
  /if (${usedivarb} && ${castEndTime}>=${interrupt2divarb} && ((${FindItem[Aegis of Superior Divinity].InvSlot} && !${FindItem[Aegis of Superior Divinity].Timer}) || (${FindItem[Harmony of the Soul].InvSlot} && !${FindItem[Harmony of the Soul].Timer}) || (${Me.AltAbilityReady[Divine Arbitration]}))) { 
    /for gmember 0 to ${Group} 
      /if (${Group.Member[${gmember}].PctHPs} < ${divarbpoint} && ${Group.Member[${gmember}].Distance} < 200 && ${Spawn[${Group.Member[${gmember}].ID}].ID}) { 
        /call Interrupt 
        /call Divarbcast 
        /return 
      } 
    /next gmember 
  } 
/return 

Sub TrickyDA 
   /for intcount 1 to 20 
      /if ((${Me.PctHPs}<40)&&(${Me.Buff[${trickybuff[${intcount}]}].ID})) /notify BuffWindow Buff${Math.Calc[${Me.Buff[${trickybuff[${intcount}]}].ID}-1].Int} leftmouseup 
   /next intcount 
   /if (${Me.Buff[${daspell}].ID}) { 
      :waitalittle 
      /delay 1s ${Me.Buff[${daspell}].Duration}<2 
      /if (${Me.Buff[${daspell}].Duration}>=2) /goto :waitalittle 
   } 
/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}]}) { 
      /squelch /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 (${MasterOnly}) /if (!${MasterList.Find[${Sender}]} ) /return 
  /if (!${Spawn[${Sender}].ID}) { 
    /e ${Sender} is not in the zone 
    /return 
  } 
| ****************************************************************************
| BEGIN Custom commands
| ****************************************************************************
   /if (${ChatText.Equal[rezthis]}) { 
      /target ${Sender}
      /delay 1s
      /assist
      /delay 1s
      /if (${announce}) /${AnnounceChannel} Rezzing ${Target.CleanName}
      /corp
      /exchange "Water Sprinkler of Nem Ankh" mainhand
      /call Cast "Water Sprinkler of Nem Ankh" item 0
      /exchange "${mainitem}" mainhand
      /if (${announce}) /${AnnounceChannel} Rezzing ${Target.CleanName} Complete! 
   }  
   /if (${ChatText.Equal[tanking]}) { 
  /assist ${tankname} 
      /delay 5 
      /call Cast "Mark of the Blameless" gem6 5s
      /call Cast "Mark of the Righteous" gem7 5s
      /call Cast "Unswerving Hammer of Retribution" gem8 5s 
   }
| ****************************************************************************
| END Custom commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Movement commands
| ****************************************************************************
  /if (${ChatText.Equal[Follow me]}) { 
    /target ${Sender} 
    /delay 3 
    /varset followid ${Target.ID} 
    /varset Following TRUE 
    /varset FollowName ${ChatSender} 
    /squelch /stick 20 hold 
    /doevents 
  } 
  /if (${ChatText.Equal[Stay Here]}) { 
    /varset FollowTank    FALSE 
    /varset StaticCamp    FALSE 
    /squelch /stick off 
    /timed 50 /face pc ${follname} 
  } 
  /if (${ChatText.Equal[Make Camp]}) { 
    /varset MovingCamp    FALSE 
    /varset Following FALSE 
    /squelch /stick off 
    /varset  HomeX ${Me.X} 
    /varset  HomeY ${Me.Y} 
  } 
| ****************************************************************************
| END Movement commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Nuke commands
| ****************************************************************************
   /if (${ChatText.Equal[nuke]}) { 
      /if (${Me.PctMana}<30) { 
         /${AnnounceChannel} Cleric Mana ${Me.PctMana}%, holding on nukes! 
      } else { 
         /assist ${Sender} 
         /delay 5 
         /if (${Target.Type.NotEqual[NPC]}) { 
            /assist ${Sender} 
            /delay 5 ${Target.Type.Equal[NPC]} 
         } 
         /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
            /if (${Me.SpellReady[${nukeone}]}) { 
               /if (${announce}) /${AnnounceChannel} Casting ${nukeone} on ${Target.CleanName} 
               /call Cast "${nukeone}" spell 3s 
            } else /if (${Me.SpellReady[${nuketwo}]}) { 
               /if (${announce}) /${AnnounceChannel} Casting ${nuketwo} on ${Target.CleanName} 
               /call Cast "${nuketwo}" spell 3s 
            } else { 
              /${AnnounceChannel} nukes not ready 
            } 
            /if (${Me.PctMana}<=60) /${AnnounceChannel} FYI Cleric Mana ${Me.PctMana}% 
         } else { 
           /${AnnounceChannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
         } 
      } 
   } 
| ****************************************************************************
| END Nuke commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Stun commands
| ****************************************************************************
   /if (${ChatText.Equal[stun]}) { 
      /assist ${Sender} 
      /delay 5 
      /if (${Target.Type.NotEqual[NPC]}) { 
         /assist ${Sender} 
         /delay 5 ${Target.Type.Equal[NPC]} 
      } 
      /if ((${Target.Type.Equal[NPC]})&&(${Target.PctHPs}<=90)) { 
         /if (${Me.SpellReady[${stunone}]}) { 
            /if (${announce}) /${AnnounceChannel} Casting ${stunone} on ${Target.CleanName} 
            /call Cast "${stunone}" spell 3s 
         } else /if (${Me.SpellReady[${stuntwo}]}) { 
            /if (${announce}) /${AnnounceChannel} Casting ${stuntwo} on ${Target.CleanName} 
            /call Cast "${stuntwo}" spell 3s 
         } else { 
           /${AnnounceChannel} stuns not ready 
         } 
      } else { 
        /${AnnounceChannel} wrong target (${Target.Type} at ${Target.PctHPs}% HP) 
      } 
   } 
| ****************************************************************************
| END Stun commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Buff commands
| ****************************************************************************
   /if (${ChatText.Equal[wov]}) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${announce}) /${AnnounceChannel} Casting ${acbuff} on ${Target.CleanName} 
      /call Cast "${acbuff}" gem9 1s CheckHP 
   } 
   /if ((${ChatText.Equal[balikor]})||(${ChatText.Equal[conviction]})||(${ChatText.Equal[devotion]})||(${ChatText.Equal[rgc]})||(${ChatText.Equal[hot me]})||(${ChatText.Equal[ch me]})||(${ChatText.Equal[pb]})) { 
      /if (${Spawn[pc ${Sender}].Distance}>200) /return 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
   } 
   /if (${ChatText.Equal[balikor]}) { 
     /if (${announce}) /${AnnounceChannel} Casting ${singlesymbuff} on ${Target.CleanName} 
     /call Cast "${singlesymbuff}" ${singlesymbuffgem} 1s CheckHP 
   } 
   /if (${ChatText.Equal[conviction]}) { 
     /if (${announce}) /${AnnounceChannel} Casting ${longhpbuff} on ${Target.CleanName} 
     /call Cast "${longhpbuff}" ${longhpbuffgem} 1s CheckHP 
   } 
   /if (${ChatText.Equal[devotion]} || ${ChatText.Find[spell haste]}) { 
      /call Cast "${spellhastebuff}" ${spellhastebuffgem} 1s CheckHP 
   } 
| ****************************************************************************
| END Buff commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Heal/Cure commands
| ****************************************************************************
   /if ((${ChatText.Equal[patch me]})||(${ChatText.Equal[heal]})||(${ChatText.Equal[heal me]})||(${ChatText.Equal[heal plz]})||(${ChatText.Equal[heal me plz]})||(${ChatText.Equal[need heal]})) { 
      /call FindExactPC ${Sender} 
      /if (${Macro.Return.NotEqual[TARGET_SUCCESS]}) /return 
      /if (${Target.Distance}<=${patchhealrange}) { 
         /if (${announce}) /${AnnounceChannel} Casting ${patchheal} on ${Target.CleanName} 
         /call Cast "${patchheal}" ${patchhealgem} 2s 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } else { 
        /tell ${Sender} you're out of range 
      } 
   } 
   /if (${ChatText.Equal[rgc]}) { 
      /if (${FindItem[Blackflame Sphere].ID}) { 
         /call Cast "Blackflame Sphere" item 
      } else /if (${FindItem[Wand of Casual Blessings].ID}) { 
         /call Cast "Wand of Casual Blessings" item 
      } else { 
        /call Cast "${rgcspell}" gem7 1s CheckHP 
      } 
   } 
   /if (${ChatText.Equal[pb]}) /call Cast "Pure Blood" gem9 10s 
   /if (${ChatText.Equal[hot me]} && !${Me.Invis}) { 
      /if (${Target.Distance}<=${hotspellrange}&&  ${Me.SpellReady[${hotspell}]}) { 
         /if (${announce}) /${AnnounceChannel} Casting ${hotspell} on ${Target.CleanName} 
         /call Cast "${hotspell}" ${patchhealgem} 2s 
      } else { 
        /tell ${Sender} You're out of range. 
      } 
   } 
   /if (${ChatText.Equal[ch me]} && !${Me.Invis} && ${Me.SpellReady[${healspell}]}) { 
      /if (${Target.Distance}<=100) { 
         /if (${announce}) /${AnnounceChannel} Casting Complete Healing on ${Target.CleanName} 
         /call Cast ${healspell} ${healspellgem} 1s CheckHP 
      } else { 
        /tell ${Sender} You're out of range. 
      } 
   } 
| ****************************************************************************
| END Heal/Cure commands
| ****************************************************************************
| ****************************************************************************
| BEGIN Pet commands
| ****************************************************************************
   /if (${ChatText.Equal[buff pet]}) { 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 8 
      /target ${Spawn[pc ${Sender}].Pet} 
      /if (${announce}) /${AnnounceChannel} Casting ${acbuff} on ${Target.CleanName} 
      /call Cast "${acbuff}" gem9 1s CheckHP 
      /if (${announce}) /${AnnounceChannel} Casting ${singlesymbuff} on ${Target.CleanName} 
      /call Cast "${singlesymbuff}" gem9 1s CheckHP 
   } 
   /if (${ChatText.Equal[da pet]}) { 
      /if (${DEBUG}) /echo Target 25 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 6 
      /if (${DEBUG}) /echo Target 26 
      /target ${Spawn[pc ${Sender}].Pet} 
      /delay 3 
      /if (${Me.AltAbilityReady[Bestow Divine Aura]} && ${Target.Name.Equal[${Spawn[pc ${Sender}].Pet.Name}]}) { 
         /call Cast "39" alt 
      } else { 
         /${AnnounceChannel} Bestow Divine Aura is not ready, or Target (${Target.CleanName}) OOR or wrong target 
      } 
   } 
| ****************************************************************************
| END Pet commands
| ****************************************************************************
   /if (${ChatText.Equal[mana check]}) if (${announce)) /${AnnounceChannel} Cleric Mana ${Me.PctMana}% 
| ****************************************************************************
| BEGIN Item Click commands
| ****************************************************************************
     /if (${Me.Invis} || ${Me.Moving} || ${clicktimer} || ${Me.State.Equal[BIND]}) /goto :DoneItemChecks
     /varset z 1
     :ItemCheckLoop
     /varset ialias ${Ini[AFCItems.ini].Arg[${z},|]}
     /if (${ialias.NotEqual[NULL]}) {
       |- Obtained an itemalias from the AFCItems.ini file
       |- We supposed to keep this spell up?
       /if (${Ini[AFCItems.ini,${ialias},KeepUp].Equal[FALSE]}) /goto :NextItem
       |- Scan the item's bounce list for the active bouncers
       /varset bouncenum 1
       /varset doIclick TRUE
       :BounceCheckLoop
       /varset ibounce ${Ini[AFCItems.ini,${ialias},BounceOff${bouncenum}]}
       /if (${ibounce.NotEqual[NULL]}) {
         /if (${ibounce.Equal[${Me.Buff[${ibounce}]}]}) /varset doIclick FALSE
       } else /goto :DoneBounceChecks
       /varcalc bouncenum ${bouncenum}+1
       /goto :BounceCheckLoop
       :DoneBounceChecks
       |- By now we won't click the item if a bouncer spell is on us
       |- Just have to check to see if the existing buff is on too
       /varset itemspellname ${FindItem[${Ini[AFCItems.ini,${ialias},FullName]}].Spell}
       /if (${itemspellname.Equal[${Me.Buff[${itemspellname}]}]}) /varset doIclick FALSE
       |- Finally, do it if we should
       /if (${doIclick}) /docommand /iclick ${ialias}
       |- Did we fail to find that previous item? (i.e. Dead and naked at bind point!)
       /if (${clicktimer}) /goto :DoneItemChecks
       :NextItem
       /varcalc z ${z}+1
     } else /goto :DoneItemChecks
     /goto :ItemCheckLoop
     :DoneItemChecks
   }
/return
| ****************************************************************************
| END Item Click commands
| **************************************************************************** 

Sub ReturnHome 
  /if (${Following} || ${MovingCamp} || !${StaticCamp}) /return 
  /if (${Me.Sitting}) /stand 
  /if (${Math.Distance[${HomeY},${HomeX}]}<10) { 
    /keypress back 
    /return 
  } 
  :MoveHome 
  /delay 1 
  /doevents 
  /face fast nolook loc ${HomeY},${HomeX} 
  /if (${Math.Distance[${HomeY},${HomeX}]}>10) /keypress forward hold 
  /call AreWeStuck 
  /if (${Math.Distance[${HomeY},${HomeX}]}<10) { 
    /keypress forward 
    /keypress back 
    /return 
  } 
  /goto :MoveHome 
  /squelch /target ${tankname} 
  /face fast nolook 
  /squelch /target clear 
/return 

Sub AreWeStuck 
   /doevents 
  /declare  StuckXLoc      int local ${Me.X} 
  /declare  StuckYLoc      int local ${Me.Y} 
  /delay 4 
  /if (${StuckXLoc}==${Me.X} && ${StuckYLoc}==${Me.Y}) /call MoveAround 
/return 

Sub MoveAround 
  /doevents 
  /keypress forward 
  /keypress back hold 
  /delay 3 
  /keypress back 
  /if (${Math.Rand[2]}) { 
     /keypress strafe_right hold 
  } else { 
     /keypress strafe_left hold 
  } 
  /delay 10 
  /keypress strafe_right 
  /keypress strafe_left 
/return 

|Sub Event_MobDead 
|  /squelch /stick off 
|  /keypress forward 
|  /keypress back 
|  /if (${Math.Distance[${HomeY},${HomeX}]}>25) /call ReturnHome 
|/return 

Sub Event_Zoned 
  /varset  HomeX ${Me.X} 
  /varset  HomeY ${Me.Y} 
  /if (${Following}) { 
    :WaitForLead 
    /delay 10 
    /doevents 
    /squelch /target ${FollowName} 
    /if (!${Target.ID}) /goto :WaitForLead 
    /squelch /stick 20 moveback 
  } 
/return 

Sub Event_ImDead 
  /varset Following FALSE 
  /delay 20s 
  /memspellset ${spellset} 
  /call Wait4Rez 
/return 

Sub Event_GotHit(string line, string attacker) 
  /if (${Me.AltAbility[Divine Retribution]} && ${Me.AltAbilityReady[Divine Retribution]}) /call cast "Divine Retribution" alt 
  /if (!${helpspam}) { 
    /if (${announce}) /${AnnounceChannel} Help Help!  I am being beaten on!! 
    /varset helpspam 100 
  } 
/return 

Sub Event_ItemSet(string Line)
  /varset lastevent Event_ItemSet
  |- Sanity check parameters
  /if (!${Line.Arg[5].Length} || ${Line.Arg[6].Length}) {
    /if (${Verbosity}>=0) /${channel} ** Improper use of /iset
    /if (${Verbosity}>=0) /${channel} -- /iset <itemalias> keepup|nokeepup <"Item Name">
    /if (${Verbosity}>=0) /${channel} -- For example:
    /if (${Verbosity}>=0) /${channel} -- /iset gobby keepup "Shrunken Goblin Skull Earring"
    /return 
  }
  /ini "AFCItems.ini" "${Line.Arg[3]}" "FullName" "${Line.Arg[5]}"  
  /ini "AFCItems.ini" "${Line.Arg[3]}" "KeepUp" "${If[${Line.Arg[4].Equal[keepup]},TRUE,FALSE]}"
  /if (${Verbosity}>=0) /${channel} ** ${Line.Arg[5]} (KeepUp=${If[${Line.Arg[4].Equal[keepup]},TRUE,FALSE]}) updated in INI!
/return

Sub Event_ItemBounce(string Line)
  /varset lastevent Event_ItemBounce
  |- Sanity check parameters
  /if (!${Line.Arg[4].Length}) {
    /if (${Verbosity}>=0) /${channel} ** Improper use of /ibounce
    /if (${Verbosity}>=0) /${channel} -- /ibounce <itemalias> "Some Spell Name"
    /if (${Verbosity}>=0) /${channel} -- For example:
    /if (${Verbosity}>=0) /${channel} -- /ibounce gobby "Strength of Tunare"
    /return 
  }
  |- Look for that item's section, return if non-existent
  /if (!${Ini[AFCItems.ini,${Line.Arg[3]}].Length}) {
    /if (${Verbosity}>=0) /${channel} ** [${Line.Arg[3]}] not in INI file!
    /return
  }
  |- Find the next available BounceOff key number and store the spell
  /declare bindex int local 1
  :CheckNextKey
  /if (${Ini[AFCItems.ini,${Line.Arg[3]},BounceOff${bindex}].Length}) {
    |- This one is in use...
    /varcalc bindex ${bindex}+1
    /goto :CheckNextKey
  } else {
    |- This one not defined (yet).  Good.
    /ini "AFCItems.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
    /if (${Verbosity}>=0) /${channel} ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list
  }
/return

Sub Event_ItemCast(string Line)
  /varset lastevent Event_ItemCast
  |- Sanity check parameter
  /if (!${Line.Arg[3].Length}) {
    /if (${Verbosity}>=0) /${channel} ** Improper use of /icast
    /if (${Verbosity}>=0) /${channel} -- /icast <itemalias>
    /if (${Verbosity}>=0) /${channel} -- For example:
    /if (${Verbosity}>=0) /${channel} -- /icast gobby
    /return 
  }
  |- Look for that item's section, return if non-existent
  /if (!${Ini[AFCItems.ini,${Line.Arg[3]}].Length}) {
    /if (${Verbosity}>=0) /${channel} ** [${Line.Arg[3]}] not in INI file!
    /return
  }
  /declare fullname string local ${Ini[AFCItems.ini,${Line.Arg[3]},FullName]}
  |- Is it in a Bag?
  /if (${Verbosity}>=1) /${channel} ** Attempting to use: ${fullname}
  /if (${FindItem[${fullname}].InvSlot.Pack}) {
    :OpenPack
    /if (!${Window[${FindItem[${fullname}].InvSlot.Pack.Name}].Open}) {
      /itemnotify ${FindItem[${fullname}].InvSlot.Pack.Name} rightmouseup
      /delay 2
      /goto :OpenPack
    } 
    /declare camefrom ${FindItem[${fullname}].InvSlot}
    :GrabItem
    /if (!${Cursor.ID}) {
      /itemnotify ${InvSlot[${camefrom}]} leftmouseup
      /delay 2
      /goto :GrabItem
    }
    /declare clickyID int local ${Cursor.ID}
    /declare wornat int local ${Cursor.WornSlot[1]}
    :SwapFirst
    /if (${Cursor.ID}==${clickyID}) {
      /itemnotify ${InvSlot[${wornat}]} leftmouseup
      /delay 2
      /goto :SwapFirst
    }
    |- Click it
    /delay 2
    /if (${Verbosity}>=1) /${channel} ** Clicking: ${fullname}
    /declare previousID ${Cursor.ID}
    /itemnotify ${InvSlot[${wornat}]} rightmouseup
    :SwapAgain
    /if (${Cursor.ID}==${previousID}) {
      /itemnotify ${InvSlot[${wornat}]} leftmouseup
      /delay 2
      /goto :SwapAgain
    }
    |- Put it back
    :PutItBack
    /if (${Cursor.ID}==${clickyID}) {
      /itemnotify ${InvSlot[${camefrom}]} leftmouseup
      /delay 2
      /goto :PutItBack
    } 
    :SummonedCheck
    /if (${Cursor.ID}) {
      |- Something was summoned
      /autoinv
      /delay 2
      /goto :SummonedCheck
    }    
    :ClosePack
    /if (${Window[${InvSlot[${camefrom}].Pack.Name}].Open}) {
      /itemnotify ${InvSlot[${camefrom}].Pack.Name} rightmouseup
      /delay 2
      /goto :ClosePack
    } 
  } else {
    |- Just click it
    /if (${FindItem[${fullname}].InvSlot}) {
      /if (${Verbosity}>=1) /${channel} ** Clicking: ${fullname}
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup
      /delay 2
    } else {
      /if (${Verbosity}>=0) /${channel} ** "${fullname}" not found!
    }
  } 
  :CastLoop 
  /delay 1 
  /if (${Me.Casting.ID}) /goto :CastLoop
/return

Sub Event_TogPause 
  /varset lastevent Event_TogPause
  /beep
  /if (${isPaused}) { 
    /varset isPaused FALSE 
    /if (${verbosity}>=0) /${channel} ** AFC is now RESUMING! 
  } else { 
    /varset isPaused TRUE 
    /if (${verbosity}>=0) /${channel} ** AFC is now PAUSED!
|         :ForeverLoop
|          /doevents
|          /if (${Me.State.Equal[STUN]} || ${isPaused}) {
|          /delay 2
|          /goto :ForeverLoop
  } 
/return

Sub Event_Exp 
  /if (${verbosity}>=1) /${channel} ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDRExp}]}%) 
  /varset LDRExp ${Me.PctGroupLeaderExp} 
  /varset AAExp ${Me.PctAAExp} 
  /varset Exper ${Me.PctExp}
/return
 

Attachments

  • AFC2.mac
    54.9 KB · Views: 301
Anyone want to take a crack at Trolls version and fix the errors?

-Drak