Autoenc Problem

KingArthur

AutoBots
Joined
Dec 15, 2009
Messages
525
Reaction score
31
Points
28
ok here is the Autoenc.mac i use
Code:
| autoenc.mac 
| By Rusty~ 
| Last update 10/27/2004 
| 
| /macro autoenc [ma name][sa name][radius #][minhp #] 
| 
| Description: 
|   Will assist the person set as main assist. If the main assist dies, it will assist the person 
|   set as secondary assist if there is one. Once a target is aquired, and is varified as being aggro 
|   it will then wait till the mob is engaged by the tank. Then it will wait till mob is under the spcified hp, 
|   or the specified time has expired since the tank has engaged, and it will tash, slow, and nuke, if enabled. 
|   Will mez any adds within the set radius, and debuff them if it's enabled. 
|   This will also keep self buffs up, and buff people on request (with the spells specified in ini). 
| 
| 
|   After running the macro for the first time, you should open the ini file generated (Auto_Yourname.ini) 
|   Most of the options are self explanatory 
|   Here's an example how the ini based buffs work: 
| 
|      BuffList1=c6 
|      BuffName1=clairvoyance 
|      BuffType1=gem4 
| 
|   BuffList is a list of words (or phrases) that will trigger the buff, separated by commas 
|   BuffName is the name of the spell or item 
|   BuffType is either item, gem1-9, or alt, for items, spells, or aa abilities respectively 
| 
|   BuffName can also be a "shortcut" name. Shortcut names will cast different buffs depending on certain 
|   circumstances. For example, putting "c6" as the BuffName, will cast Voice of Clairvoyance if it's up, 
|   or else it will cast Clairvoyance. Following is a list of shortcut buffs and what they do: 
| 
|     c6      - Will cast Voice of Clairvoyance if you have no C6 on and are in a group, else will cast Clairvoyance 
|     c5      - Voice of Quellious 
|     c4      - Will use C4 pants if you have them, else will cast Tranquility 
|     c3      - Will use C3 wand if you have it, else will cast Koadic's Endless Intellect 
|     c2      - Clairty II 
|     c1      - Will cast Rod of Infinite thought if you have, else will cast Clarity 
|     haste   - If you have group haste memmed (spell name specified in ini), it will cast group haste 
|               else it will cast single haste. If you are under 60% mana and have elemental legs 
|               it will cast them instead of single or group haste spells 
|     shissar - Will cast epic 1.0 
|      
| 
| 
|   For each self buff and clicky buff, there's a place to put all the buffs that don't stack with it: 
| 
|      Clicky1=Velium Coldain Insignia Ring 
|      ClickyNoStack1=Call of Earth,Call of the Rathe,Guard of the Earth,Illusion Fire Elemental 
| 
|   *note* To mem spells after death, save a spellset, and put the name of it in your ini under SpellSet 
| 
| 
|----------------------------------------------------------------------------------------------------------+ 
|  slash commands:                                                                                         | 
|----------------------------------------------------------------------------------------------------------+ 
|  /setma name                             - sets main assist                                              | 
|  /setsa name                             - sets secondary assist                                         | 
|  /buff #                                 - mode 1 buffs all the time, self buff and tells                | 
|                                          - mode 2 does self buffs and tells when you have no target      | 
|                                          - mode 3 does self buffs only, all the time                     | 
|                                          - mode 4 does self buffs only, only when you have no target     | 
|  /debuff on|off                          - turns auto debuffing on or off                                | 
|  /mez on|off                             - turns auto mezzing on or off                                  | 
|  /mount on|off                           - turns auto mounting on or off                                 | 
|  /nukedelay #                            - sets the minimum amount of deciseconds between nukes          | 
|  /engagedelay #                          - amount of deciseconds before you start nuking mob             | 
|  /anchor #                               - sets the leash length when using an anchor                    | 
|  /minhp #                                - sets the minimum hp % that you'll begin nuking at             | 
|  /cleanup on|off                         - turns on auto looting of any droppable loot                   | 
|  /checknamed on|off                      - turns alerts on for named in your current zone                | 
|  /runehp #                               - sets the health % at which you'll cast your rune item or spell| 
|  /nukemode 0, 1, 2                       - mode 0 turns nukes off completely                             | 
|                                          - mode 1 uses robe if enabled, and slows nukes if low mana      | 
|                                          - mode 2 chain nukes, with only delay being the set /nukedelay  | 
|  /manarobe mode #|min #|max #            - mode 1 uses manrobe all the time                              | 
|                                          - mode 2 uses your set % to start robing                        | 
|  /radius #                               - sets the distance at which you'll engage the main assist's    | 
|                                            target                                                        | 
|----------------------------------------------------------------------------------------------------------+ 

#include spell_routines1.inc 
#include gen_routines.inc 
#include move.inc 

#turbo 40 

#chat group 
#chat tell 
#chat chat 
#chat say 
#chat gsay 

#event AutoStun "[MQ2] AutoStun #1#" 
#event Gate "|${Target.DisplayName}| begins to cast the gate spell#*#" 
#event Mez "[MQ2] mez" 
#event RageOff "#*#is no longer enraged#*#" 
#event RageOn "#*#has become ENRAGED#*#" 

Sub Main 
   /call GeneralDeclares 
   /declare MasterList string outer ${Ini[${IRCIniFile},General,MasterList]}
   /declare MasterOnly outer TRUE
   /declare spellNotHold int outer 1

   /call DeclareIniVar mainAssist      string Settings
   /call DeclareIniVar secondAssist    string Settings 
   /call DeclareIniVar privateChannel  string Settings 
   /call DeclareIniVar maxMezLevel     int    Settings 88
   /call DeclareIniVar mezzImmuneList  string Settings |
   /call DeclareIniVar maxAEMezLevel   int    Settings 88
   /call DeclareIniVar maxPBAEMezLevel int    Settings 88 
   /call DeclareIniVar minRadius       int    Settings 100 /radius 
   /call DeclareIniVar engageDelay     int    Settings 15 /engagedelay 
   /call DeclareIniVar minHP           int    Settings 98 /minhp 
   /call DeclareIniVar autoBuff        int    Settings 1 /buff 
   /call DeclareIniVar useMount        int    Settings 0 /mount 
   /call DeclareIniVar useMez          int    Settings 1 /mez 
   /call DeclareIniVar useDebuff       int    Settings 1 /debuff
   /call DeclareIniVar useTashOnly     int    Settings 0 /tashonly
   /call DeclareIniVar nukeMode        int    Settings 0 /nuke 
   /call DeclareIniVar useCharm        int    Settings 0 /charm 
   /call DeclareIniVar useTashFocus    int    Settings 0 /tash 
   /call DeclareIniVar useDPS          int    Settings 0 /dps 
   /call DeclareIniVar hasteGroup      int    Settings 0 /haste 
   /call DeclareIniVar channelAnnounce int    Settings 0 
   /call DeclareIniVar noInterrupt     int    Settings 0 
   /call DeclareIniVar useManaStone    int    Settings 0 /manastone 
   /call DeclareIniVar checkNamed      int    Settings 0 /checknamed 
   /call DeclareIniVar noInvis         int    Settings 1 
   /call DeclareIniVar useManaRobe     int    Settings 0
   /call DeclareIniVar manaRobeMode    int    Settings 0 
   /call DeclareIniVar manaRobeMinMana int    Settings 70 
   /call DeclareIniVar manaRobeMaxMana int    Settings 90 
   /call DeclareIniVar nukeMana        int    Settings 50 /nukemana 
   /call DeclareIniVar nukeDelay       int    Settings 0 /nukedelay 
   /call DeclareIniVar nukeMode        int    Settings 0 /nukemode 
   /call DeclareIniVar ignoreList      string Settings 
   /call DeclareIniVar runeHP          int    Settings 70 
   /call DeclareIniVar cleanUp         int    Settings 0 /cleanup 
   /call DeclareIniVar spellSet        string Settings "slowbot" 
   /call DeclareIniVar mezDuration     string Settings 500 
   /call DeclareIniVar tashDuration    string Settings 14m 
   /call DeclareIniVar slowDuration    string Settings 2100 
   /call DeclareIniVar autoAnnounce    string Settings 1    
   /call DeclareIniVar announceTells   string Settings 1 /announcetells 
   /call DeclareIniVar rodBitch        string Settings 
   /call DeclareIniVar noKnockBack     string Settings 0 /usezoom 
   
   /call DeclareIniVar usePet          int    PetSettings 0 /companion 
   /call DeclareIniVar usePetGem       string PetSettings " "
   /call DeclareIniVar petSpell        string PetSettings " " 
   /call DeclareIniVar totalPetBuffs   int    PetSettings 0
   /call DeclareIniVar petBuff1        string PetSettings " "
   /call DeclareIniVar petBuffIcon1    string PetSettings " "
   /call DeclareIniVar petBuffGem1     string PetSettings " "
   
   /call DeclareIniVar useSelfBuffs   int    SelfBuffs 1
   /call DeclareIniVar totalSelfBuffs int    SelfBuffs 1
   /call DeclareIniVar selfBuff1      string SelfBuffs " "
   /call DeclareIniVar selfBuffIcon1  string SelfBuffs " "
   /call DeclareIniVar selfBuffGem1   string SelfBuffs " "
   /call DeclareIniVar selfBuff2      string SelfBuffs " " 
   /call DeclareIniVar selfBuffIcon2  string SelfBuffs " "
   /call DeclareIniVar selfBuffGem2   string SelfBuffs " "
   /call DeclareIniVar selfBuff3      string SelfBuffs " " 
   /call DeclareIniVar selfBuffIcon3  string SelfBuffs " "
   /call DeclareIniVar selfBuffGem3   string SelfBuffs " "
   /call DeclareIniVar selfBuff4      string SelfBuffs " " 
   /call DeclareIniVar selfBuffIcon4  string SelfBuffs " "
   /call DeclareIniVar selfBuffGem4   string SelfBuffs " "
   /call DeclareIniVar selfBuff5      string SelfBuffs " " 
   /call DeclareIniVar selfBuffIcon5  string SelfBuffs " "
   /call DeclareIniVar selfBuffGem5   string SelfBuffs " "

   /call DeclareIniVar rootSpell        string Spells "Greater Fetter" 
   /call DeclareIniVar stunSpell        string Spells "Color Conflux Rk. III"
   /call DeclareIniVar nuke1            string Spells "Polychromatic Assault" 
   /call DeclareIniVar nuke2            string Spells "Psychosis"
   /call DeclareIniVar mezSpell         string Spells "Befuddle Rk. III" 
   /call DeclareIniVar mezGem           int    Spells "8"
   /call DeclareIniVar tashSpell        string Spells "Howl of Tashan" 
   /call DeclareIniVar slowSpell        string Spells "Desolate Deeds" 
   /call DeclareIniVar slowType         string Spells "spell" 
   /call DeclareIniVar charmSpell       string Spells "Dominate Rk. III" 
   /call DeclareIniVar aeMezSpell       string Spells "Ensorcelling Wave Rk. III" 
   /call DeclareIniVar pbaeMezSpell     string Spells "Docility Rk. II"
   /call DeclareIniVar shielding string spells "Mystic Shield" 
   /call DeclareIniVar singleHasteSpell string Spells "Speed of Ellowind" 
   /call DeclareIniVar groupHasteSpell  string Spells "Hastening of Ellowind" 
   /call DeclareIniVar selfAARune       string Spells "Rune of Shadows"
   /call DeclareIniVar selfRune         string Spells "Draconic Rune Rk. II" 
   /call DeclareIniVar buffList1        string Spells "c9" 
   /call DeclareIniVar buffName1        string Spells "Voice of Prescience Rk. III" 
   /call DeclareIniVar buffType1        string Spells "gem2" 
   /call DeclareIniVar buffList2        string Spells "haste" 
   /call DeclareIniVar buffName2        string Spells "haste" 
   /call DeclareIniVar buffType2        string Spells "gem8" 
   /call DeclareIniVar buffList3        string Spells "rune" 
   /call DeclareIniVar buffName3        string Spells "Dermal Brimstone Rk. III " 
   /call DeclareIniVar buffType3        string Spells "gem3 " 
   /call DeclareIniVar buffList4        string Spells "" 
   /call DeclareIniVar buffName4        string Spells "" 
   /call DeclareIniVar buffType4        string Spells "" 
   /call DeclareIniVar buffList5        string Spells "" 
   /call DeclareIniVar buffName5        string Spells "" 
   /call DeclareIniVar buffType5        string Spells "" 
   /call DeclareIniVar buffList6        string Spells "" 
   /call DeclareIniVar buffName6        string Spells "" 
   /call DeclareIniVar buffType6        string Spells "" 
   /call DeclareIniVar buffList7        string Spells "ghaste" 
   /call DeclareIniVar buffName7        string Spells "Hastening of Erradien Rk. III" 
   /call DeclareIniVar buffType7        string Spells "gem1"  

   /call DeclareIniVar hpRobe string Items "${InvSlot[chest].Item.Name}" 
   /call DeclareIniVar clicky1 string Items " " 
   /call DeclareIniVar clickyNoStack1 string Items " " 
   /call DeclareIniVar clicky2 string Items " " 
   /call DeclareIniVar clickyNoStack2 string Items " " 
   /call DeclareIniVar clicky3 string Items " " 
   /call DeclareIniVar clickyNoStack3 string Items " " 
   /call DeclareIniVar clicky4 string Items " " 
   /call DeclareIniVar clickyNoStack4 string Items " " 
   /call DeclareIniVar clicky5 string Items " " 
   /call DeclareIniVar clickyNoStack5 string Items " " 
   /call DeclareIniVar useFood int Items 1 
   /call DeclareIniVar statFood string Items " " 
   /call DeclareIniVar food1 string Items " " 
   /call DeclareIniVar food2 string Items " " 
   /call DeclareIniVar food3 string Items " " 
   /call DeclareIniVar food4 string Items " " 
   /call DeclareIniVar food5 string Items " " 
   /call DeclareIniVar meleeWep string Items " " 
   /call DeclareIniVar invisItem string Items " " 
   /call DeclareIniVar dispellItem string Items " " 
   /call DeclareIniVar tashFocusItem string Items " " 
   /call DeclareIniVar normalMainhand string Items "${InvSlot[mainhand].Item.Name}" 

   /squelch /custombind add ma 
   /squelch /custombind add sa 
   /squelch /alias /anchor /echo SetAnchor 
   /squelch /alias /manarobe /echo Mana Robe 
   /squelch /alias /setma /custombind set ma /assist 
   /squelch /alias /setsa /custombind set sa /assist 
    
   /declare  HomeX             int    outer ${Me.X}
   /declare  HomeY             int    outer ${Me.Y}
   /declare  TetheredToHome           outer TRUE
   /declare i int local 
   /declare j int local 
   /declare oldTarget int local 
   /declare Following outer FALSE
   /declare tempTimer timer local 0 
   /declare SpamTimer timer outer 150
   /varset castSub CheckForAdds 
:check_params 
   /if ( ${Defined[Param${i}]} ) { 
      /if ( ${Param${i}.Equal[ma]} ) { 
         /varcalc i ${i}+1 
          /call SetIniVar mainAssist Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[sa]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar secondAssist Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[radius]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar minRadius Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[minhp]} ) { 
         /varcalc i ${i}+1 
         /call SetIniVar minHP Settings "${Param${i}}" 
      } else /if ( ${Param${i}.Equal[buff]} ) { 
         /call SetIniVar autoBuff Settings 1 
      } else /if ( ${Param${i}.Equal[nobuff]} ) { 
         /call SetIniVar autoBuff Settings 0 
      } else /if ( ${Param${i}.Equal[nuke]} ) { 
         /call SetIniVar nukeMode Settings 1 
      } else /if ( ${Param${i}.Equal[nonuke]} ) { 
         /call SetIniVar nukeMode Settings 0 
      } else /if ( ${Param${i}.Equal[mez]} ) { 
         /call SetIniVar useMez Settings 1 
      } else /if ( ${Param${i}.Equal[nomez]} ) { 
         /call SetIniVar useMez Settings 0 
      } else /if ( ${Param${i}.Equal[debuff]} ) { 
         /call SetIniVar useDebuff Settings 1 
      } else /if ( ${Param${i}.Equal[nodebuff]} ) { 
         /call SetIniVar useDebuff Settings 0 
      } 
      /varcalc i ${i}+1 
      /goto :check_params 
   }    
   /if ( !${Me.Gem[${mezSpell}]} ) { 
      /if ( ${Me.Gem[bliss]} ) { 
         /call SetIniVar mezSpell Spells Bliss 
      } else /if ( ${Me.Gem[sleep]} ) { 
         /call SetIniVar mezSpell Spells Sleep 
      } else /if ( ${Me.Gem[apathy]} ) { 
         /call SetIniVar mezSpell Spells Apathy 
      } else /if ( ${Me.Gem[glamour of kintaz]} ) { 
         /call SetIniVar mezSpell Spells "Glamour of Kintaz" 
      } else /if ( ${Me.Gem[felicity]} ) { 
         /call SetIniVar mezSpell Spells Felicity 
      } else /if ( ${Me.Gem[euphoria]} ) { 
         /call SetIniVar mezSpell Spells Euphoria 
      } 
   } 
   /if ( !${InvSlot[chest].Item.Name.Equal[mana robe]} ) /call SetIniVar hpRobe Items "${InvSlot[chest].Item.Name}" 
   /call SwapStatFood 1 
   /squelch /alert clear 6 
   | /if ( ${autoAnnounce} ) /announce on 
   /echo AutoEnc Mode Activated 
   /if ( ${nukeMode} || ${useDebuff} || ${useMez} ) { 
      /echo Main Assist: ${mainAssist} 
      /if ( ${Bool[${secondAssist}]} ) /echo Secondary Assist: ${secondAssist} (if ${mainAssist} dies) 
   } 
   /if ( ${nukeMode} ) /echo Nuke Mode: ${nukeMode} 
   /if ( ${useDebuff} ) /echo Auto Debuffs Enabled 
   /if ( ${useMez} ) { 
      /echo Auto Mez adds within a radius of ${minRadius} 
      /if ( !${Me.Gem[${mezSpell}]} ) /memspell 7 "${mezSpell}" 
   } 
   /if ( ${autoBuff} ) /echo AutoBuff Mode: ${autoBuff} 
   /if ( ${useMount} ) /echo Mount is enabled. 
   /if ( ${manaRobeMode} ) /echo ManaRobe Mode: ${manaRobeMode} 
  :wait_for_target 
   /if ( ${nukeMode} || ${useDebuff} || ${useMez} ) /echo Waiting for target... 
   /varset newAdds 0 
   /varset validTarget 0 
  :wait_for_target2 
   /if ( ${Spawn[pc ${secondAssist}].ID} && ( !${Spawn[pc ${mainAssist}].ID} || ${Spawn[corpse ${mainAssist} radius ${minRadius}].ID} ) ) { 
      /varset mainTank ${secondAssist} 
   } else { 
      /varset mainTank ${mainAssist} 
   } 
   /if ( !${Corpse.Open} && ${Spawn[${mainAssist}].NearestSpawn[npc radius ${Math.Calc[${minRadius}*2]}].ID} && ( ${nukeMode} || ${useDebuff} || ${useMez} ) ) { 
      /if ( ${Me.Casting.ID} ) /call WaitCast 
      /assist ${mainTank} 
      /call ManaRobe 
      /varset oldTarget ${Target.ID} 
      /varset tempTimer 5 
      /call CheckRune 100 
   :wait_for_assist1 
      /call CheckTarget 
      /if ( ${tempTimer} && !${validTarget} ) /goto :wait_for_assist1 
   } 
   /call CheckTarget 
   /if (!${validTarget} || (!${nukeMode} && !${useDebuff} && !${useMez})) { 
      /doevents 
      /call CheckBuffs 
      /call CheckPet 
      /call CheckRune ${runeHP} 
      /if ( ${useAnchor} ) /call CheckLoc 
      /call ManaRobe 
      /goto :wait_for_target2 
   } 
   /echo Target Aquired >> ${Target.DisplayName} << 
   /varset petAttacking false 
   /varset engaged 0 
   /varset nukeWaitTimer 0 
   /varset mobID ${Target.ID} 
   /varset mobHPStart ${Target.PctHPs} 
   /call UpdateMobList 
   /call AddToList mobList ${mobID} 
   /if (${Defined[mezTimer${mobID}]}) /deletevar mezTimer${mobID} 
   /declare mezTimer${mobID} int outer -1 
   /varset newAdds 0 
   /varset nukeWaitTimer 0 
   /varset fightStartTime 0 
   /varset totalNonMeleeDmg 0 
   /varset totalMeleeDmg 0 
   /if ( ${Defined[waitTimer${mobID}]} ) /deletevar waitTimer${mobID} 
   /declare waitTimer${mobID} int outer -1 
   :check_add_loop 
   /if ( ( ${Target.PctHPs}>${minHP} && ${waitTimer${mobID}} ) || !${assistWaitTimer} ) { 
      /if ( ${Spawn[pc ${secondAssist}].ID} && ( !${Spawn[pc ${mainAssist}].ID} || ${Spawn[corpse ${mainAssist} radius ${minRadius}].ID} ) ) { 
         /varset mainTank ${secondAssist} 
      } else { 
         /varset mainTank ${mainAssist} 
      } 
      /if ( ${Me.Casting.ID} ) /call WaitCast 
      /assist ${mainTank} 
      /if ( ${useManaRobe} && ( ${refreshTime} || ${nukeWaiTimer} || !${nukeMode} ) ) /call ManaRobe 
      /varset tempTimer 8 
      :wait_for_assist 
      /call CheckForAdds 
      /doevents Timer 
      /if ( ${tempTimer} && ${Target.ID}==${mobID} ) /goto :wait_for_assist 
      /if ( ${Target.ID} && ${Target.ID}!=${mobID} ) { 
         /if ( ${Defined[mezTimer${mobID}]} ) /deletevar mezTimer${mobID} 
         /call DeleteFromList mobList ${mob} 
         /goto :wait_for_target 
      } 
      /varset assistWaitTimer 5s 
   } 
   /varset addIndex 1 
   :check_add_loop2 
   /call CheckForAdds 
   /if ( ${addIndex}>1 ) /goto :check_add_loop2 
   /if ( ${newAdds} ) /call MezAdds 
   /call CheckPet 
   /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Type.Equal[pet]} ) /goto :mob_dead 
   /if ( !${nukeMode} && !${useDebuff} && !${useMez} ) /goto :wait_for_target 
   /target id ${mobID} 
   /delay 1s ${Target.ID} == ${mobID}
   /if ( ( ${Target.PctHPs}<${mobHPStart} ) && ${Spawn[pc ${mainTank}].NearestSpawn[radius ${Math.Calc[${Spawn[${mobID}].MaxRangeTo}+10]} id ${mobID}].ID} && ${waitTimer${mobID}}<0  && ${Spawn[${mobID}].Distance3D}<=${minRadius} ) {  
      /deletevar waitTimer${mobID} 
      /declare waitTimer${mobID} timer outer ${engageDelay} 
   } 
   /doevents 
   /target id ${mobID} 
   /delay 1s ${Target.ID} == ${mobID}
   /if ( ${Target.PctHPs}>${minHP} && ${waitTimer${mobID}} ) /goto :check_add_loop 
   /if ( ${newAdds} ) /call MezAdds 
   /if ( !${engaged} ) { 
      /varset engaged 1 
      /echo Engaging >> ${Target.DisplayName} << 
   } 
   /if (${Me.Pet.ID} && !${petAttacking}) { 
      /pet attack 
      /varset petAttacking true 
   } 
   /call UpdateMobList 
   /doevents Timer 
   /if ( ${useDebuff} && !${newAdds} ) /call DebuffMobs 
   /if ( ${Spawn[${mobID}].Type.Equal[NPC]} || ( !${Spawn[${mobID}].Master.Type.Equal[PC]} && ${Spawn[${mobID}].Type.Equal[pet]} ) ) { 
      /target id ${mobID} 
      /delay 1s ${Target.ID} == ${mobID}
      /delay 1
   } else { 
      /goto :mob_dead 
   } 
   /if (!${newAdds} && (${slowTimer${mobID}} != 0 || !${useDebuff} || ${useTashOnly})) { 
      /call CheckRune 100 
      /call CheckBuffs 
      /target id ${mobID} 
      /delay 1s ${Target.ID} == ${mobID}
      /delay 1
      /if (${Target.Type.Equal[npc]} && (${Target.Class.CanCast} || ${Zone.ID}>=300 )) { 
         /if (${Me.SpellReady[Scryer's Trespass]}) /call Cast "Scryer's Trespass" spell 0 CheckForAdds 
         /if (${Me.SpellReady[Theft of Thought]}) /call Cast "Theft of Thought" spell 0 CheckForAdds 
      } 
      /target id ${mobID}
      /delay 1s ${Target.ID} == ${mobID}
      /if ( ${refreshTime}<20 && ( ${Target.PctHPs}<${mobHPStart} || ${minHP}==100 ) && !${newAdds} && ${Target.LineOfSight} && !${Me.TargetOfTarget.Name.Equal[${Me.Name}]} && !${nukeWaitTimer} && ${nukeMode} && ( ${Me.PctMana}>=${nukeMana} || ${nukeMode}==2 ) && ( ${Target.Type.Equal[NPC]} || ${Target.Type.Equal[pet]} ) ) { 
         /if ( !${fightStartTime} ) /varset fightStartTime ${MacroQuest.Running} 
         /call Cast "${nuke1}" gem4 0 CheckForAdds 
         /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) { 
            /if ( ${Me.Gem[${nuke2}]} ) { 
               /call Cast "${nuke2}" gem9 0 CheckForAdds 
            } else { 
               /call ManaRobe 
            } 
         } 
         /if ( ${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_RESISTED]} ) { 
            /if ( ${nukeMode}==1 ) { 
               /varcalc nukeWaitMod 5*(90 - ${Me.PctMana}) 
            } else { 
               /varset nukeWaitMod 0                
            } 
            /if ( ${nukeDelay}>${nukeWaitMod} ) { 
               /varset nukeWaitTimer ${nukeDelay} 
            } else { 
               /varset nukeWaitTimer ${nukeWaitMod} 
            } 
         } 
      } else /if (${useManaRobe}) { 
         /call ManaRobe 
      } 
   } 
   /goto :check_add_loop 
   :mob_dead 
   /call UpdateMobList 
   /echo Target Dead! 
   /echo ${UseMount}
   /if ( ${UseMount}==0 ) /echo I am not on Horse am now sitting down
   /if ( ${UseMount}==0 ) /sit
   /if ( ${cleanUp} ) /call CleanUp ${mobID}
   /doevents 
   /if ( ${useDPS} ) /call DisplayDPS 
/goto :wait_for_target

Sub CheckForAdds 
   /if (${Me.Casting.ID}) { 
      /doevents gate 
      /doevents rageon 
      /doevents rageoff 
      /doevents uquakey 
      /doevents setvar 
      /if (${castEndTime} > 5) /doevents chat 
      /if (${useMez} && ${newAdds} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Spawn[${petID}].Type.Equal[NPC]} ) /call Interrupt 
   } 
   /if ( ${Target.ID}==${mobID} && ${Me.TargetOfTarget.Type.Equal[pc]} && ${Me.TargetOfTarget.Class.Name.Equal[cleric]} && ${Me.TargetOfTarget.PctHPs}<=50 && ${Me.AltAbilityReady[soothing words]} ) { 
      /if ( ${Me.TargetOfTarget.ID}==${Group.Member[1].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[2].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[3].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[4].ID} || ${Me.TargetOfTarget.ID}==${Group.Member[5].ID} ) { 
         /if ( ${Me.Casting.ID} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Spawn[${petID}].Type.Equal[NPC]} ) /call Interrupt 
         /call Cast "soothing words" alt 
      } 
   } 
   :check_add_loop 
   /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} && !${petOff} ) { 
      /varset addIndex 1 
      /varset newAdds 0 
      /return 
   } 
   /if ( ${petCheck} ) { 
      /varset addID ${NearestSpawn[${addIndex},npc radius ${minRadius}].ID} 
   } else { 
      /varset addID ${NearestSpawn[${addIndex},pet radius ${minRadius}].ID} 
   } 
   /if ( ${addID} ) { 
      /if ( ( ${mezTimer${addID}}<=${Math.Calc[${mezDuration}-50]} || !${mezTimer${addID}} ) && ${Spawn[${addID}].Distance3D}<=${minRadius} && ${addID}!=${petID} && ${Spawn[${addID}].LineOfSight} && ${aggroAnim.Find[|${Spawn[${addID}].Animation}|]} && ${mezTimer${addID}}!=-1 && ( ( !${Spawn[${addID}].Master.Type.Equal[PC]} && ${Spawn[${addID}].Type.Equal[pet]} ) || ( ${Spawn[${addID}].Type.Equal[NPC]} && ${addID}!=${Spawn[${mobID}].Master.ID} ) ) ) { 
         /call AddToList addList ${addID} 
         /call AddToList mobList ${addID} 
         /if ( ${Macro.Return.Equal[1]} ) { 
            /if ( !${Defined[waitTimer${addID}]} ) /declare waitTimer${addID} timer outer ${engageDelay} 
            /echo Add detected! >> ${Spawn[${addID}].DisplayName} << 
         } 
         /varset newAdds 1 
      } 
      /varcalc addIndex ${addIndex}+1 
   } else { 
      /varcalc petCheck !${petCheck} 
      /varset addIndex 1 
   } 
/return 

Sub CheckPet 
   /if (${petOff} && ${Me.Pet.ID}) { 
      /varset petOff 0 
      /if ( !${addList.Find[[]} ) /varset newAdds 0 
   } 
   /doevents rageon rageoff
   /if (${Spawn[${petID}].Type.Equal[NPC]} && !${petOff} && ${useCharm} && ${petID} ) { 
      /echo Pet Off! 
      /varset petAttacking false 
      /varset newAdds 1 
      /varset petOff 1 
      /if (${useCharm} && ${Me.Casting.ID} && ${useMez} && ${newAdds} && !${Me.Casting.Name.Equal[${mezSpell}]} && !${Me.Casting.Name.Equal[${pbaeMezSpell}]} && !${Me.Casting.Name.Equal[${charmSpell}]}) /call Interrupt 
      /if (${useCharm}) { 
         /if (${autoAnnounce}) /docommand ${channelAnnounce} PET OFF!! snare/malo pls! 
         /target id ${petID} 
         /call Charm ${petID} 
      } 
   } 
|   /declare i int local 
|   /declare tempID int local 
|   /for i 1 to ${Group} 
|      /varset tempID ${Group.Member[${i}].Pet.ID} 
|      /if ( ${tempID} ) { 
|         /if ( !( ${slowTimer${tempID}}<0 ) ) { 
|            /if ( ${Defined[mezTimer${tempID}]} ) /deletevar mezTimer${tempID} 
|            /if ( ${Defined[slowTimer${tempID}]} ) /deletevar slowTimer${tempID} 
|            /if ( ${Defined[tashTimer${tempID}]} ) /deletevar tashTimer${tempID} 
|            /declare mezTimer${tempID} int outer -1 
|            /declare tashTimer${tempID} int outer -1 
|            /declare slowTimer${tempID} int outer -1 
|         } 
|      } 
|   /next i 
/return 

Sub MezAdds 
/echo in MezAdds
   /if (!${useMez}) {
     /varset newAdds 0
     /return
   }
   /declare tempID string local 
   /declare AEmezzed int local 0 
   :mez_adds_loop 
   /if (${addList.Find[[]}) { 
     /if ( ${addList.Find[[]}>1 ) /varset addList ${addList.Right[-${Math.Calc[${addList.Find[[]}-1]}]} 
     /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} ) /return 
     /varset tempID ${addList.Arg[1,[].Left[-1]} 
     /if (${mezzImmuneList.Find[|${Spawn[${tempID}].DisplayName}|]}) {
       /call DeleteFromList addList ${tempID} 
       /if (${autoAnnounce} && !${SpamTimer}) {
         /docommand ${privateChannel} ${Target.DisplayName} CANNOT BE MEZZED!  OFFTANK!
         /varset SpamTimer 150
       }
       /goto :mez_adds_loop 
     }
     /if (!${Spawn[${tempID}].Type.Equal[NPC]} && !${Spawn[${tempID}].Master.Type.Equal[NPC]}) { 
         /if ( ${Defined[mezTimer${tempID}]} ) /deletevar mezTimer${tempID} 
         /if ( ${Defined[slowTimer${tempID}]} ) /deletevar slowTimer${tempID} 
         /if ( ${Defined[tashTimer${tempID}]} ) /deletevar tashTimer${tempID} 
      } else { 
        /squelch /target id ${tempID}
        /delay 5 ${Target.ID} == ${tempID}
        /delay 1
        /if (!${AEmezzed} && ${Spawn[${tempID}].NearestSpawn[2,npc radius 30].ID} && ${Spawn[${tempID}].Distance3D} < 30 && ${addList.Count[[]} > 2 && ${Me.SpellReady[${aeMezSpell]}]}) { 
          /call Cast "${aeMezSpell}" 
          /varset AEmezzed 1 
        } 
        /echo Calling Mez on ${Target.DisplayName} with ID: ${Target.ID}
        /call Mez 
      } 
      /call DeleteFromList addList ${tempID} 
      /goto :mez_adds_loop 
   } 
   /varset newAdds 0 
/return 

Sub DebuffMobs 
   /declare i int local 
   /declare tempID string local 
   /if ( ${mobList.Find[[]} ) { 
      /if ( ${mobList.Find[[]}>1 ) /varset mobList ${mobList.Right[-${Math.Calc[${mobList.Find[[]}-1]}]} 
      /for i 1 to ${mobList.Count[[]} 
         /varset tempID ${mobList.Arg[${i},[].Left[-1]} 
         /if ( !${Defined[slowTimer${tempID}]} ) { 
            /if ( !${Spawn[${tempID}].Type.Equal[npc]} ) { 
               /declare slowTimer${tempID} int outer 0 
            } else /if ( ( ( !${waitTimer${tempID}} || ${mezTimer${tempID}}>0 ) && ( ${slowTimer${mobID}} || ${waitTimer${mobID}} ) ) || ${tempID}==${mobID} ) { 
               /call UpdateMobList 
               /doevents Timer 
               /target id ${tempID} 
               /delay 1s ${Target.ID} == ${tempID}
               /delay 1
               /if (!${tashTimer${tempID}}) /call Tash 
               /if (${useTashOnly}) /goto :noslow
               /if (${newAdds}) /return 
               /call Slow 
               :noslow
               /if (${addList.Find[[]}) /varset newAdds 1 
               /if (${newAdds}) /return 
               /if (${Macro.Return.Equal[CAST_CANCELLED]}) /return 
               /if (${newAdds}) /return 
            } 
         } 
      /if (!${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]}) /return 
      /next i 
   } 
/return 

Sub Charm(int tempID) 
   /target id ${tempID} 
   /if (${Spawn[${tempID}].Distance} > 80 && ${Me.SpellReady["${mezSpell}"]} && ${Me.CurrentMana} >= ${Spell["${mezSpell}"].Mana} && ${Spawn[${tempID}].LineOfSight}) {
     /fast fast nolook
     /call cast "${mezSpell}" gem1 6s CheckForAdds
   } else /if (${Spawn[${tempID}].Distance} > 60 && ${Me.Gem["${rootSpell}"]} && ${Me.SpellReady["${rootSpell}"]} && ${Me.CurrentMana} >= ${Spell["${rootSpell}"].Mana} && ${Spawn[${tempID}].LineOfSight}) {
     /fast fast nolook
     /call cast "${rootSpell}" gem8 6s CheckForAdds
   } else /if (${Me.Gem[${pbaeMezSpell}]} && ${Spawn[${tempID}].Level} <= ${maxPBAEMezLevel}) { 
      :MoveLoop
      /if (${Target.Distance} > 45) { 
         /face fast nolook 
         /keypress forward hold 
         /delay 1
         /goto :MoveLoop
       }
       /keypress forward
       /keypress back
       /delay 1
       :WaitLoop
       /if ( ${Target.Distance3D}<=35 ) { 
         /call Cast "${pbaeMezSpell}" gem6 6s CheckForAdds 
       } else {
         /delay 1
         /goto :WaitLoop
       }
   } else {
     /call cast "${mezSpell}" gem1 6s CheckForAdds
   }
   /target id ${tempID} 
   /delay 1
   /if ( ${tashTimer${tempID}}<5500 ) /call Tash 
   /call Cast "${charmSpell}" gem7
   /if (${Me.Pet.ID}) /target id ${Me.Pet.ID}
/return 

Sub Tash 
   :spell_loop 
   /if (!${Me.SpellReady[${Me.Gem[1]}]} && !${Me.SpellReady[${Me.Gem[2]}]} && !${Me.SpellReady[${Me.Gem[3]}]} && !${Me.SpellReady[${Me.Gem[4]}]}) {
     /delay 2
     /goto :spell_loop
   }
   /declare tempID int local ${Target.ID} 
   /if (${useTashFocus}) /call SwapItem "${tashFocusItem}" ${FindItem[${tashFocusItem}].WornSlot[1]} 
   /echo Casting: ${tashSpell} on ${Target.CleanName}
   /call Cast "${tashSpell}" gem2 1s 
   /if (!${Defined[tashTimer${tempID}]}) /declare tashTimer${tempID} timer outer 
   /if (${Macro.Return.Equal[CAST_SUCCESS]}) { 
      /varset tashTimer${tempID} ${tashDuration} 
   } else { 
      /varset tashTimer${tempID} 1 
   } 
   /if (${useTashFocus}) /call SwapItem "${normalMainhand}" mainhand 
/return ${Macro.Return} 

Sub Slow 
   /declare tempID int local ${Target.ID} 
   /doevents Hit 
   /call Cast "${slowSpell}" ${slowType} 6s CheckForAdds 
   /if ( !${Defined[slowTimer${tempID}]} ) /declare slowTimer${tempID} timer outer 
   /if ( ${Macro.Return.Equal[CAST_IMMUNE]} ) { 
      /deletevar slowTimer${tempID} 
      /declare slowTimer${tempID} int outer -1 
   } else /if ( ${Macro.Return.Equal[CAST_SUCCESS]} ) { 
      /varset slowTimer${tempID} ${slowDuration} 
      /if (${autoAnnounce}) ${privateChannel} >${Target.DisplayName}< has been SLOWED!
   } else /if ( ${newAdds} || ${Macro.Return.Equal[CAST_OUTOFMANA]} || ${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} ) { 
      /varset slowTimer${tempID} 50      
   } else { 
      /varset slowTimer${tempID} 1 
   } 
/return ${Macro.Return} 

Sub Mez
/echo in sub mez
   /declare tempID int local ${Target.ID} 
   /declare resistCount int local 0 
   /if (${Defined[mezTimer${tempID}]} && ${mezTimer${tempID}} > ${Math.Calc[${mezDuration}-20]}) /return  
   :mez_loop 
   /if (!${Me.SpellReady[${mezSpell}]}) {
     /delay 2
     /goto :mez_loop
   }
   /if (${Spawn[${tempID}].Type.Equal[PC]}) { 
      /call UpdateMobList
      /squelch /target clear
      /return 
   } 
   /if (${Target.PctHPs} < 85 && !${mezTimer${tempID}}) {
      /if (${Defined[mezTimer${tempID}]}) {
        /varset mezTimer${tempID} 99999
      } else { 
        /declare mezTimer${tempID} timer outer 99999
      }
      /if (${autoAnnounce}) ${privateChannel} ${Target.DisplayName} is being killed, no mezz 4 u!
      /return
   } 
   /if (!${Defined[mezTimer${tempID}]}) {
     /declare mezTimer${tempID} timer outer
   }
   /doevents Hit
   /if (${mezzImmuneList.Find[|${Target.DisplayName}|]}) {
     /varset mezTimer${tempID} -1 
     /if (${autoAnnounce}) ${privateChannel} ${Target.DisplayName} CANNOT BE MEZZED!  OFFTANK!
     /return
   }
   /echo Casting: ${mezSpell} on ${Target.CleanName}
   /if (!${mezzImmuneList.Find[${Target.DisplayName}]}) /call Cast "${mezSpell}" ${mezzGem} 3s
   /if ( ${Macro.Return.Equal[CAST_IMMUNE]} || ${Macro.Return.Equal[CAST_CANCELLED]} ) { 
     /varset mezTimer${tempID} int outer 10000
     /if (${autoAnnounce}) ${privateChannel} ${Target.DisplayName} CANNOT BE MEZZED!  OFFTANK!
     /if (!${mezzImmuneList.Find[${Target.DisplayName}]}) {
       /echo Adding ${Target.DisplayName} to MezzImmune list for ${Zone}
       /ini "${iniName}" "Excludes.${Zone}" "MezzImmune" "${mezzImmuneList}${Target.DisplayName}|"
       /varset mezzImmuneList ${Ini[${iniName},"Excludes.${Zone}",MezzImmune]}
     }
   } else /if ( ${Macro.Return.Equal[CAST_SUCCESS]} ) { 
     /varset mezTimer${tempID} ${mezDuration} 
     /if (${autoAnnounce}) ${privateChannel} ${Target.DisplayName} Is MEZZED!  You Break It, You Tank It! <TM>
   } else /if ( ${Macro.Return.Equal[CAST_OUTOFMANA]} || ${Macro.Return.Equal[CAST_OUTOFRANGE]} || ${Macro.Return.Equal[CAST_CANNOTSEE]} ) { 
     /varset mezTimer${tempID} 50      
   } else { 
     /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]}) {
       /if (${Me.SpellReady["${stunSpell}"]}) {
         /call Cast "${stunSpell}" gem7 2s 
       } else /if (${Me.SpellReady["${pbaeMezSpell}"]} && ${Spawn[${tempID}].Level} <= ${maxPBAEMezLevel}) {
         /call Cast "${pbaeMezSpell}" gem4 3s 
       }
     }
     /if ( ${Macro.Return.Equal[CAST_RESISTED]} ) { 
       /varcalc resistCount ${resistCount}+1 
       /if ( ${resistCount}==2 && !${tashTimer${addID}} ) /call Tash 
     } 
     /if ( !${Spawn[${mobID}].Type.Equal[NPC]} && !${Spawn[${mobID}].Master.Type.Equal[NPC]} && ${useMez} ) /return 
     /goto :mez_loop 
   }
/return ${Macro.Return} 

Sub Event_Timer(string timerName,int timerValue) 
   /if ( !${Defined[${timerName}]} ) /return 
   /declare tempID int local 0 
   /declare oldTargetID int local ${Target.ID} 
   /if ( ${timerName.Left[9].Equal[tashTimer]} ) { 
      /varset tempID ${timerName.Right[-9]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /call Tash 
      } else { 
         /deletevar ${timerName} 
      } 
   } else /if ( ${timerName.Left[9].Equal[slowTimer]} ) { 
      /varset tempID ${timerName.Right[-9]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /call Slow 
      } else { 
         /deletevar ${timerName} 
      } 
   } else /if ( ${timerName.Left[8].Equal[mezTimer]} ) { 
      /varset tempID ${timerName.Right[-8]} 
      /if ( ${Spawn[${tempID}].Type.Equal[NPC]} || ${Spawn[${tempID}].Master.Type.Equal[NPC]} ) { 
         /target id ${tempID} 
         /delay 1s ${Target.ID} == ${tempID}
         /delay 1
         /call Mez 
      } else { 
         /deletevar ${timerName} 
      } 
   } else { 
      /return ${Macro.Return} 
   } 
   /if ( ${Target.ID}==${tempID} ) { 
      /if ( ${Spawn[${oldTargetID}].ID} ) { 
         /target id ${oldTargetID} 
      } else { 
         /squelch /target clear 
      } 
   } 
/return ${Macro.Return} 

Sub ClickOffIllusion 
   /declare i int local 
   /for i 1 to 20 
      /if ( ${Me.Buff[${i}].Name.Find[illusion:]} ) /notify BuffWindow buff${Math.Calc[${i}-1].Int} leftmouseup 
   /next i 
/return 

Sub CheckBuffs 
   /if ( ${Zone.ID}!=${currentZone} ) /call Event_Zone 
   /varset deathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]} 
   /if (${deathFlag}) /call ImDead    
   /declare i int local 
   /declare oldTarget int local ${Target.ID} 
   /declare oldItemName string local 
   /declare foodName string local 
   /declare oldSlotID int local 
   /declare spellName string local 
   /declare buffText string local 
   /declare targetName string local 
   /declare spellName2 string local 
   /declare spellType string local 
   /declare spellRange int local 118 
   /declare tempID int local 
   /declare targetType string local 
   /doevents Indoors 
   /call CheckIniBuffs 
   /if (${Me.Pet.ID} && ${petID}!=${Me.Pet.ID} ) { 
      /varset petID ${Me.Pet.ID} 
      /if ( ${Defined[mezTimer${petID}]} ) /deletvar mezTimer${petID} 
      /if ( ${Defined[slowTimer${petID}]} ) /deletvar slowTimer${petID} 
   } 
   /if ( !${Me.Casting.ID} ) { 
      /if ( ${Me.Combat} ) { 
         /call SwapItem "${meleeWep}" mainhand 
      } else { 
         /call SwapItem "${normalMainhand}" mainhand 
      } 
   } 
   /if (${Cursor.Name.Equal[Rod of Mystical Transvergance]}) /autoinventory 
   /if (!${FindItem[Rod of Mystical Transvergance].ID} && ${Spawn[pc ${rodBitch} radius 200].ID} && !${askedForRodTimer} ) { 
      ;tell ${rodBitch} rod pls! 
      /varset askedForRodTimer 5m 
   } 
   /if (${FindItem[Rod of Mystical Transvergance].ID} && !${FindItem[Rod of Mystical Transvergance].Timer} && ${Me.PctHPs} > 50 && ${Me.PctMana}<=95 ) /call Cast "Rod of Mystical Transvergance" item 
   /if ( ${checkNamed} ) /call CheckNamed 

   /if ( ${Me.Hunger}<5000 && ${useFood} ) { 
      /call GetFoodName 
      /varset foodName ${Macro.Return} 
      /if ( ${Bool[${foodName}]} ) { 
         /varset oldSlotID ${FindItem[${foodName}].InvSlot.ID} 
         /call SwapItem "${foodName}" "pack8" 
         /nomodkey /itemnotify pack8 rightmouseup 
         /call SwapItem "${foodName}" "${oldSlotID}" 
      } 
   } 
   /if (!${autoBuff}) /goto :skip_buffs 
   /if ((${autoBuff}==2 || ${autoBuff}==4) && ${Target.ID}) /return 
   /if (${hasteGroup}) { 
      /for i 1 to ${Group} 
         /varset tempID ${Group.Member[${i}].ID} 
         /if ( ${tempID} ) { 
            /if ( !${Defined[hasteTimer${tempID}]} ) /declare hasteTimer${tempID} timer outer 
            /if ( ${Spawn[${tempID}].Type.Equal[pc]} ) { 
               /if ( !${hasteTimer${tempID}} ) { 
                  /if ( ${Group.Member[${i}].Class.PureCaster} ) { 
                     /deletevar hasteTimer${tempID} 
                     /declare hasteTimer${tempID} int outer -1 
                  } else { 
                     /call AddToQueue "sos,${Group.Member[${i}].Name}" 
                     /varset hasteTimer${tempID} 62m 
                  } 
               } 
            } else /if ( ${Spawn[${tempID}].Type.Equal[corpse]} ) { 
               /varset hasteTimer${tempID} 0 
            } 
         } else /if ( ${Defined[hasteTimer${tempID}]} ) { 
            /deletevar hasteTimer${tempID} 
         } 
      /next i 
   } 
:skip_buffs 
   /if ( !${Me.Mount.ID} && ${useMount} ) /call Cast "${InvSlot[ammo].Item.Name}" item 2s CheckForAdds 
   /if ( ${buffQueue.Find[[]} ) { 
      /if ( ${buffQueue.Find[[]}>1 ) /varset buffQueue ${buffQueue.Right[-${Math.Calc[${buffQueue.Find[[]}-1]}]} 
      /for i 1 to ${buffQueue.Count[[]} 
         /varset buffText [${buffQueue.Arg[${i},[]} 
         /varset spellName ${buffText.Arg[1,,].Right[-1]} 
         /if ( ${spellName.Right[1].Equal["]"]} ) /varset spellName ${spellName.Left[-1]} 
         /varset targetName ${buffText.Arg[2,,].Left[-1]} 
         /call GetBuffName "${spellName}" 
         /varset spellName ${Macro.Return.Arg[1,,]} 
         /varset spellType ${Macro.Return.Arg[2,,]} 
         /if ( ${spellType.Equal[item]} ) { 
            /varset spellName2 ${FindItem[${spellName}].Spell.Name} 
         } else { 
            /varset spellName2 ${spellName} 
         } 
         /if ( ${Spell[${spellName2}].TargetType.Equal[Group v2]} ) { 
            /varcalc spellRange 1.18*${Spell[${spellName2}].AERange} 
         } else { 
            /varcalc spellRange 1.18*${Spell[${spellName2}].Range} 
         } 
         /varset targetType pc 
         /if ( !${Spawn[pc ${targetName}].ID} ) /varset targetType pet          
         /if ( ${Bool[${spellName}]} ) { 
            /if (${spellName.Find[Illusion]} && ${Me.AltAbilityReady[Project Illusion]}) /call cast "Project Illusion" alt 1s
            /if ( ${Me.CurrentMana}>=${Math.Calc[${Spell[${spellName}].Mana}+${Me.ManaRegen}]} || ${spellType.Equal[item]} || ${spellType.Equal[alt]} ) { 
               /if ( !${Bool[${targetName}]} ) { 
                  /if (${spellName.Find[Illusion]} && ${Me.AltAbilityReady[Project Illusion]}) /call cast "Project Illusion" alt 1s
                  /call Cast "${spellName}" ${spellType} 4s CheckForAdds 
               } else /if ( ${Spawn[${targetType} ${targetName}].ID} && ( ${Spawn[pc ${targetName}].Distance3D}<=${spellRange} || !${spellRange} ) ) { 
                  /target ${targetType} ${targetName} 
                  /call Cast "${spellName}" ${spellType} 4s CheckForAdds 
                  /if ( ${Spawn[${oldTarget}].ID} ) { 
                     /if ( ${Target.Name.Equal[${targetName}]} ) /target id ${oldTarget} 
                  } else { 
                     /squelch /target clear 
                  }    
               } 
               /if ( ${Macro.Return.Equal[CAST_SUCCESS]} || ${Macro.Return.Equal[CAST_UNKNOWNSPELL]} || ${Macro.Return.Equal[CAST_NOTARGET]} || ( ${Macro.Return.Equal[CAST_CANCELLED]} && ( !${newAdds} || !${useMez} ) ) ) { 
                  /call DeleteFromQueue "${buffText}" 
                  /varcalc i ${i}-1 
               } 
            } 
         } else { 
            /call DeleteFromQueue "${buffText}" 
            /varcalc i ${i}-1 
         } 
      /next i 
   } 
/return 

Sub ImDead
   /declare i int local 
   /varset mobList 
   /varset addList 
   /varset buffQueue 
   /varset mobID 0 
   /varset petID 0 
   /varset useAnchor 0 
   /squelch alert clear 6 
   /call ClearMobList 
   :wait_for_loot 
   /varset deathFlag ${Math.Calc[!(${InvSlot[chest].Item.ID}>0)]} 
   /if ( ${Spawn[corpse radius 100 ${Me.Name}].ID} && ${deathFlag} ) { 
      /target mycorpse 
      /call LootCorpse 
      /delay 5 
      /goto :wait_for_loot 
   } 
   /if (${deathFlag}) { 
      /memspellset ${spellSet} 
      /echo You're dead! Consenting and waiting for rez... 
      /consent guild 
      /delay 25 
      /consent raid 
      /delay 25 
      /consent group 
      :wait_for_rez 
      /doevents 
      /delay 1s 
      /if ( !${Window[ConfirmationDialogBox].Open} ) /goto :wait_for_rez 
      /delay 18s !${Window[SpellBookWnd].Open} 
      /echo Yay a rez! 
      /call TakeRez 
      /delay 5s ${Spawn[corpse radius 100 ${Me.Name}].ID} 
      /goto :wait_for_loot 
   } 
/return 

Sub RezBuff 
   /if ( ${Me.Casting.ID} && ${castEndTime}<=5 ) { 
      /varset castReturn CAST_CANCELLED 
      /call TakeRez 
   } 
/return 

Sub TakeRez 
:wait_for_rez2 
   /if ( ${Window[ConfirmationDialogBox].Open} ) { 
      /delay 1 
      /notify ConfirmationDialogBox Yes_Button leftmouseup 
      /goto :wait_for_rez2 
   } 
/return 

Sub GetBuffName(string spellName) 
   /declare i int local 
   /declare buffText string local 
   /declare spellType string local 
   /if ( !${Me.Gem[4].SpellType.Equal[detrimental]} ) { 
      /varset spellType gem4 
   } else { 
      /varset spellType gem8
   } 
   /if ( ${spellName.Equal[gom]} ) /varset spellName Gift of Magic 
   /if ( ${spellName.Equal[c1]} ) { 
      /if ( ${FindItem[rod of infinite thought].ID} ) { 
         /varset spellName rod of infinite thought 
         /varset spellType item 
      } else { 
         /varset spellName clarity 
      } 
   } 
   /if ( ${spellName.Equal[c2]} ) /varset spellName Clarity II 
   /if ( ${spellName.Equal[c3]} ) { 
      /if ( ${FindItem[Wand of Tranquility].ID} ) { 
         /varset spellName Wand of Tranquility 
         /varset spellType item 
      } else { 
         /varset spellName Koadic's Endless Intellect 
      } 
   } 
   /if ( ${spellName.Equal[c4]} ) { 
      /if ( ${FindItem[Silken Augmenter's Pantaloons].ID} ) { 
         /varset spellName Silken Augmenter's Pantaloons 
         /varset spellType item 
      } else { 
         /varset spellName Tranquility 
      } 
   } 
   /if ( ${spellName.Equal[mgb]} ) { 
      /varset spellName Mass Group Buff 
      /varset spellType alt 
   } 
   /if ( ${spellName.Equal[c5]} ) /varset spellName Voice of Quellious 
   /if ( ${spellName.Equal[c6]} ) { 
      /if ( ${Group} && ${Me.Book[Voice of Clairvoyance]} && ${Me.Buff[Clairvoyance].Duration}<=5 && ${Me.Buff[Voice of Clairvoyance].Duration}<=5 ) { 
         /varset spellName Voice of Clairvoyance 
      } else { 
         /varset spellName Clairvoyance 
      } 
   } 
   /if ( ${spellName.Equal[haste]} ) { 
      /if ( ${Me.PctMana}>60 || !${FindItem[Romar's Pantaloons of Visions].ID} ) { 
         /varset spellType gem8
         /if ( ${Me.Gem[${groupHasteSpell}]} ) { 
            /varset spellName ${groupHasteSpell} 
         } else { 
            /varset spellName ${singleHasteSpell} 
         } 
      } else { 
         /varset spellName Romar's Pantaloons of Visions 
         /varset spellType item 
      } 
   } 
   /if ( ${spellName.Equal[sov]} || ${spellName.Equal[speed of vallon]} || ${spellName.Equal[vallon]} ) { 
      /varset spellName Romar's Pantaloons of Visions 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[shissar]} || ${spellName.Equal[snake]} ) { 
      /varset spellName Staff of the Serpent 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[see invis]} ) { 
      /varset spellName bracer of the hidden 
      /varset spellType item 
   } 
   /if ( ${spellName.Equal[mr]} || ${spellName.Equal[grm]} || ${spellName.Equal[gmr]} || ${spellName.Equal[god]} || ${spellName.Equal[magic resist]} ) /varset spellName Guard of Druzzil 
   /if ( ${spellName.Equal[lev]} ) /varset spellName Levitation 
   /if ( ${spellName.Equal[soe]} ) /varset spellName Speed of Ellowind 
   /if ( ${spellName.Equal[invis]} ) /varset spellName Cloud of Indifference 
   /if ( ${spellName.Equal[ivu]} ) /varset spellName Invisibility versus Undead 
   /if ( ${spellName.Equal[rune]} ) /varset spellName Rune of Zebuxoruk 
   /if ( ${spellName.Equal[ndt]} ) /varset spellName Night`s Dark Terror
   /if ( ${spellName.Left[3].Equal[pac]} ) /varset spellName Pacification 
   /if ( ${Me.Book[illusion: ${spellName}]} ) /varset spellName illusion: ${spellName} 
   /if ( ${spellName.Equal[tash]} ) { 
      /varset spellName ${tashSpell} 
      /varset spellType gem3 
   } 
   /if ( ${spellName.Equal[slow]} ) { 
      /varset spellName ${slowSpell} 
      /varset spellType ${slowType} 
   } 
   /if ( ${spellName.Equal[mez]} ) { 
      /varset spellName ${mezSpell} 
      /varset spellType gem7 
   } 
   /if ( ${spellName.Left[6].Equal[dispel]} ) { 
      /if ( ${Me.Gem[recant magic]} ) { 
         /varset spellName Recant Magic 
      } else { 
         /varset spellName ${dispellItem} 
         /varset spellType item 
      } 
   } 
   /for i 1 to 5 
      /if ( ${spellName.Equal[${buffName${i}}]} ) /varset spellType ${buffType${i}} 
   /next i 
   /if ( ( ${spellType.Find[gem]} || ${spellType.Equal[spell]} ) && !${Int[${Me.Book[${spellName}]}]} ) { 
      /if ( ${FindItem[${spellName}].ID} ) { 
         /varset spellType item 
      } else /if ( ${Me.AltAbility[${spellName}]} || ${spellName.Equal[${Int[${spellName}]}]} ) { 
         /varset spellType alt 
      } else { 
         /return 
      } 
   } 
/return ${spellName},${spellType} 

Sub CheckRune(int tempHP) 
   /if ( !${Me.Buff["${selfRune}"].ID} && !${Me.Buff["Rune of Shadows"].ID} && ${autoBuff} && ( ${Me.PctHPs}<=${tempHP} || ${Me.PctMana}==100 ) ) { 
      /call AddToQueue "${selfRune}" 
   } 
/return 

Sub SumPet 
   /declare i int local 
   /if ( ${Me.AltAbilityReady[persistent minion]} ) /alt activate 176 
   /delay 10s !${Me.Casting.ID} 
   /delay 5s ${Me.Pet.ID} 
   /if ( !${Me.Pet.ID} ) { 
      /call cast "${petSpell}" gem4 5s 
   } 
/return 

| ======================== EVENTS ======================== 

Sub Event_AutoStun(string line,string toggle) 
   /if ( !${Defined[useStun]} ) /declare useStun int outer 0 
   /if ( ${toggle.Equal[on]} ) { 
      /varset useStun 1 
   } else { 
      /varset useStun 0 
   } 
:stun_loop 
   /if ( ${useStun} ) { 
      /if ( ${refreshTime} ) /call ManaRobe 
      /call Cast "Color Cloud" 
      /call Cast "Color Slant" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew" 
      /call CheckRune 90 
      /doevents AutoStun 
      /doevents chat 
      /doevents setvars 
      /goto :stun_loop 
   } 
/return 

Sub Event_RageOn(string line) 
   /if ( ( ${line.Find[${Spawn[${mobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]} ) && ${Me.Pet.ID} ) { 
      /echo calling off pet... 
      /pet back off 
   } 
/return 

Sub Event_RageOff(string line) 
   /if ( ( ${line.Find[${Spawn[${mobID}].DisplayName}]} || ${line.Find[${Target.DisplayName}]} ) && ${Me.Pet.ID} ) { 
      /target id ${mobID} 
      /pet attack 
   } 
/return 

Sub Event_Mez 
   /if ( ${Defined[mezTimer${Target.ID}]} ) /deletevar mezTimer${Target.ID} 
   /call Mez 
/return 

Sub Event_Gate(string line,string mobName) 
   /if ( !${Me.Casting.Name.Equal[${mezSpell}]} ) /call Interrupt 
   /call Cast "${mezSpell}" gem7 3s CheckForAdds 
/return

And here is the ini
Code:
[Settings]
MainAssist=group
SecondAssist=NULL
PrivateChannel=/gsay
MaxMezLevel=88
MezzImmuneList=|
MaxAEMezLevel=88
MaxPBAEMezLevel=88
MinRadius=100
EngageDelay=25
MinHP=98
AutoBuff=1
UseMount=0
UseMez=1
UseDebuff=1
UseTashOnly=0
NukeMode=1
UseCharm=0
UseTashFocus=0
UseDPS=0
HasteGroup=1
ChannelAnnounce=1
NoInterrupt=0
UseManaStone=0
CheckNamed=0
NoInvis=1
UseManaRobe=0
ManaRobeMode=0
ManaRobeMinMana=70
ManaRobeMaxMana=90
NukeMana=50
NukeDelay=0
IgnoreList=NULL
RuneHP=10
CleanUp=0
SpellSet=slowbot
MezDuration=500
TashDuration=14m
SlowDuration=2100
AutoAnnounce=1
AnnounceTells=1
RodBitch=NULL
NoKnockBack=0
[PetSettings]
UsePet=0
UsePetGem=
PetSpell=
TotalPetBuffs=0
PetBuff1=
PetBuffIcon1=
PetBuffGem1=
[SelfBuffs]
UseSelfBuffs=0
TotalSelfBuffs=0
SelfBuff1=null
SelfBuffIcon1=null
SelfBuffGem1=gem9
SelfBuff2=null
SelfBuffIcon2=null
SelfBuffGem2=gem12
SelfBuff3=
SelfBuffIcon3=
SelfBuffGem3=
SelfBuff4=
SelfBuffIcon4=
SelfBuffGem4=
SelfBuff5=
SelfBuffIcon5=
SelfBuffGem5=
[Spells]
RootSpell=null
StunSpell=Color Conflux Rk. III
Nuke1=null
Nuke2=null
MezSpell=Befuddle Rk. III
MezGem=8
TashSpell=Bite of Tashani
SlowSpell=Desolate Deeds
SlowType=spell
CharmSpell=Dominate Rk. III
AeMezSpell=Ensorcelling Wave Rk. III
PbaeMezSpell=Docility Rk. II
Shielding=Mystic Shield
SingleHasteSpell=Speed of Ellowind
GroupHasteSpell=Hastening of Erradien Rk. III
SelfAARune=Rune of Shadows
SelfRune=Polychaotic Rune Rk. III
BuffList1=c9
BuffName1=Voice of Prescience Rk. III
BuffType1=gem2
BuffList2=haste
BuffName2=haste
BuffType2=gem1
BuffList3=rune
BuffName3=Dermal Brimstone Rk. III
BuffType3=gem3
BuffList4=tranq,c4
BuffName4=Tranquility
BuffType4=gem8
BuffList5=c3,kei,c3
BuffName5=koadic's endless intellect
BuffType5=gem8
BuffList6=ndt,terror
BuffName6=night`s dark terror
BuffType6=gem6
BuffList7=ghaste
BuffName7=Hastening of Erradien Rk. III
BuffType7=gem1
[Items]
HpRobe=Ordained Mindtwist Silk Robe
Clicky1=
ClickyNoStack1=
Clicky2=
ClickyNoStack2=
Clicky3=
ClickyNoStack3=
Clicky4=
ClickyNoStack4=
Clicky5=
ClickyNoStack5=
UseFood=1
StatFood=
Food1=
Food2=
Food3=
Food4=
Food5=
MeleeWep=
InvisItem=
DispellItem=
TashFocusItem=
NormalMainhand=Ice Crystal Staff

Well ,the mac is great and do mez add (which is the most important function..)..However ,it do have some problem that i cant fix:

1.it not not auto cast buff once the buff fade,u need send tell to the bot with "c9,haste " etc then it will cast buff..

2.it's always try to cast selfbuff and debuff (Tash and Slow) on mobs over again and again(that's why i turned off most of them through the .ini),seems the event NOT_HOLD didnt work well

3.it seems dont cast AE mez if there is more than 3 adds...it just try chain single mez...

4.i dont see it use ae stun..

Any idea? :)

Ps: About the Spell_routines1.inc ,i add 1 after the name coz i found i got 2 version of this inc file, in case of any akward problem,i just renamed it ...so the macro and inc file i both download from the post below:

http://www.mmobugs.com/forums/the-trash-can/1484-ench-mac-not-tested-have-no-ench.html

And I followed some infos in this thread too:

http://www.mmobugs.com/forums/everquest-macroquest2-macros-huds-and-uis/3450-autoenc.html

But still cant get the buff/debuff things work (once u turn on,it just keep casting and never stop...) And not use AE mez...
 
Last edited:
sometimes i get that error when trying to download from mq2 website, just wait a little while and try again, just worked for me
 
If your going to use the AutoEnchanter.mac from MQ2 VIP section, make sure you get version 1.71b. Many useful updates in that version.. including dual auras, improved stun function, and major overhaul to the logic.....
 
If your going to use the AutoEnchanter.mac from MQ2 VIP section, make sure you get version 1.71b. Many useful updates in that version.. including dual auras, improved stun function, and major overhaul to the logic.....

Is the 1.71b the one that says,

Code:
| autoenc.mac
| By Rusty~
| Last update Jan. 27 2008 by Nils

at the top of the mac?
 
no, page 16, files posted by Aborianus.. like in the middle somewhere.

Actually .. Nils uploaded and linked version 1.71b at the bottom of his 1st page thread ... but peeps saying they having issues downloading it.

But there is also the initial posting of it on page 16 of the article.... with the updated ini config.
 
Last edited:
the latest version has this on top of the mac
Code:
| AutoEnchanter.mac
| By Rusty~
| Update Jan. 27 2008 by Nils
| Last update Mar. 12 2010 by TreeHuginDruid/Aborianus
| Version 1.71b
 
got it thanks but it dont use aoe mez when 3 ) that can pose prob in convo )
 
For AE Mez goto the mezadds sub and Replace this:

Code:
/if (!${AEmezzed} && ${Spawn[${tempID}].NearestSpawn[2,npc radius 30].ID} && ${Spawn[${tempID}].Distance3D} < 30 && ${addList.Count[[]} > 2 && ${Me.SpellReady[${aeMezSpell}]}) {
/if (${announce}) /${chatChannel} Casting ${aeMezSpell} on >> >> ${Target.CleanName} << <<
/call Cast "${aeMezSpell}" ${aeMezGem}
/varset AEmezzed 1

with this:

Code:
/if (!${AEmezzed} && ${Spawn[${tempID}].NearestSpawn[2,npc radius 55].ID} && ${Spawn[${tempID}].Distance3D} < 30 && ${Me.SpellReady[${aeMezSpell}]}) {
/if (${announce}) /${chatChannel} Casting ${aeMezSpell} on >> >> ${Target.CleanName} << <<
/call Cast "${aeMezSpell}" ${aeMezGem}
/varset AEmezzed 1

Works for me. I would set the ini to have your targeted AEMez for both AE and PBAE mez spell.
 
Well, Thx a ton ,elj!!!

That change is so great ,now my enc is super good at mez/aemez thing !!
 
Chanter error

Not sure if this is the same macro but it is named the same, so guessing. It start up fine and then spams a error message and not sure how to fix the problem.

DoCommand - Couldn't parse '/exchange "${itemName}"
${slotName}'
spell_routines.inc@435 (SwapItem(itemName,slotName)):
/excange "${itemName}" ${slotName}
autoenc.mac@842 (CheckBuffs): /call SwapItem
"${normalMainhand}" mainhand
autoend.mac@344 (Main): /call CheckBuffs

Thanks in advance for any suggestions.
 
Last edited:
First: /plugin mq2exchange

Second: If it does say /excange on line 435 of spell_routines.inc, you need to make it /exchange.

htw
 
Thanks HTW, I feel so new, which I am.

that is gone now to fix the Item is already in a worn slot. spam in the window.
 
The spam is because its trying to swap your weapon.

You need to search and delete all lines/loops that use the term:

"SwapItem"
"mainhand"
"manarobe"

That will eliminate the spam. But make sure you know what you are doing because you have to delete some entire enclosures of:

else {
/call SwapItem etc
/blah blah blah
}

and some other stuff.
 
First off, thanks for the assistance with getting this fixed and working. Wanted to make sure I am removing the correct stuff.

Are the lines colored in red the lines I should be removing? This is just one example, pretty sure I can figure out the rest of it for the other areas.

Sub Tash
:spell_loop
/if (!${Me.SpellReady[${Me.Gem[1]}]} && !${Me.SpellReady[${Me.Gem[2]}]} && !${Me.SpellReady[${Me.Gem[3]}]} && !${Me.SpellReady[${Me.Gem[4]}]})
/delay 2
/goto :spell_loop
}
/declare tempID int local ${Target.ID}
/if (${useTashFocus}) /call SwapItem "${tashFocusItem}" ${FindItem[${tashFocusItem}].WornSlot[1]}
/echo Casting: ${tashSpell} on ${Target.CleanName}
/call Cast "${tashSpell}" gem2 1s
/if (!${Defined[tashTimer${tempID}]}) /declare tashTimer${tempID} timer outer
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/varset tashTimer${tempID} ${tashDuration}
} else {
/varset tashTimer${tempID} 1
}
/if (${useTashFocus}) /call SwapItem "${normalMainhand}" mainhand
/return ${Macro.Return}