• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Ranger Macro help..

Riddlerr

New member
Joined
May 21, 2005
RedCents
30¢
A few days ago someone posted about a ranger macro. and i directed them to the arch.mac on the mq fourms. well it made me out to be an ass , cause that has not been updated in the longest time. Here is the the code of the arch.mac. which i have found to be the best ranger macro around.

This has been updated to be working Fully (atleast as far as i can tell)

Arch.mac
Rich (BB code):
|** arch.mac Auto-Archery 
 Version 2.5        May 30, 2005 
 by loadingpleasewait ,Updated By Riddlerr **| 
#chat group 
#chat tell 

#include Spell_Routines.inc 
#turbo 40 
#Event exp                 "#*#experience!#*#" 
#Event reroot              "#*#Roots spell has worn off#*#" 
#Event Casting             "#*#You begin casting#*#" 
#Event Death               "You died#*#" 
#Event Death               "You have been slain by #*#!" 
#Event Zoned               "You have entered#*#" 
#Event EarthCall           "#*#slowed by the embracing earth#*#" 
#Event GotHit              "#*#YOU, but#*#" 
#Event GotHit              "#*#YOU for #*#" 
#Event Enraged             "#*#|${Target.CleanName}| has become ENRAGED#*#" 
#Event NLEnraged           "#*#|${Target.CleanName}| is no longer enraged#*#" 

#Event SetForage           "[MQ2] SetForage#*#" 
#Event SetSelfBuff         "[MQ2] SetSelfBuff#*#" 
#Event SetSnare            "[MQ2] SetSnare#*#" 
#Event SetTaunt            "[MQ2] SetTaunt#*#" 
#Event SetVerbose          "[MQ2] SetVerbose#*#" 
#Event SetRoot             "[MQ2] SetRoot#*#" 
#Event SetAutoAssist       "[MQ2] SetAutoAssist#*#" 
#Event SetAssistDistance   "[MQ2] SetAssistDistance#*#" 
#Event SetTankName         "[MQ2] SetTankName#*#" 
#Event AddSelfBuff         "[MQ2] AddSelfBuff#*#" 
#Event RemSelfBuff         "[MQ2] RemSelfBuff#*#" 
#Event DisplayHelp         "[MQ2] DisplayHelp#*#" 
#Event ArchStatus          "[MQ2] ArchStatus#*#" 
#Event SetNoArch           "[MQ2] SetNoArch#*#" 
#Event SetTargetSpells     "[MQ2] SetTSpells#*#" 
#Event LootMyCorpse        "[MQ2] LootMyCorpse#*#" 
#Event Harmony             "[MQ2] DoHarmony#*#" 
#Event AutoJolt            "[MQ2] SetJolt#*#" 
#Event PatchHeal           "[MQ2] SetPatchHeal#*#" 
#Event HealPct             "[MQ2] SetHealPct#*#" 
#Event ItemSet             "[MQ2] ItemSet#*#" 
#Event ItemBounce          "[MQ2] ItemBounce#*#" 
#Event ItemCast            "[MQ2] ItemCast#*#" 
#Event StopFight           "[MQ2] StopFighting!#*#" 
#Event SetDD1              "[MQ2] SetDD1#*#" 
#Event SetDD2              "[MQ2] SetDD2#*#" 

Sub Main 
   /echo Auto-Arch Macro Loading. 
   /declare j int outer 
   /declare g int outer 
   /declare Version outer 0 
   /declare autoassist bool outer FALSE 
   /declare noInvis int outer 1 
   /declare tankname string outer "Unknown" 
   /declare assistdistance outer 60 
   /declare healgrouppct outer 20 
   /declare PctToAssist outer 95 
   /declare noarch bool outer FALSE 
   /declare verbose bool outer FALSE 
   /declare targetspells bool outer FALSE 
   /declare foragetoggle bool outer FALSE 
   /declare waitforage bool outer FALSE 
   /declare invset outer 0 
   /declare notset outer -1 
   /declare sitstatus bool outer FALSE 
   /declare snaretoggle bool outer FALSE 
   /declare taunttoggle bool outer FALSE 
   /declare roottoggle bool outer FALSE 
   /declare needsnare outer 0 
   /declare immunetosnare bool outer FALSE 
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp} 
   /declare battle bool outer FALSE 
   /declare selfbuff bool outer FALSE 
   /declare autojolt bool outer FALSE 
   /declare diedBeforeZone bool outer FALSE 
   /declare useMU bool outer FALSE 
   /declare stickonnoarch bool outer FALSE 
   /declare rangerslowed bool outer FALSE 
   /declare leaveSlot string outer 
   /declare patchheal bool outer FALSE 
   /declare Healspell string outer "none" 
   /declare spellname string outer "none" 
   /declare triggername string outer "none" 
   /declare rootspell string outer "Earthen Roots" 
   /declare snarespell string outer "Ensnare" 
   /declare joltspell string outer "Cinder Jolt" 
   /declare targetarray[4] string outer 
   /declare ialias string outer None 
   /declare doIclick bool outer FALSE 
   /declare bouncenum int outer 1 
   /declare ibounce string outer None 
   /declare itemspellname string outer None 
   /declare isEnraged bool outer FALSE 
   /declare dd1 bool outer FALSE 
   /declare dd2 bool outer FALSE 
   /declare needdd1 bool outer TRUE 
   /declare needdd2 bool outer TRUE 
   /declare ddspell1 string outer "none" 
   /declare ddspell2 string outer "none" 
   /declare dir int outer 
   /declare behindTarget bool outer FALSE 
   /declare stopfighting bool outer FALSE 
   /declare eqassistonoff bool outer TRUE 

/if (${Ini[ArchSettings.ini,Version,ArchMacVersion].NotEqual[NULL]}) /varset Version ${Ini[ArchSettings.ini,Version,ArchMacVersion]} 
/if (${Stick.Status.Length}) { 
    /varset useMU TRUE 
    /echo ** MQ2MoveUtils FOUND AutoMovement AVAILABLE) 
  } else { 
    /varset useMU FALSE 
    /echo ** MQ2MoveUtils NOT FOUND AutoMovement UNAVAILABLE 
  } 
/if (!${Version.Equal[2.4]}) { 
      /echo Loading Aliases 
      /delay 1s 
   /squelch /alias /setforage /echo SetForage 
   /squelch /alias /setselfbuff /echo SetSelfBuff 
   /squelch /alias /setsnare /echo SetSnare 
   /squelch /alias /settaunt /echo SetTaunt 
   /squelch /alias /setverbose /echo SetVerbose 
   /squelch /alias /setroot /echo SetRoot 
   /squelch /alias /setnoarch /echo SetNoArch 
   /squelch /alias /setautoassist /echo SetAutoAssist 
   /squelch /alias /setassistdistance /echo SetAssistDistance 
   /squelch /alias /settankname /echo SetTankName 
   /squelch /alias /addselfbuff /echo AddSelfBuff 
   /squelch /alias /remselfbuff /echo RemSelfBuff 
   /squelch /alias /archhelp /echo DisplayHelp 
   /squelch /alias /archstatus /echo ArchStatus 
   /squelch /alias /lootmycorpse /echo LootMyCorpse 
   /squelch /alias /settspells /echo SetTSpells 
   /squelch /alias /harmony /echo DoHarmony 
   /squelch /alias /setjolt /echo SetJolt 
   /squelch /alias /setpatchheal /echo SetPatchHeal 
   /squelch /alias /sethealpct /echo SetHealPct 
   /squelch /alias /iset /echo ItemSet 
   /squelch /alias /ibounce /echo ItemBounce 
   /squelch /alias /iclick /echo ItemCast 
   /squelch /alias /stopfight /echo StopFighting! 
   /squelch /alias /setdd1 /echo SetDD1 
   /squelch /alias /setdd2 /echo SetDD2 
    
      /echo Aliases Loaded, play on! 
   } else { 
      /echo Aliases Up To Date, Finished Loading 
   } 
   /echo Type /ArchHelp for assistance 
    
/ini "ArchSettings.ini" "Version" "ArchMacVersion" "2.4" 

  /if (${Ini[ArchSettings.ini,General,HealSpell].NotEqual[NULL]}) /varset Healspell ${Ini[ArchSettings.ini,General,HealSpell]} 
  /if (${Ini[ArchSettings.ini,General,PatchHeal].NotEqual[NULL]}) /varset patchheal ${Ini[ArchSettings.ini,General,PatchHeal]} 
  /if (${Ini[ArchSettings.ini,General,JoltSpell].NotEqual[NULL]}) /varset joltspell ${Ini[ArchSettings.ini,General,JoltSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoJolt].NotEqual[NULL]}) /varset autojolt ${Ini[ArchSettings.ini,General,AutoJolt]} 
  /if (${Ini[ArchSettings.ini,General,RootSpell].NotEqual[NULL]}) /varset rootspell ${Ini[ArchSettings.ini,General,RootSpell]} 
  /if (${Ini[ArchSettings.ini,General,SnareSpell].NotEqual[NULL]}) /varset snarespell ${Ini[ArchSettings.ini,General,SnareSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoTaunt].NotEqual[NULL]}) /varset taunttoggle ${Ini[ArchSettings.ini,General,AutoTaunt]} 
  /if (${Ini[ArchSettings.ini,General,AutoForage].NotEqual[NULL]}) /varset foragetoggle ${Ini[ArchSettings.ini,General,AutoForage]} 
  /if (${Ini[ArchSettings.ini,General,AutoReRoot].NotEqual[NULL]}) /varset roottoggle ${Ini[ArchSettings.ini,General,AutoReRoot]} 
  /if (${Ini[ArchSettings.ini,General,Verbosity].NotEqual[NULL]}) /varset verbose ${Ini[ArchSettings.ini,General,Verbosity]} 
  /if (${Ini[ArchSettings.ini,General,NoArchery].NotEqual[NULL]}) /varset noarch ${Ini[ArchSettings.ini,General,NoArchery]} 
  /if (${Ini[ArchSettings.ini,General,StickOnNoArchery].NotEqual[NULL]}) /varset stickonnoarch ${Ini[ArchSettings.ini,General,StickOnNoArchery]} 
  /if (${Ini[ArchSettings.ini,General,SelfBuffing].NotEqual[NULL]}) /varset selfbuff ${Ini[ArchSettings.ini,General,SelfBuffing]} 
  /if (${Ini[ArchSettings.ini,General,TargetSpells].NotEqual[NULL]}) /varset targetspells ${Ini[ArchSettings.ini,General,TargetSpells]} 
  /if (${Ini[ArchSettings.ini,General,AutoAssist].NotEqual[NULL]}) /varset autoassist ${Ini[ArchSettings.ini,General,AutoAssist]} 
  /if (${Ini[ArchSettings.ini,General,TankToAssist].NotEqual[NULL]}) /varset tankname ${Ini[ArchSettings.ini,General,TankToAssist]} 
  /if (${Ini[ArchSettings.ini,General,AssistDistance].NotEqual[NULL]}) /varset assistdistance ${Ini[ArchSettings.ini,General,AssistDistance]} 
  /if (${Ini[ArchSettings.ini,General,PctHPsToAssist].NotEqual[NULL]}) /varset PctToAssist ${Ini[ArchSettings.ini,General,PctHPsToAssist]} 
  /if (${Ini[ArchSettings.ini,General,EQAssistOnOff].NotEqual[NULL]}) /varset eqassistonoff ${Ini[ArchSettings.ini,General,EQAssistOnOff]} 
  /if (${Ini[ArchSettings.ini,General,AutoSnare].NotEqual[NULL]}) /varset snaretoggle ${Ini[ArchSettings.ini,General,AutoSnare]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell1].NotEqual[NULL]}) /varset ddspell1 ${Ini[ArchSettings.ini,General,DDSpell1]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD1].NotEqual[NULL]}) /varset dd1 ${Ini[ArchSettings.ini,General,AutoDD1]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell2].NotEqual[NULL]}) /varset ddspell2 ${Ini[ArchSettings.ini,General,DDSpell2]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD2].NotEqual[NULL]}) /varset dd2 ${Ini[ArchSettings.ini,General,AutoDD2]} 
  /if (${snaretoggle}) { 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         } 

/for j 0 to 7 
  /if (${Defined[Param${j}]}) { 
     /if (${Param${j}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle TRUE 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
         } 
      /if (${Param${j}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
         } 
      /if (${Param${j}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
         } 
      /if (${Param${j}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
         } 
      /if (${Param${j}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose TRUE 
         /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
         } 
      /if (${Param${j}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch TRUE 
         /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
         } 
      /if (${Param${j}.Equal[selfbuff]}) { 
         /echo "SelfBuffing enabled" 
         /varset selfbuff TRUE 
         /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
         } 
      /if (${Param${j}.Equal[autoassist]}) { 
         /echo "Auto-Assist enabled" 
    /if (${eqassistonoff}) /assist on  
         /varset autoassist TRUE 
         /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
         /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
            /echo You need to target your assist, and make sure its a player character! 
            /endmacro 
         } else { 
         /varset tankname ${Target.CleanName} 
         /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
         /echo Assist set to ${tankname} 
         /if (${eqassistonoff}) /assist off 
         /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}"  
            } 
         } 
   } 
/next j 

      /if (!${Ini[ArchSettings.ini,SelfBuffs,SelfBuff1].Length}) { 
         /for j 1 to 10 
         /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "TargetBuffs" "TBuffTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "TargetBuffs" "TargetBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "AssistSpells" "ASpellTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "AssistSpells" "AssistSpell${j}" "NoSpellListed" 
         /next j 
      } 
/if (${autojolt}) /memspell 5 "${joltspell}" 
/if (${patchheal}) /memspell 8 "${Healspell}" 

:mainloop 
/if (${autoassist}) { 
   /assist ${tankname} 
      /if (${Target.Type.NotEqual[PC]} && ${Target.Distance}<${assistdistance} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs}<${PctToAssist}) { 
         /if (${Me.Sitting}) { 
            /stand 
            /varset sitstatus TRUE 
         } 
         /call Archery 
      } 
/delay 5 
} 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if ((${foragetoggle}) && (${Me.AbilityReady[Forage]})) /call forage 
         /doevents 
         /if (${selfbuff} && !${Me.Invis}) /call LazyRanger 

     |- If we're not hiding or moving, check clicky maintained spells 
     /if (${Me.Moving} || ${clicktimer} || ${Me.Invis}) /goto :DoneItemChecks 
     /varset j 1 
     :ItemCheckLoop 
     /varset ialias ${Ini[ArchSettings.ini].Arg[${j},|]} 
     /if (${ialias.NotEqual[NULL]}) { 
       |- Obtained an itemalias from the ArchSettings.ini file 
       |- We supposed to keep this spell up? 
       /if (${Ini[ArchSettings.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[ArchSettings.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[ArchSettings.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 j ${j}+1 
     } else /goto :DoneItemChecks 
     /goto :ItemCheckLoop 
     :DoneItemChecks 

/goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /varset battle TRUE 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
  /face nolook 
  :CloserAF    
  /if (${Me.Combat}) /attack off 
/if (${Target.Distance}>30 && ${Me.RangedReady} && !${noarch} && ${Target.LineOfSight} && ${Target.Animation}!=32 && ${Target.Animation}!=110) /ranged 
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[OFF]}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 60% behind uw 
       } else { 
         /squelch /stick 60% behind 
       } 
     } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
         /if (${patchheal}) /call healer 
         /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) /call forage 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${String[${snarespell}].Equal[Entrap]}) { 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
               /if (${String[${castReturn}].Equal[CAST_IMMUNE]}) {                
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
                  } 
               /if (${String[${castReturn}].Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${String[${castReturn}].Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has successfully been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
         } 
    /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /doevents 
    /if (${Target.Distance}<15) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
   /if (${stopfighting}) /goto :StopFight 
|         /if (${selfbuff}) /call LazyRanger 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
:StopFight 
/if (${stopfighting}) { 
   /varset stopfighting FALSE 
   /Popup AutoArch/Attack on ${targetarray[1]} is now OFF 
   /if (${useMU}) /stick off 
   /attack off 
   /varset autoassist FALSE 
   /echo AutoAssist is now OFF!! 
} 
    /if (${snaretoggle}) { 
      /varset needsnare 1 
      /varset immunetosnare FALSE 
   } 
    /keypress Num_5 
       /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
         /if (${dd1}) /varset needdd1 TRUE 
         /if (${dd2}) /varset needdd2 TRUE 
   /varset battle FALSE 
   /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[ON]}) /stick off 
   /varset rangerslowed FALSE 
  /varset isEnraged FALSE 
/return 

Sub closecombat 
   /popup Within Melee Range! CloseCombat Initiated!! 
   /attack on 
   :stillclose 
            /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
      /if (${patchheal}) /call healer 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle} && ${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${String[${snarespell}].Equal[Entrap]}) { 
            /if (!${Me.AltAbilityReady[entrap]}) /goto :waitforentrap 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
               /if (${String[${castReturn}].Equal[CAST_IMMUNE]}) {                
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
                  } 
               /if (${String[${castReturn}].Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${String[${castReturn}].Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has successfully been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
         } 
    /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
   :waitforentrap 
   /if (${isEnraged} && ${Target.ID} && !${Me.Combat}) { 
     /call Check_Behind 
     /varset behindTarget ${Macro.Return} 
     /if (${Target.ID} && ${behindTarget}) { 
       /attack on 
       /echo ** Attack re-started (No Enrage Risk): ${Target.CleanName} 
     }  
   } 
     /if (${isEnraged} && ${Target.ID}) { 
       /call Check_Behind 
       /varset behindTarget ${Macro.Return} 
       /if (${Target.ID} && !${behindTarget}) { 
         /attack off 
         /echo ** Attack ceased (Enrage Risk): ${Target.CleanName} 
       }  
     } 
/if (${stopfighting}) { 
/attack off 
/return 
} 
    /if (${Target.Distance}<${Target.MaxRangeTo} && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub DD1 
   /if (${needdd1} && ${Target.PctHPs}<70 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell1}" gem1 5s 
      /varset needdd1 FALSE 
   } 
   /return 

Sub Event_SetDD1(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell1 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell1" "${ddspell1}" 
} else { 
   /if (${dd1}) { 
    /varset dd1 FALSE 
    /echo ** Auto-DD @70% is now OFF! 
  } else { 
    /varset dd1 TRUE 
    /echo ** Auto-DD @70% is now ON! 
  } 
} 
  /echo ** DDSpell #1 == ${ddspell1} 
   /ini "ArchSettings.ini" "General" "AutoDD1" "${dd1}" 
/return 

Sub DD2 
   /if (${needdd2} && ${Target.PctHPs}<30 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell2}" gem3 5s 
      /varset needdd2 FALSE 
   } 
   /return 

Sub Event_SetDD2(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell2 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell2" "${ddspell2}" 
} else { 
   /if (${dd2}) { 
    /varset dd2 FALSE 
    /echo ** Auto-DD @30% is now OFF! 
  } else { 
    /varset dd2 TRUE 
    /echo ** Auto-DD @30% is now ON! 
  } 
} 
  /echo ** DDSpell #2 == ${ddspell2} 
   /ini "ArchSettings.ini" "General" "AutoDD2" "${dd2}" 
/return 

Sub Check_Behind 
  /declare behindIt FALSE 
  |- Are we behind our target? 
  /for j -1 to 1 
    /varcalc dir (${Target.Heading.Clock}+${j})%12 
    /if (${dir}<1) /varcalc dir ${dir}+12 
    /if (${dir}>12) /varcalc dir ${dir}-12 
    /if (${dir} == ${Me.Heading.Clock}) /varset behindIt TRUE 
  /next j    
/return ${behindIt} 

Sub Event_exp 
  /echo ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /popup ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /varset LDExp ${Me.PctGroupLeaderExp} 
  /varset AAExp ${Me.PctAAExp} 
  /varset Exp ${Me.PctExp} 
/return 


Sub event_reroot 
      /if (${roottoggle}) { 
         /target npc ${targetarray[3]} 
         :tryagain 
         /call Cast "${rootspell}" gem2 10s 
         /doevents 
         /if (${String[${castReturn}].Equal[CAST_RESIST]}) /goto :tryagain 
      } 
/return 

sub event_GotHit 
    /if (${autojolt} && ${Me.SpellReady[${joltspell}]}) { 
      /popup Agro Detected, Casting Jolt! 
      /call cast "${joltspell}" gem5 5s 
} 
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.MoveBehind}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 60% uw 
       } else { 
         /squelch /stick 60% 
       } 
     } 
/return 

sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 

sub forage 
   /delay 3 
   /if (${Me.Sitting}) { 
      /stand 
      /varset sitstatus TRUE 
   } 
   /if (${Me.Ducking}) /stand 
    
  :WaitLoop 
   /if (${Me.Casting.ID}) { 
      /delay 1 
      /goto :WaitLoop 
   } else { 
   /doability Forage 
   /doevents 
   } 
        
   /call destroyornot 
   /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
/return 

sub Event_waitforage 
   /if (${foragetoggle}) /varset waitforage TRUE 
/return 

sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notset}]} 
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /autoinv 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return 

Sub Event_SetForage 
  /if (${foragetoggle}) { 
    /varset foragetoggle FALSE 
    /echo ** Auto-Forage is now OFF! 
  } else { 
    /varset foragetoggle TRUE 
    /echo ** Auto-Forage is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
/return 
            
Sub Event_SetSelfBuff        
  /if (${selfbuff}) { 
    /varset selfbuff FALSE 
    /echo ** Self Buffing is now OFF! 
  } else { 
    /varset selfbuff TRUE 
    /echo ** Self Buffing is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
/return 

Sub Event_SetSnare(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset snarespell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "SnareSpell" "${snarespell}" 
} else { 
   /if (${snaretoggle}) { 
    /varset snaretoggle FALSE 
    /echo ** Auto-Snare is now OFF! 
  } else { 
    /varset snaretoggle TRUE 
    /echo ** Auto-Snare is now ON! 
  } 
} 
  /echo ** SnareSpell == ${snarespell} 
   /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
/return 

Sub Event_AutoJolt(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset joltspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "JoltSpell" "${joltspell}" 
} else { 
   /if (${autojolt}) { 
    /varset autojolt FALSE 
    /echo ** Auto-Jolt is now OFF! 
  } else { 
    /varset autojolt TRUE 
    /echo ** Auto-Jolt is now ON! 
    /memspell 5 "${joltspell}" 
  } 
} 
  /echo ** JoltSpell == ${joltspell} 
   /ini "ArchSettings.ini" "General" "AutoJolt" "${autojolt}" 
/return 
            
Sub Event_SetTaunt            
  /if (${taunttoggle}) { 
    /varset taunttoggle FALSE 
    /echo ** Auto-Taunt is now OFF! 
  } else { 
    /varset taunttoggle TRUE 
    /echo ** Auto-Taunt is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
/return 

Sub Event_SetVerbose 
  /if (${verbose}) { 
    /varset verbose FALSE 
    /echo ** Verbosity is now OFF! 
  } else { 
    /varset verbose TRUE 
    /echo ** Verbosity is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
/return 

Sub Event_SetNoArch(string Line) 
/if (${Line.Arg[3].Equal[stick]}) { 
  /if (!${useMU}) { 
   /echo Sorry, MQ2MoveUtils UNAVAILABLE, go get the plugin!! 
} else { 
   /if (${stickonnoarch}) { 
    /varset stickonnoarch FALSE 
    /echo ** /stick on NoArch Melee is now OFF! 
  } else { 
    /varset stickonnoarch TRUE 
    /echo ** /stick on NoArch Melee is now ON! 
  } 
} 
} else { 
  /if (${noarch}) { 
    /varset noarch FALSE 
    /echo ** Archery is now ON! 
  } else { 
    /varset noarch TRUE 
    /echo ** Archery is now OFF! 
  } 
} 
   /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
   /ini "ArchSettings.ini" "General" "StickOnNoArchery" "${stickonnoarch}" 
/return 
          
Sub Event_SetRoot(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset rootspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "RootSpell" "${rootspell}" 
} else { 
   /if (${roottoggle}) { 
    /varset roottoggle FALSE 
    /echo ** Auto-ReRoot is now OFF! 
  } else { 
    /varset roottoggle TRUE 
    /echo ** Auto-ReRoot is now ON! 
  } 
} 
  /echo ** RootSpell == ${rootspell} 
   /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
/return 
            
Sub Event_SetAutoAssist(string Line) 
/if (${Line.Arg[3].Length}) { 
   /varset PctToAssist ${Line.Arg[3]} 
   /echo ** HP% to Assist = ${PctToAssist} 
   /ini "ArchSettings.ini" "General" "PctHPsToAssist" "${PctToAssist}" 
} else { 
  /if (${autoassist}) { 
    /varset autoassist FALSE 
    /echo ** AutoAssist is now OFF! 
    /if (${eqassistonoff}) /squelch /assist on 
  } else { 
    /varset autoassist TRUE 
    /echo ** AutoAssist is now ON! 
    /if (${eqassistonoff}) /squelch /assist off 
  } 
} 
    /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/return 
      
Sub Event_SetAssistDistance(string Line) 
  /if (${Line.Arg[3].Length}) /varset assistdistance ${Line.Arg[3]} 
   /echo ** New AssistDistance == ${assistdistance} 
    /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}" 
/return 

Sub Event_SetTankName(string Line) 
  /if (${Line.Arg[3].Length}) /varset tankname ${Line.Arg[3]} 
   /echo ** New TankName == ${tankname} 
    /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
/return 

Sub Event_SetTargetSpells 
  /if (${targetspells}) { 
    /varset targetspells FALSE 
    /echo ** TargetSpells are now OFF! 
  } else { 
    /varset targetspells TRUE 
    /echo ** TargetSpells are now ON! 
  } 
   /ini "ArchSettings.ini" "General" "TargetSpells" "${targetspells}" 
/return 

Sub Event_Death 
   /varset diedBeforeZone TRUE 
   /delay 5s 
   /consent group 
   /delay 3s 
   /consent raid 
/return 

Sub Event_Zoned 
  /echo ** Zoned... Setting Autoassist to OFF! 
  /varset autoassist FALSE 
  /if (${eqassistonoff}) /squelch /assist on 
  /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/if (${diedBeforeZone}) { 
   /echo ** YOU DIED.. Setting AutoSelfBuff to OFF! 
   /varset selfbuff FALSE 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
   /varset diedBeforeZone FALSE 
   } 
/return 

Sub LazyRanger 

|====[Self Buffs]======================================== 

/for j 1 to 8 
/doevents 
/if (!${selfbuff}) /goto :FallOut 
      /varset spellname "${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}]}" 
        /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].NotEqual[NoBuffListed]}) { 
            /if (!${Me.Buff[${spellname}].ID}) { 
               /if (${Me.Sitting}) { 
               /stand 
               /varset sitstatus TRUE 
            } 
            /target ${Me} 
            /call Cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
            /if (${sitstatus} && !${battle}) { 
               /sit 
               /varset sitstatus FALSE 
   } 
} 
      } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
    /doevents 
    :Fallout 
/return 

Sub Event_AddSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[NoBuffListed]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "${Line.Arg[3]}" 
        /echo ** ${Line.Arg[3]} added as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Self Buff slots all filled! Get rid of some! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_RemSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[${Line.Arg[3]}]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
        /echo ** ${Line.Arg[3]} removed as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Can't find ${Line.Arg[3]} in SelfBuff list! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
      /if (!${targetspells}) /return 
|====[Target Buffs]======================================== 
/for j 1 to 8 
         /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}].Equal[NoBuffListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,TargetBuffs,TBuffTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
                  /if (${targetspells}) { 
                     /target ${Sender} 
                     /delay 2s 
                     /call cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
                     /if (${verbose}) /tell ${Sender} inc ${triggername} 
               } 
            } 
         } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to 8 
      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}].Equal[NoSpellListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,AssistSpell,ASpellTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
               /assist ${Sender} 
               /delay 2s 
               /call cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /if (${verbose}) /tell ${Sender} Inc ${spellname]} on %T. 
            } 
         } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
/return 

Sub Event_Harmony(string Line) 
   /declare spawnnum int local 1 
   /declare targ int local 0 
   /declare range int local 20 
   /if (${Line.Arg[3].Length}) /varset range ${Line.Arg[3]} 
   |Auto-harmonies mobs within a certain range of your target 
   |Directions: have a mob targeted, run the snippet, 
   |by the end of the code all of the mobs should be harmonied and your 
   |target ready to pull. 
   /echo ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /popup ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /varset targ ${Target.ID} 
   /varset spawnnum 1 
   :harmonyLoop 
      /if ( ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}].ID} ) { 
      /target ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}]} 
      /call Cast "Harmony of Nature" gem7 10s 
      /delay 55 
      /varset spawnnum ${Math.Calc[${spawnnum}+1]} 
      /echo incremented, retargeting ${targ} 
      /goto :harmonyLoop 
   } 
   /target id ${targ} 
   /echo ** Harmony Complete.. Go Ahead and Pull..  
   /popup ** Harmony Complete.. Go Ahead and Pull..  
/return 

Sub Event_LootMyCorpse(string Line) 
   /if (${Line.Arg[3].Length}) /varset leaveSlot ${Line.Arg[3]} 
   /declare lootTotal int local 0 
   /declare lootSlot int local 0 
   /declare skippedCount int local 0 
   /declare wornSlotNumber int local 0 
   /target mycorpse 

   /if (${Target.Type.NotEqual[CORPSE]}) { 
      /echo ** Can't target my corpse. 
      /return 
   } 
   /corpse 
   /delay 1s 
   /loot 
   /delay 1s 
   /if (${Me.State.NotEqual[BIND]}) { 
      /echo ** Error in getting onto corpse! Aborting. 
      /return 
   } 

   :lootLag 
   /varset lootTotal ${Corpse.Items}    
   /delay 2 
   /if (${lootTotal}!=${Corpse.Items}) { 
      /goto :lootLag 
   } 

   :doAgain 
   /for lootSlot 1 to ${lootTotal} 
      /if (${leaveSlot.Length}) { 
         /for wornSlotNumber 1 to ${Corpse.Item[${lootSlot}].WornSlots} 
            /if (${Corpse.Item[${lootSlot}].WornSlot[${wornSlotNumber}]} == ${InvSlot[${leaveSlot}].ID}) { 
               /varcalc skippedCount (${skippedCount} + 1) 
               /next lootSlot 
            } 
         /next wornSlotNumber 
      } 

      :lootItem 
      /if (${Corpse.Item[${lootSlot}].ID}) { 
         /itemnotify loot${lootSlot} rightmouseup 
         /delay 2 
         /goto :lootItem 
      } 
      /delay 2 
   /next lootSlot 
   /if (${Corpse.Items} > ${skippedCount}) /goto :doAgain 
   /delay 5 
   /echo ** Done looting my corpse. 
   /notify LootWnd DoneButton leftmouseup 
   /varset leaveSlot 
/return 

sub Event_EarthCall 
   /if (${verbose} && !${rangerslowed}) /gsay Ranger Slow Landed.. Hope it helps.. 
   /varset rangerslowed TRUE 
   /return 

Sub Event_PatchHeal(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset Healspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "HealSpell" "${Healspell}" 
} else { 
   /if (${patchheal}) { 
    /varset patchheal FALSE 
    /echo ** PatchHealing is now OFF! 
  } else { 
    /varset patchheal TRUE 
    /echo ** PatchHealing is now ON! 
    /memspell 8 "${Healspell}" 
  } 
} 
  /echo ** HealSpell == ${Healspell} 
   /ini "ArchSettings.ini" "General" "PatchHeal" "${patchheal}" 
/return 

Sub Event_HealPct(string Line) 
  /if (${Line.Arg[3].Length}) /varset healgrouppct ${Line.Arg[3]} 
   /echo ** New GroupHealPct == ${healgrouppct} 
    /ini "ArchSettings.ini" "General" "HealPct" "${healgrouppct}" 
/return 

Sub Healer 
/varset spellname ${Healspell} 
               /for g 1 to ${Group} 
               /if (${Group[${g}].ID} && ${Group[${g}].PctHPs}<${healgrouppct}) { 
               /target PC ${Group[${g}]} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /keypress esc 
               /if (${battle}==1) /target ${targetarray[3]}    
         } 
         /next g 
            /for g 1 to ${Group} 
               /if (${Group[${g}].Pet.ID} && ${Group[${g}].Pet.PctHPs}<${healgrouppct}) { 
               /target Pet ${Group[${g}].Pet} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /keypress esc 
               /if (${battle}==1) /target ${targetarray[3]}    
               } 
            /next g 
               /if (${Me.PctHPs}<${healgrouppct}) { 
               /target ${Me} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 ${Math.Calc[${Spell[${spellname}].MyCastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /keypress esc 
               /if (${battle}==1) /target ${targetarray[3]} 
            }              
/return 

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

Sub Event_ItemBounce(string Line) 
  |- Sanity check parameters 
  /if (!${Line.Arg[4].Length}) { 
    /echo ** Improper use of /ibounce 
    /echo -- /ibounce <itemalias> "Some Spell Name" 
    /echo -- For example: 
    /echo -- /ibounce gobby "Strength of Tunare" 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${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[ArchSettings.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 "ArchSettings.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
    /echo ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list 
  } 
/return 

Sub Event_ItemCast(string Line) 
  |- Sanity check parameter 
  /if (!${Line.Arg[3].Length}) { 
    /echo ** Improper use of /icast 
    /echo -- /icast <itemalias> 
    /echo -- For example: 
    /echo -- /icast gobby 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${Line.Arg[3]}] not in INI file! 
    /return 
  } 
  /declare fullname string local ${Ini[ArchSettings.ini,${Line.Arg[3]},FullName]} 
  |- Is it in a Bag? 
  /echo ** 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 
    /echo ** 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}) { 
      /echo ** Clicking: ${fullname} 
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup 
      /delay 2 
    } else { 
      /echo ** "${fullname}" not found! 
    } 
  } 
  :CastLoop 
  /delay 1 
  /if (${Me.Casting.ID}) /goto :CastLoop 
/return 

Sub Event_Enraged 
  /echo Enrage detected! Target: ${Target.CleanName} 
  /varset isEnraged TRUE 
/return 

Sub Event_NLEnraged 
  /echo Enrage done! Target: ${Target.CleanName} 
  /varset isEnraged FALSE 
  /if (${Target.ID} && ${battle}) /attack on 
/return 

Sub Event_StopFight 
/varset stopfighting TRUE 
/return 

sub Event_DisplayHelp 
   /echo -=Arch.Mac Help=- 
   /echo /SetSnare <SnareSpell> Toggles AutoSnare off/on or sets the snare spell 
   /echo /SetRoot <RootSpell> Toggles AutoReRoot off/on or sets the root spell 
   /echo /SetJolt <JoltSpell> Toggles AutoJolt off/on or sets the jolt spell 
   /echo /SetDD1 <DD1 Spell> Toggles AutoDD at 70% off/on or sets the DD1 spell 
   /echo /SetDD2 <DD2 Spell> Toggles AutoDD at 30% off/on or sets the DD2 spell 
   /echo /SetPatchHeal <HealSpell> Toggles PatchHealing off/on or sets the heal spell 
   /echo /SetHealPct <#> Sets the % when to patch heal 
   /echo /SetTaunt Toggles AutoTaunt off/on 
   /echo /SetForage Toggles AutoForage off/on 
   /echo /SetVerbose Toggles Verbosity off/on 
   /echo /SetSelfBuff Toggles SelfBuffing off/on 
   /echo /AddSelfBuff <BuffName> Adds a SelfBuff 
   /echo /RemSelfBuff <BuffName> Removes a SelfBuff 
   /echo /SetTSpells Toggles Targeted spells on tell on/off 
   /echo /SetAutoAssist <HP%> Toggles AutoAssist off/on with #% HP at which to Assist 
   /echo /SetTankName <TankName> Sets the TankName to AutoAssist 
   /echo /SetAssistdistance <distance> Sets the distance to target to start attacking 
   /echo /SetNoArch <stick> Turns Archery off/on if MQ2MoveUtils, <stick> will stick on the Target. 
   /echo /LootMyCorpse <ItemSlot> Loots your corpse except for <itemslot> if specified 
   /echo /Harmony <range> Harmonies all spawns within <range> of your target. 
   /echo /iset <itemalias> keepup|nokeepup <"Item Name"> - Item settings    
   /echo /ibounce <itemalias> <"Spell Name"> - Add bounce-off spell 
   /echo /iclick <itemalias> - Click cast item defined in <itemalias> 
   /echo /stopfight Stop Attacking Current Target 
   /echo /ArchHelp Shows this dialog 
   /echo /ArchStatus Shows Current Status 
/return 

sub Event_ArchStatus 
   /echo -=Arch.Mac Status=- 
   /echo AutoSnare: ${snaretoggle}, SnareSpell: ${snarespell} 
   /echo AutoReRoot: ${roottoggle}, RootSpell: ${rootspell} 
   /echo AutoDD 70%: ${dd1}, DDSpell1: ${ddspell1} 
   /echo AutoDD 30%: ${dd2}, DDSpell2: ${ddspell2} 
   /echo AutoJolt: ${autojolt}, JoltSpell: ${joltspell} 
   /echo PatchHeal: ${patchheal}, HealSpell: ${Healspell}, HealPct: ${healgrouppct} 
   /echo AutoTaunt: ${taunttoggle} 
   /echo AutoForage: ${foragetoggle} 
   /echo Verbosity: ${verbose} 
   /echo NoArchery: ${noarch} StickOnNoArchery: ${stickonnoarch} 
   /echo AutoSelfBuff: ${selfbuff} 
   /echo TargetSpells: ${targetspells} 
   /echo AutoAssist: ${autoassist}, TankName: ${tankname}, AssistDistance: ${assistdistance}, HPsToAssist: ${PctToAssist} 
   /echo Status Complete.... 
/return
Commands
Rich (BB code):
AVAILABLE COMMANDS: 
/SetSnare <SnareSpell>           Toggles AutoSnare off/on or sets the snare spell 
/SetRoot <RootSpell>             Toggles AutoReRoot off/on or sets the root spell 
/SetJolt <JoltSpell>             Toggles AutoJolt off/on or sets the jolt spell 
/SetDD1 <DD1 Spell>              Toggles AutoDD at 70% off/on or sets the DD1 spell. 
/SetDD2 <DD2 Spell>              Toggles AutoDD at 30% off/on or sets the DD2 spell. 
/SetPatchHeal <HealSpell>        Toggles PatchHealing off/on or sets the heal spell 
/SetHealPct <#>                  Sets the % when to patch heal 
/SetTaunt                        Toggles AutoTaunt off/on 
/SetForage                       Toggles AutoForage off/on 
/SetVerbose                      Toggles Verbosity off/on 
/SetTSpells                      Toggles Targeted spells on tell off/on 
/SetSelfBuff                     Toggles SelfBuffing off/on 
/AddSelfBuff <BuffName>          Adds a SelfBuff 
/RemSelfBuff <BuffName>          Removes a SelfBuff 
/SetAutoAssist <HP%>             Toggles AutoAssist off/on and %HPs the target needs to be under before assisting. 
/SetTankName <TankName>          Sets the TankName to AutoAssist 
/SetAssistdistance <#>           Sets the distance to target to start attacking 
/SetNoArch <stick>               Turns Archery off/on, if MQ2MoveUtils ENABLED, <stick> will stick on the Target. 
/LootMyCorpse <ItemSlot>         Loots your corpse except for <itemslot> if specified 
/Harmony <range>                 Harmonies all spawns within <range> of your target. 
/stopfight                       Stop Attacking Current Target 
/ArchHelp                        Shows this dialog 
/ArchStatus                      Shows Current Status 
===[ Clicky Item Commands ]===================================================== 
/iset <itemalias> keepup|nokeepup <"Item Name"> - Item settings 
/ibounce <itemalias> <"Spell Name"> - Add bounce-off spell 
/iclick <itemalias> - Click cast item defined in <itemalias>

Please Delete any archsettings.ini that you have
this us just and example of what mine looks like. DO NOT use it or it will not run correctly
Rich (BB code):
[Version]
ArchMacVersion=2.4
[SelfBuffs]
SelfBuff1=NoBuffListed
SelfBuff2=NoBuffListed
SelfBuff3=NoBuffListed
SelfBuff4=NoBuffListed
SelfBuff5=NoBuffListed
SelfBuff6=NoBuffListed
SelfBuff7=NoBuffListed
SelfBuff8=NoBuffListed
SelfBuff9=NoBuffListed
SelfBuff10=NoBuffListed
[TargetBuffs]
TBuffTriggerWord1=NoTriggerListed
TargetBuff1=NoBuffListed
TBuffTriggerWord2=NoTriggerListed
TargetBuff2=NoBuffListed
TBuffTriggerWord3=NoTriggerListed
TargetBuff3=NoBuffListed
TBuffTriggerWord4=NoTriggerListed
TargetBuff4=NoBuffListed
TBuffTriggerWord5=NoTriggerListed
TargetBuff5=NoBuffListed
TBuffTriggerWord6=NoTriggerListed
TargetBuff6=NoBuffListed
TBuffTriggerWord7=NoTriggerListed
TargetBuff7=NoBuffListed
TBuffTriggerWord8=NoTriggerListed
TargetBuff8=NoBuffListed
[AssistSpells]
ASpellTriggerWord1=NoTriggerListed
AssistSpell1=NoSpellListed
ASpellTriggerWord2=NoTriggerListed
AssistSpell2=NoSpellListed
ASpellTriggerWord3=NoTriggerListed
AssistSpell3=NoSpellListed
ASpellTriggerWord4=NoTriggerListed
AssistSpell4=NoSpellListed
ASpellTriggerWord5=NoTriggerListed
AssistSpell5=NoSpellListed
ASpellTriggerWord6=NoTriggerListed
AssistSpell6=NoSpellListed
ASpellTriggerWord7=NoTriggerListed
AssistSpell7=NoSpellListed
ASpellTriggerWord8=NoTriggerListed
AssistSpell8=NoSpellListed
[General]
SnareSpell=Earthen Shackles
AutoSnare=TRUE
DDSpell1=Ancient: North Wind
AutoDD1=TRUE
DDSpell2=Hearth Embers
AutoDD2=TRUE
PctHPsToAssist=97
AutoAssist=TRUE
TankToAssist=TankName01
AssistDistance=100
NoArchery=TRUE
StickOnNoArchery=TRUE
 
Last edited:
Please be sure. if you have used this macro before. Delete your old. ArchSettings.ini file.
 
Last edited:
to use any macro. you need to know the name of the macro itself. you can find all your macro's inside your release/macros folder. any file with a .mac is a macro itself. the .ini are normally where settings are stored. and .inc are basicllly like extensions of macros kinda like .dlls for programs.

to run one. you need to be in game and be on the character that you would like to run it on. Inside of the MQ2 chat window (sugjest putting it in there tell you get used to MQ2) you would type /mac <macroname> so for example.
as default macro that comes with MQ2 Release is called ShowBonuses, to run this you would do /mac showbonuses (then press enter to send it) this macro is a very simple one that will display all your bonuses (ie striketrough, Spell sheilding etc)

In order to take this code that is posted you will need Notepad or something simalar. you would select all the code in each code box and copy/paste it into notepad. then go to file>save as and name this Arch.mac. you would do the same with each of the files and name them what ever its called just about the code box.
Arch.mac

Code:

for example. you then need to move the file that you just created ( where ever you saved them to.) to your macroqest release/macros folder. you will not need to compile or even shut down mq2/eq.

Ive broken it down about as simple as i can think of. if you need more info visit Macroquest2.com click on the fourms and just read. damn near ANY info about how to do anything with MQ is there. just use search.

Just be carefull. BEFORE you post ANY thing.. use search. still cant find it. search again. still cant. then search one more time. alot of people on the fourms deal with people asking the same question over and over again. and will flame you w/o thinking twice, if you dont search before you post..

PS:.. NEVER ask about active hacks (ie warp, zone, afk macroing , etc) they do not support it AT ALL.. if you feel that you will continue to use MQ2. i sugjest donateing a few dollors to the devlopers. most no longer play EQ and do MQ as a hobby. just a way to say thanks for what you do for me. here some change..
 
what does this macro do , and do also need to copy the CODE to a txt file?
 
this sets up an auto ranger, and yes you copy it to a text file and name it a .mac

For further macro instructions such as how to setup a macro see the Guides section under the macro thread
 
check out the commands box.. 2nd code box,... thats all that it does... all the things it lets you do ....

it lets you AFK a ranger or BOT one 8-)
 
Here this version of it uses autofire instead of mashing the range button. When I parsed it out it was about 10% more dps.

Rich (BB code):
|** arch.mac Auto-Archery 
 Version 2.6        24 Sep 2005 
 by loadingpleasewait , updated by NeXuS With the help of a few people, autofire changes by Bardscorpse_01**|

#chat group 
#chat tell 

#include Spell_Routines.inc 
#turbo 40 
#Event exp                 "#*#experience!#*#" 
#Event reroot              "#*#Roots spell has worn off#*#" 
#Event Casting             "#*#You begin casting#*#" 
#Event Death               "You died#*#" 
#Event Death               "You have been slain by #*#!" 
#Event Zoned               "You have entered#*#" 
#Event EarthCall           "#*#slowed by the embracing earth#*#" 
#Event GotHit              "#*#YOU, but#*#" 
#Event GotHit              "#*#YOU for #*#" 
#Event Enraged             "#*#|${Target.CleanName}| has become ENRAGED#*#" 
#Event NLEnraged           "#*#|${Target.CleanName}| is no longer enraged#*#" 

#Event SetForage           "[MQ2] SetForage#*#" 
#Event SetSelfBuff         "[MQ2] SetSelfBuff#*#" 
#Event SetSnare            "[MQ2] SetSnare#*#" 
#Event SetTaunt            "[MQ2] SetTaunt#*#" 
#Event SetVerbose          "[MQ2] SetVerbose#*#" 
#Event SetRoot             "[MQ2] SetRoot#*#" 
#Event SetAutoAssist       "[MQ2] SetAutoAssist#*#" 
#Event SetAssistDistance   "[MQ2] SetAssistDistance#*#" 
#Event SetTankName         "[MQ2] SetTankName#*#" 
#Event AddSelfBuff         "[MQ2] AddSelfBuff#*#" 
#Event RemSelfBuff         "[MQ2] RemSelfBuff#*#" 
#Event DisplayHelp         "[MQ2] DisplayHelp#*#" 
#Event ArchStatus          "[MQ2] ArchStatus#*#" 
#Event SetNoArch           "[MQ2] SetNoArch#*#" 
#Event SetTargetSpells     "[MQ2] SetTSpells#*#" 
#Event LootMyCorpse        "[MQ2] LootMyCorpse#*#" 
#Event Harmony             "[MQ2] DoHarmony#*#" 
#Event AutoJolt            "[MQ2] SetJolt#*#" 
#Event PatchHeal           "[MQ2] SetPatchHeal#*#" 
#Event HealPct             "[MQ2] SetHealPct#*#" 
#Event ItemSet             "[MQ2] ItemSet#*#" 
#Event ItemBounce          "[MQ2] ItemBounce#*#" 
#Event ItemCast            "[MQ2] ItemCast#*#" 
#Event StopFight           "[MQ2] StopFighting!#*#" 
#Event SetDD1              "[MQ2] SetDD1#*#" 
#Event SetDD2              "[MQ2] SetDD2#*#" 
#Event SetUseepic          "[MQ2] Setuseepic#*#" 

Sub Main 
   /echo Auto-Arch Macro Loading. 
   /declare j int outer 
   /declare g int outer 
   /declare Version outer 0 
   /declare autoassist bool outer FALSE 
   /declare noInvis int outer 1 
   /declare tankname string outer "Unknown" 
   /declare assistdistance outer 60 
   /declare healgrouppct outer 25 
   /declare PctToAssist outer 95 
   /declare noarch bool outer FALSE 
   /declare verbose bool outer FALSE 
   /declare targetspells bool outer FALSE 
   /declare foragetoggle bool outer FALSE 
   /declare waitforage bool outer FALSE 
   /declare invset outer 0 
   /declare notset outer -1 
   /declare sitstatus bool outer FALSE 
   /declare snaretoggle bool outer FALSE 
   /declare taunttoggle bool outer FALSE 
   /declare roottoggle bool outer FALSE 
   /declare needsnare outer 0 
   /declare immunetosnare bool outer FALSE 
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp} 
   /declare battle bool outer FALSE 
   /declare selfbuff bool outer FALSE 
   /declare autojolt bool outer FALSE 
   /declare diedBeforeZone bool outer FALSE 
   /declare useMU bool outer FALSE 
   /declare stickonnoarch bool outer FALSE 
   /declare rangerslowed bool outer FALSE 
   /declare leaveSlot string outer 
   /declare patchheal bool outer FALSE 
   /declare Healspell string outer "none" 
   /declare spellname string outer "none" 
   /declare triggername string outer "none" 
   /declare rootspell string outer "Earthen Roots" 
   /declare snarespell string outer "Ensnare" 
   /declare joltspell string outer "Cinder Jolt" 
   /declare targetarray[4] string outer 
   /declare ialias string outer None 
   /declare doIclick bool outer FALSE 
   /declare bouncenum int outer 1 
   /declare ibounce string outer None 
   /declare itemspellname string outer None 
   /declare isEnraged bool outer FALSE 
   /declare dd1 bool outer FALSE 
   /declare dd2 bool outer FALSE 
   /declare needdd1 bool outer TRUE 
   /declare needdd2 bool outer TRUE 
   /declare ddspell1 string outer "none" 
   /declare ddspell2 string outer "none" 
   /declare dir int outer 
   /declare behindTarget bool outer FALSE 
   /declare stopfighting bool outer FALSE 
   /declare eqassistonoff bool outer TRUE 
   /declare EpicReady timer outer 
   /declare Epic outer "Heartwood Blade" 
   /declare Useepictoggle bool outer FALSE 
   /declare autofire bool outer FALSE

/if (${Ini[ArchSettings.ini,Version,ArchMacVersion].NotEqual[NULL]}) /varset Version ${Ini[ArchSettings.ini,Version,ArchMacVersion]} 
/if (${Stick.Status.Length}) { 
    /varset useMU TRUE 
    /echo ** MQ2MoveUtils FOUND AutoMovement AVAILABLE) 
  } else { 
    /varset useMU FALSE 
    /echo ** MQ2MoveUtils NOT FOUND AutoMovement UNAVAILABLE 
  } 
/if (!${Version.Equal[2.6]}) { 
      /echo Loading Aliases 
      /delay 1s 
   /squelch /alias /setforage /echo SetForage 
   /squelch /alias /setselfbuff /echo SetSelfBuff 
   /squelch /alias /setsnare /echo SetSnare 
   /squelch /alias /settaunt /echo SetTaunt 
   /squelch /alias /setverbose /echo SetVerbose 
   /squelch /alias /setroot /echo SetRoot 
   /squelch /alias /setnoarch /echo SetNoArch 
   /squelch /alias /setautoassist /echo SetAutoAssist 
   /squelch /alias /setassistdistance /echo SetAssistDistance 
   /squelch /alias /settankname /echo SetTankName 
   /squelch /alias /addselfbuff /echo AddSelfBuff 
   /squelch /alias /remselfbuff /echo RemSelfBuff 
   /squelch /alias /archhelp /echo DisplayHelp 
   /squelch /alias /archstatus /echo ArchStatus 
   /squelch /alias /lootmycorpse /echo LootMyCorpse 
   /squelch /alias /settspells /echo SetTSpells 
   /squelch /alias /harmony /echo DoHarmony 
   /squelch /alias /setjolt /echo SetJolt 
   /squelch /alias /setpatchheal /echo SetPatchHeal 
   /squelch /alias /sethealpct /echo SetHealPct 
   /squelch /alias /iset /echo ItemSet 
   /squelch /alias /ibounce /echo ItemBounce 
   /squelch /alias /iclick /echo ItemCast 
   /squelch /alias /stopfight /echo StopFighting! 
   /squelch /alias /setdd1 /echo SetDD1 
   /squelch /alias /setdd2 /echo SetDD2 
   /squelch /alias /setuseepic /echo Setuseepic 
    
      /echo Aliases Loaded, play on! 
   } else { 
      /echo Aliases Up To Date, Finished Loading 
   } 
   /echo Type /ArchHelp for assistance 
    
/ini "ArchSettings.ini" "Version" "ArchMacVersion" "2.6" 

  /if (${Ini[ArchSettings.ini,General,HealSpell].NotEqual[NULL]}) /varset Healspell ${Ini[ArchSettings.ini,General,HealSpell]} 
  /if (${Ini[ArchSettings.ini,General,PatchHeal].NotEqual[NULL]}) /varset patchheal ${Ini[ArchSettings.ini,General,PatchHeal]} 
  /if (${Ini[ArchSettings.ini,General,JoltSpell].NotEqual[NULL]}) /varset joltspell ${Ini[ArchSettings.ini,General,JoltSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoJolt].NotEqual[NULL]}) /varset autojolt ${Ini[ArchSettings.ini,General,AutoJolt]} 
  /if (${Ini[ArchSettings.ini,General,RootSpell].NotEqual[NULL]}) /varset rootspell ${Ini[ArchSettings.ini,General,RootSpell]} 
  /if (${Ini[ArchSettings.ini,General,SnareSpell].NotEqual[NULL]}) /varset snarespell ${Ini[ArchSettings.ini,General,SnareSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoTaunt].NotEqual[NULL]}) /varset taunttoggle ${Ini[ArchSettings.ini,General,AutoTaunt]} 
  /if (${Ini[ArchSettings.ini,General,AutoForage].NotEqual[NULL]}) /varset foragetoggle ${Ini[ArchSettings.ini,General,AutoForage]} 
  /if (${Ini[ArchSettings.ini,General,AutoReRoot].NotEqual[NULL]}) /varset roottoggle ${Ini[ArchSettings.ini,General,AutoReRoot]} 
  /if (${Ini[ArchSettings.ini,General,Verbosity].NotEqual[NULL]}) /varset verbose ${Ini[ArchSettings.ini,General,Verbosity]} 
  /if (${Ini[ArchSettings.ini,General,NoArchery].NotEqual[NULL]}) /varset noarch ${Ini[ArchSettings.ini,General,NoArchery]} 
  /if (${Ini[ArchSettings.ini,General,StickOnNoArchery].NotEqual[NULL]}) /varset stickonnoarch ${Ini[ArchSettings.ini,General,StickOnNoArchery]} 
  /if (${Ini[ArchSettings.ini,General,SelfBuffing].NotEqual[NULL]}) /varset selfbuff ${Ini[ArchSettings.ini,General,SelfBuffing]} 
  /if (${Ini[ArchSettings.ini,General,TargetSpells].NotEqual[NULL]}) /varset targetspells ${Ini[ArchSettings.ini,General,TargetSpells]} 
  /if (${Ini[ArchSettings.ini,General,AutoAssist].NotEqual[NULL]}) /varset autoassist ${Ini[ArchSettings.ini,General,AutoAssist]} 
  /if (${Ini[ArchSettings.ini,General,TankToAssist].NotEqual[NULL]}) /varset tankname ${Ini[ArchSettings.ini,General,TankToAssist]} 
  /if (${Ini[ArchSettings.ini,General,AssistDistance].NotEqual[NULL]}) /varset assistdistance ${Ini[ArchSettings.ini,General,AssistDistance]} 
  /if (${Ini[ArchSettings.ini,General,PctHPsToAssist].NotEqual[NULL]}) /varset PctToAssist ${Ini[ArchSettings.ini,General,PctHPsToAssist]} 
  /if (${Ini[ArchSettings.ini,General,HealPct].NotEqual[NULL]}) /varset healgrouppct ${Ini[ArchSettings.ini,General,HealPct]} 
  /if (${Ini[ArchSettings.ini,General,EQAssistOnOff].NotEqual[NULL]}) /varset eqassistonoff ${Ini[ArchSettings.ini,General,EQAssistOnOff]} 
  /if (${Ini[ArchSettings.ini,General,AutoSnare].NotEqual[NULL]}) /varset snaretoggle ${Ini[ArchSettings.ini,General,AutoSnare]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell1].NotEqual[NULL]}) /varset ddspell1 ${Ini[ArchSettings.ini,General,DDSpell1]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD1].NotEqual[NULL]}) /varset dd1 ${Ini[ArchSettings.ini,General,AutoDD1]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell2].NotEqual[NULL]}) /varset ddspell2 ${Ini[ArchSettings.ini,General,DDSpell2]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD2].NotEqual[NULL]}) /varset dd2 ${Ini[ArchSettings.ini,General,AutoDD2]} 
  /if (${Ini[ArchSettings.ini,General,Useepic].NotEqual[NULL]}) /varset Useepictoggle ${Ini[ArchSettings.ini,General,Useepic]} 
  /if (${snaretoggle}) { 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         } 

/for j 0 to 7 
  /if (${Defined[Param${j}]}) { 
     /if (${Param${j}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle TRUE 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
         } 
      /if (${Param${j}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
         } 
      /if (${Param${j}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
         } 
      /if (${Param${j}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
         } 
      /if (${Param${j}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose TRUE 
         /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
         } 
      /if (${Param${j}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch TRUE 
         /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
         } 
      /if (${Param${j}.Equal[selfbuff]}) { 
         /echo "SelfBuffing enabled" 
         /varset selfbuff TRUE 
         /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
         } 
       /if (${Param${j}.Equal[Useepic]}) { 
         /echo "Useepic enabled" 
         /varset Useepictoggle TRUE 
         /ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
         } 
      /if (${Param${j}.Equal[autoassist]}) { 
         /echo "Auto-Assist enabled" 
    /if (${eqassistonoff}) /assist on  
         /varset autoassist TRUE 
         /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
         /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
            /echo You need to target your assist, and make sure its a player character! 
            /endmacro 
         } else { 
         /varset tankname ${Target.CleanName} 
         /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
         /echo Assist set to ${tankname} 
         /if (${eqassistonoff}) /assist off 
         /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}"  
            } 
         } 
   } 
/next j 

      /if (!${Ini[ArchSettings.ini,SelfBuffs,SelfBuff1].Length}) { 
         /for j 1 to 10 
         /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "TargetBuffs" "TBuffTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "TargetBuffs" "TargetBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "AssistSpells" "ASpellTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "AssistSpells" "AssistSpell${j}" "NoSpellListed" 
         /next j 
      } 
/if (${autojolt}) /memspell 5 "${joltspell}" 
/if (${patchheal}) /memspell 8 "${Healspell}" 

:mainloop 
 /if (${patchheal}) /call healer 
/if (${autoassist}) { 
   /assist ${tankname} 
      /if (${Target.Type.NotEqual[PC]} && ${Target.Distance}<${assistdistance} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs}<${PctToAssist}) { 
         /if (${Me.Sitting}) { 
            /stand 
            /varset sitstatus TRUE 
         } 
         /call Archery 
      } 
/delay 5 
} 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if ((${foragetoggle}) && (${Me.AbilityReady[Forage]})) /call forage 
         /doevents 
         /if (${selfbuff} && !${Me.Invis}) /call LazyRanger 

     |- If we're not hiding or moving, check clicky maintained spells 
     /if (${Me.Moving} || ${clicktimer} || ${Me.Invis}) /goto :DoneItemChecks 
     /varset j 1 
     :ItemCheckLoop 
     /varset ialias ${Ini[ArchSettings.ini].Arg[${j},|]} 
     /if (${ialias.NotEqual[NULL]}) { 
       |- Obtained an itemalias from the ArchSettings.ini file 
       |- We supposed to keep this spell up? 
       /if (${Ini[ArchSettings.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[ArchSettings.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[ArchSettings.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 j ${j}+1 
     } else /goto :DoneItemChecks 
     /goto :ItemCheckLoop 
     :DoneItemChecks 

/goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /varset battle TRUE 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
  /face nolook 
  :CloserAF    
  /if (${Me.Combat}) /attack off 
  /if (${Target.Distance}>30 && ${Me.RangedReady} && !${noarch} && ${Target.LineOfSight} && ${Target.Animation}!=32 && ${Target.Animation}!=110 && !${autofire}) {
  /varset autofire TRUE
  /autofire on
  }
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[OFF]}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 behind uw 
       } else { 
         /squelch /stick 10 behind 
       } 
     } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
         /if (${patchheal}) /call healer 
         /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) /call forage 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
               /if (${castReturn.Equal[CAST_IMMUNE]}) {                
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
                  } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
   /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
    } /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /doevents 
    /if (${Target.Distance}<15) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
   /if (${stopfighting}) /goto :StopFight 
|         /if (${selfbuff}) /call LazyRanger 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /varset autofire FALSE
    /autofire off 
:StopFight 
/if (${stopfighting}) { 
   /varset stopfighting FALSE
   /Popup AutoArch/Attack on ${targetarray[1]} is now OFF 
   /if (${useMU}) /stick off 
   /attack off 
   /varset autoassist FALSE 
   /echo AutoAssist is now OFF!! 
} 
    /if (${snaretoggle}) { 
      /varset needsnare 1 
      /varset immunetosnare FALSE 
   } 
    /keypress Num_5 
       /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
         /if (${dd1}) /varset needdd1 TRUE 
         /if (${dd2}) /varset needdd2 TRUE 
   /varset battle FALSE 
   /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[ON]}) /stick off 
   /varset rangerslowed FALSE 
  /varset isEnraged FALSE 
/return 

Sub closecombat 
   /popup Within Melee Range! CloseCombat Initiated!! 
   /attack on 
   :stillclose 
            /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
      /if (${patchheal}) /call healer 
      /if (${Useepictoggle} !${EpicReady}) /call Useepic 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle} && ${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /if (!${Me.AltAbilityReady[entrap]}) /goto :waitforentrap 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
                /if (${castReturn.Equal[CAST_IMMUNE]}) {                  
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
               } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
    /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
 } 
   :waitforentrap 
   /if (${isEnraged} && ${Target.ID} && !${Me.Combat}) { 
     /call Check_Behind 
     /varset behindTarget ${Macro.Return} 
     /if (${Target.ID} && ${behindTarget}) { 
       /attack on 
       /echo ** Attack re-started (No Enrage Risk): ${Target.CleanName} 
     }  
   } 
     /if (${isEnraged} && ${Target.ID}) { 
       /call Check_Behind 
       /varset behindTarget ${Macro.Return} 
       /if (${Target.ID} && !${behindTarget}) { 
         /attack off 
         /echo ** Attack ceased (Enrage Risk): ${Target.CleanName} 
       }  
     } 
/if (${stopfighting}) { 
/attack off 
/return 
} 
    /if (${Target.Distance}<${Target.MaxRangeTo} && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub DD1 
   /if (${needdd1} && ${Target.PctHPs}<70 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell1}" gem1 5s 
      /varset needdd1 FALSE 
   } 
   /return 

Sub Useepic  
   /if (${Useepictoggle} && !${EpicReady}) /call cast ${Epic} item 
   } 
   /varset EpicReady 360s 
   } 
   /return 


Sub Event_SetUseepic(string Line) 
   /if (${Useepictoggle}) { 
    /varset Useepictoggle FALSE 
    /echo ** Useepic is now OFF! 
  } else { 
    /varset Useepictoggle TRUE 
    /echo ** Useepic is now ON! 
  } 
}  
/ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
/return 

Sub Event_SetDD1(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell1 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell1" "${ddspell1}" 
} else { 
   /if (${dd1}) { 
    /varset dd1 FALSE 
    /echo ** Auto-DD @70% is now OFF! 
  } else { 
    /varset dd1 TRUE 
    /echo ** Auto-DD @70% is now ON! 
  } 
} 
  /echo ** DDSpell #1 == ${ddspell1} 
   /ini "ArchSettings.ini" "General" "AutoDD1" "${dd1}" 
/return 

Sub DD2 
   /if (${needdd2} && ${Target.PctHPs}<30 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell2}" gem3 5s 
      /varset needdd2 FALSE 
   } 
   /return 

Sub Event_SetDD2(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell2 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell2" "${ddspell2}" 
} else { 
   /if (${dd2}) { 
    /varset dd2 FALSE 
    /echo ** Auto-DD @30% is now OFF! 
  } else { 
    /varset dd2 TRUE 
    /echo ** Auto-DD @30% is now ON! 
  } 
} 
  /echo ** DDSpell #2 == ${ddspell2} 
   /ini "ArchSettings.ini" "General" "AutoDD2" "${dd2}" 
/return 



Sub Check_Behind 
  /declare behindIt FALSE 
  |- Are we behind our target? 
  /for j -1 to 1 
    /varcalc dir (${Target.Heading.Clock}+${j})%12 
    /if (${dir}<1) /varcalc dir ${dir}+12 
    /if (${dir}>12) /varcalc dir ${dir}-12 
    /if (${dir} == ${Me.Heading.Clock}) /varset behindIt TRUE 
  /next j    
/return ${behindIt} 

Sub Event_exp 
  /echo ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /popup ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /varset LDExp ${Me.PctGroupLeaderExp} 
  /varset AAExp ${Me.PctAAExp} 
  /varset Exp ${Me.PctExp} 
/return 


Sub event_reroot 
      /if (${roottoggle}) { 
         /target npc ${targetarray[3]} 
         :tryagain 
         /call Cast "${rootspell}" gem2 10s 
         /doevents 
         /if (${castReturn}.Equal[CAST_RESIST]) /goto :tryagain 
      } 
/return 

sub event_GotHit 
    /if (${autojolt} && ${Me.SpellReady[${joltspell}]}) { 
      /popup Agro Detected, Casting Jolt! 
      /call cast "${joltspell}" gem5 5s 
} 
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.MoveBehind}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 uw 
       } else { 
         /squelch /stick 10 
       } 
     } 
/return 

sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 

sub forage 
   /delay 3 
   /if (${Me.Sitting}) { 
      /stand 
      /varset sitstatus TRUE 
   } 
   /if (${Me.Ducking}) /stand 
    
  :WaitLoop 
   /if (${Me.Casting.ID}) { 
      /delay 1 
      /goto :WaitLoop 
   } else { 
   /doability Forage 
   /doevents 
   } 
        
   /call destroyornot 
   /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
/return 

sub Event_waitforage 
   /if (${foragetoggle}) /varset waitforage TRUE 
/return 

sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notset}]} 
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /autoinv 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return 

Sub Wait4Rez 
/echo Now Waiting for rez, Will auto accept and loot all items! 

:waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
      /delay 5s ${Window[ConfirmationDialogBox].Open} 
      /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
:zonein 
   /delay 5 
   /squelch /target mycorpse 
   /delay 5 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /delay 3s 
      /call Loot_Corpse 
   } else /goto :zonein 

/return 

Sub Loot_Corpse 

  /declare LootTotal int local 0 
  /declare LootSlot int local 

  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 3s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 

  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 

  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 
  

/return  



Sub Event_SetForage 
  /if (${foragetoggle}) { 
    /varset foragetoggle FALSE 
    /echo ** Auto-Forage is now OFF! 
  } else { 
    /varset foragetoggle TRUE 
    /echo ** Auto-Forage is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
/return 
            
Sub Event_SetSelfBuff        
  /if (${selfbuff}) { 
    /varset selfbuff FALSE 
    /echo ** Self Buffing is now OFF! 
  } else { 
    /varset selfbuff TRUE 
    /echo ** Self Buffing is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
/return 

Sub Event_SetSnare(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset snarespell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "SnareSpell" "${snarespell}" 
} else { 
   /if (${snaretoggle}) { 
    /varset snaretoggle FALSE 
    /echo ** Auto-Snare is now OFF! 
  } else { 
    /varset snaretoggle TRUE 
    /echo ** Auto-Snare is now ON! 
  } 
} 
  /echo ** SnareSpell == ${snarespell} 
   /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
/return 

Sub Event_AutoJolt(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset joltspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "JoltSpell" "${joltspell}" 
} else { 
   /if (${autojolt}) { 
    /varset autojolt FALSE 
    /echo ** Auto-Jolt is now OFF! 
  } else { 
    /varset autojolt TRUE 
    /echo ** Auto-Jolt is now ON! 
    /memspell 5 "${joltspell}" 
  } 
} 
  /echo ** JoltSpell == ${joltspell} 
   /ini "ArchSettings.ini" "General" "AutoJolt" "${autojolt}" 
/return 
            
Sub Event_SetTaunt            
  /if (${taunttoggle}) { 
    /varset taunttoggle FALSE 
    /echo ** Auto-Taunt is now OFF! 
  } else { 
    /varset taunttoggle TRUE 
    /echo ** Auto-Taunt is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
/return 

Sub Event_SetVerbose 
  /if (${verbose}) { 
    /varset verbose FALSE 
    /echo ** Verbosity is now OFF! 
  } else { 
    /varset verbose TRUE 
    /echo ** Verbosity is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
/return 

Sub Event_SetNoArch(string Line) 
/if (${Line.Arg[3].Equal[stick]}) { 
  /if (!${useMU}) { 
   /echo Sorry, MQ2MoveUtils UNAVAILABLE, go get the plugin!! 
} else { 
   /if (${stickonnoarch}) { 
    /varset stickonnoarch FALSE 
    /echo ** /stick on NoArch Melee is now OFF! 
  } else { 
    /varset stickonnoarch TRUE 
    /echo ** /stick on NoArch Melee is now ON! 
  } 
} 
} else { 
  /if (${noarch}) { 
    /varset noarch FALSE 
    /echo ** Archery is now ON! 
  } else { 
    /varset noarch TRUE 
    /echo ** Archery is now OFF! 
  } 
} 
   /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
   /ini "ArchSettings.ini" "General" "StickOnNoArchery" "${stickonnoarch}" 
/return 
          
Sub Event_SetRoot(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset rootspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "RootSpell" "${rootspell}" 
} else { 
   /if (${roottoggle}) { 
    /varset roottoggle FALSE 
    /echo ** Auto-ReRoot is now OFF! 
  } else { 
    /varset roottoggle TRUE 
    /echo ** Auto-ReRoot is now ON! 
  } 
} 
  /echo ** RootSpell == ${rootspell} 
   /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
/return 
            
Sub Event_SetAutoAssist(string Line) 
/if (${Line.Arg[3].Length}) { 
   /varset PctToAssist ${Line.Arg[3]} 
   /echo ** HP% to Assist = ${PctToAssist} 
   /ini "ArchSettings.ini" "General" "PctHPsToAssist" "${PctToAssist}" 
} else { 
  /if (${autoassist}) { 
    /varset autoassist FALSE 
    /echo ** AutoAssist is now OFF! 
    /if (${eqassistonoff}) /squelch /assist on 
  } else { 
    /varset autoassist TRUE 
    /echo ** AutoAssist is now ON! 
    /if (${eqassistonoff}) /squelch /assist off 
  } 
} 
    /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/return 
      
Sub Event_SetAssistDistance(string Line) 
  /if (${Line.Arg[3].Length}) /varset assistdistance ${Line.Arg[3]} 
   /echo ** New AssistDistance == ${assistdistance} 
    /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}" 
/return 

Sub Event_SetTankName(string Line) 
  /if (${Line.Arg[3].Length}) /varset tankname ${Line.Arg[3]} 
   /echo ** New TankName == ${tankname} 
    /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
/return 

Sub Event_SetTargetSpells 
  /if (${targetspells}) { 
    /varset targetspells FALSE 
    /echo ** TargetSpells are now OFF! 
  } else { 
    /varset targetspells TRUE 
    /echo ** TargetSpells are now ON! 
  } 
   /ini "ArchSettings.ini" "General" "TargetSpells" "${targetspells}" 
/return 

Sub Event_Death 
  /varset diedBeforeZone TRUE 
  /echo ** YOU DIED... Setting autoassist and selfbuff to off! 
  /varset autoassist FALSE 
  /varset selfbuff FALSE 
  /call Wait4Rez 
} 
/return 

Sub Event_Zoned 
  /if (${eqassistonoff}) /squelch /assist off 
  /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/if (${diedBeforeZone}) { 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
   /varset diedBeforeZone FALSE 
   } 
/return 

Sub LazyRanger 

|====[Self Buffs]======================================== 

/for j 1 to 8 
/doevents 
/if (!${selfbuff}) /goto :FallOut 
      /varset spellname "${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}]}" 
        /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].NotEqual[NoBuffListed]}) { 
            /if (!${Me.Buff[${spellname}].ID}) { 
               /if (${Me.Sitting}) { 
               /stand 
               /varset sitstatus TRUE 
            } 
            /target ${Me} 
            /call Cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
            /if (${sitstatus} && !${battle}) { 
               /sit 
               /varset sitstatus FALSE 
   } 
} 
      } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
    /doevents 
    :Fallout 
/return 

Sub Event_AddSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[NoBuffListed]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "${Line.Arg[3]}" 
        /echo ** ${Line.Arg[3]} added as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Self Buff slots all filled! Get rid of some! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_RemSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[${Line.Arg[3]}]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
        /echo ** ${Line.Arg[3]} removed as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Can't find ${Line.Arg[3]} in SelfBuff list! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
      /if (!${targetspells}) /return 
|====[Target Buffs]======================================== 
/for j 1 to 8 
         /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}].Equal[NoBuffListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,TargetBuffs,TBuffTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
                  /if (${targetspells}) { 
                     /target ${Sender} 
                     /delay 2s 
                     /call cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
                     /if (${verbose}) /tell ${Sender} inc ${triggername} 
               } 
            } 
         } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to 8 
      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}].Equal[NoSpellListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,AssistSpell,ASpellTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
               /assist ${Sender} 
               /delay 2s 
               /call cast ${spellname} gem6 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /if (${verbose}) /tell ${Sender} Inc ${spellname]} on %T. 
            } 
         } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
/return 

Sub Event_Harmony(string Line) 
   /declare spawnnum int local 1 
   /declare targ int local 0 
   /declare range int local 20 
   /if (${Line.Arg[3].Length}) /varset range ${Line.Arg[3]} 
   |Auto-harmonies mobs within a certain range of your target 
   |Directions: have a mob targeted, run the snippet, 
   |by the end of the code all of the mobs should be harmonied and your 
   |target ready to pull. 
   /echo ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /popup ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /varset targ ${Target.ID} 
   /varset spawnnum 1 
   :harmonyLoop 
      /if ( ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}].ID} ) { 
      /target ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}]} 
      /call Cast "Harmony of Nature" gem7 10s 
      /delay 55 
      /varset spawnnum ${Math.Calc[${spawnnum}+1]} 
      /echo incremented, retargeting ${targ} 
      /goto :harmonyLoop 
   } 
   /target id ${targ} 
   /echo ** Harmony Complete.. Go Ahead and Pull..  
   /popup ** Harmony Complete.. Go Ahead and Pull..  
/return 

Sub Event_LootMyCorpse(string Line) 
   /if (${Line.Arg[3].Length}) /varset leaveSlot ${Line.Arg[3]} 
   /declare lootTotal int local 0 
   /declare lootSlot int local 0 
   /declare skippedCount int local 0 
   /declare wornSlotNumber int local 0 
   /target mycorpse 

   /if (${Target.Type.NotEqual[CORPSE]}) { 
      /echo ** Can't target my corpse. 
      /return 
   } 
   /corpse 
   /delay 1s 
   /loot 
   /delay 1s 
   /if (${Me.State.NotEqual[BIND]}) { 
      /echo ** Error in getting onto corpse! Aborting. 
      /return 
   } 

   :lootLag 
   /varset lootTotal ${Corpse.Items}    
   /delay 2 
   /if (${lootTotal}!=${Corpse.Items}) { 
      /goto :lootLag 
   } 

   :doAgain 
   /for lootSlot 1 to ${lootTotal} 
      /if (${leaveSlot.Length}) { 
         /for wornSlotNumber 1 to ${Corpse.Item[${lootSlot}].WornSlots} 
            /if (${Corpse.Item[${lootSlot}].WornSlot[${wornSlotNumber}]} == ${InvSlot[${leaveSlot}].ID}) { 
               /varcalc skippedCount (${skippedCount} + 1) 
               /next lootSlot 
            } 
         /next wornSlotNumber 
      } 

      :lootItem 
      /if (${Corpse.Item[${lootSlot}].ID}) { 
         /itemnotify loot${lootSlot} rightmouseup 
         /delay 2 
         /goto :lootItem 
      } 
      /delay 2 
   /next lootSlot 
   /if (${Corpse.Items} > ${skippedCount}) /goto :doAgain 
   /delay 5 
   /echo ** Done looting my corpse. 
   /notify LootWnd DoneButton leftmouseup 
   /varset leaveSlot 
/return 

sub Event_EarthCall 
   /if (${verbose} && !${rangerslowed}) /gsay Ranger Slow Landed.. Hope it helps.. 
   /varset rangerslowed TRUE 
   /return 

Sub Event_PatchHeal(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset Healspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "HealSpell" "${Healspell}" 
} else { 
   /if (${patchheal}) { 
    /varset patchheal FALSE 
    /echo ** PatchHealing is now OFF! 
  } else { 
    /varset patchheal TRUE 
    /echo ** PatchHealing is now ON! 
    /memspell 8 "${Healspell}" 
  } 
} 
  /echo ** HealSpell == ${Healspell} 
   /ini "ArchSettings.ini" "General" "PatchHeal" "${patchheal}" 
/return 

Sub Event_HealPct(string Line) 
  /if (${Line.Arg[3].Length}) /varset healgrouppct ${Line.Arg[3]} 
   /echo ** New GroupHealPct == ${healgrouppct} 
    /ini "ArchSettings.ini" "General" "HealPct" "${healgrouppct}" 
/return 

Sub Healer 
/varset spellname "${Healspell}" TRUE 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].ID} && ${Group.Member[${g}].PctHPs}<${healgrouppct}) { 
               /target PC ${Group.Member[${g}]} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
           } 
            /next g 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].Pet.ID} && ${Group.Member[${g}].Pet.PctHPs}<${healgrouppct}) { 
               /target Pet ${Group.Member[${g}].Pet} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
               } 
            /next g 
               /if (${Me.PctHPs}<${healgrouppct}) { 
               /target ${Me} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]} 
            }              
/return 

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

Sub Event_ItemBounce(string Line) 
  |- Sanity check parameters 
  /if (!${Line.Arg[4].Length}) { 
    /echo ** Improper use of /ibounce 
    /echo -- /ibounce <itemalias> "Some Spell Name" 
    /echo -- For example: 
    /echo -- /ibounce gobby "Strength of Tunare" 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${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[ArchSettings.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 "ArchSettings.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
    /echo ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list 
  } 
/return 

Sub Event_ItemCast(string Line) 
  |- Sanity check parameter 
  /if (!${Line.Arg[3].Length}) { 
    /echo ** Improper use of /icast 
    /echo -- /icast <itemalias> 
    /echo -- For example: 
    /echo -- /icast gobby 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${Line.Arg[3]}] not in INI file! 
    /return 
  } 
  /declare fullname string local ${Ini[ArchSettings.ini,${Line.Arg[3]},FullName]} 
  |- Is it in a Bag? 
  /echo ** 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 
    /echo ** 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}) { 
      /echo ** Clicking: ${fullname} 
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup 
      /delay 2 
    } else { 
      /echo ** "${fullname}" not found! 
    } 
  } 
  :CastLoop 
  /delay 1 
  /if (${Me.Casting.ID}) /goto :CastLoop 
/return 

Sub Event_Enraged 
  /echo Enrage detected! Target: ${Target.CleanName} 
  /varset isEnraged TRUE 
/return 

Sub Event_NLEnraged 
  /echo Enrage done! Target: ${Target.CleanName} 
  /varset isEnraged FALSE 
  /if (${Target.ID} && ${battle}) /attack on 
/return 

Sub Event_StopFight 
/varset stopfighting TRUE
/varset autofire FALSE
/autofire off  
/return 

sub Event_DisplayHelp 
   /echo -=Arch.Mac Help=- 
   /echo /SetSnare <SnareSpell> Toggles AutoSnare off/on or sets the snare spell 
   /echo /SetRoot <RootSpell> Toggles AutoReRoot off/on or sets the root spell 
   /echo /SetJolt <JoltSpell> Toggles AutoJolt off/on or sets the jolt spell 
   /echo /SetDD1 <DD1 Spell> Toggles AutoDD at 70% off/on or sets the DD1 spell 
   /echo /SetDD2 <DD2 Spell> Toggles AutoDD at 30% off/on or sets the DD2 spell 
   /echo /SetPatchHeal <HealSpell> Toggles PatchHealing off/on or sets the heal spell 
   /echo /SetHealPct <#> Sets the % when to patch heal 
   /echo /SetTaunt Toggles AutoTaunt off/on 
   /echo /SetForage Toggles AutoForage off/on 
   /echo /SetVerbose Toggles Verbosity off/on 
   /echo /SetSelfBuff Toggles SelfBuffing off/on 
   /echo /AddSelfBuff <BuffName> Adds a SelfBuff 
   /echo /RemSelfBuff <BuffName> Removes a SelfBuff 
   /echo /SetTSpells Toggles Targeted spells on tell on/off 
   /echo /SetAutoAssist <HP%> Toggles AutoAssist off/on with #% HP at which to Assist 
   /echo /SetTankName <TankName> Sets the TankName to AutoAssist 
   /echo /SetAssistdistance <distance> Sets the distance to target to start attacking 
   /echo /SetNoArch <stick> Turns Archery off/on if MQ2MoveUtils, <stick> will stick on the Target. 
   /echo /LootMyCorpse <ItemSlot> Loots your corpse except for <itemslot> if specified 
   /echo /Harmony <range> Harmonies all spawns within <range> of your target. 
   /echo /iset <itemalias> keepup|nokeepup <"Item Name"> - Item settings    
   /echo /ibounce <itemalias> <"Spell Name"> - Add bounce-off spell 
   /echo /iclick <itemalias> - Click cast item defined in <itemalias> 
   /echo /stopfight Stop Attacking Current Target 
   /echo /Setuseepic off/on epic 1.5 
   /echo /ArchHelp Shows this dialog 
   /echo /ArchStatus Shows Current Status 
/return 

sub Event_ArchStatus 
   /echo -=Arch.Mac Status=- 
   /echo AutoSnare: ${snaretoggle}, SnareSpell: ${snarespell} 
   /echo AutoReRoot: ${roottoggle}, RootSpell: ${rootspell} 
   /echo AutoDD 70%: ${dd1}, DDSpell1: ${ddspell1} 
   /echo AutoDD 30%: ${dd2}, DDSpell2: ${ddspell2} 
   /echo AutoJolt: ${autojolt}, JoltSpell: ${joltspell} 
   /echo PatchHeal: ${patchheal}, HealSpell: ${Healspell}, HealPct: ${healgrouppct} 
   /echo AutoTaunt: ${taunttoggle} 
   /echo AutoForage: ${foragetoggle} 
   /echo Verbosity: ${verbose} 
   /echo NoArchery: ${noarch} StickOnNoArchery: ${stickonnoarch} 
   /echo AutoSelfBuff: ${selfbuff} 
   /echo TargetSpells: ${targetspells} 
   /echo AutoAssist: ${autoassist}, TankName: ${tankname}, AssistDistance: ${assistdistance}, HPsToAssist: ${PctToAssist} 
   /echo Useepic: ${useepictoggle} 
   /echo Status Complete.... 
   /return
 
think ill just leave this alone the only time i will EVER play my ranger is when im at the keyboard so i dont need somethng that auto plays him for me.hes my favorite toon if he got banned id just stop playin eq all together
 
Trying this macro for the first time. Using cades compile for now until I finish tweaking my own.

I run this macro it starts fine, and I get the following status messages:

[MQ2] Auto-Arch Macro Loading
[MQ2] **MQ2MoveUtils FOUND AutoMovement Available)
[MQ2] Aliases Up To Date, Finished Loading
[MQ2] Type /ArchHelp for assistance

Problem is, none of the commands in this macro work for me, including /archhelp.

I see the status messages saying the aliases are up to date, but for some reason they arent working.

Anyone have any idea what is causing this?
 
Did you copy over the archsettings.ini thats posted here? If you did that could be/probably is the problem. You can fix this by simply going into the archsettings.ini and changing ther version number... make it something like 8.6. When you reload it, it will reset it ( which will take a second ) and then everything should work.
 
couple bugs ive found. I usually have my heal spell in slot 9 but when patch heal is on it will unmem slot 8 and 9 and move heal to 8. another is that some clickies of mine cannot be equipped but the /iclick will try to equip it anyways. one example is the DE mask or shield of the immaculate. any fixes?
 
One other thing i have a problem with is that I have the natures bounty aa which allows me to forage 2 items at one time 50% of the time. so when setforage is on it will bag or destroy the first item foraged and leave the second item on your mouse. a fix for this would be nice. Thanks in adavance
 
Twen said:
One other thing i have a problem with is that I have the natures bounty aa which allows me to forage 2 items at one time 50% of the time. so when setforage is on it will bag or destroy the first item foraged and leave the second item on your mouse. a fix for this would be nice. Thanks in adavance
Based on the Sub below, the macro should auto inventory everything foraged. IIRC, when you autoinventory with more then one item on your cursor, it puts both into your inventory. Same when it see's something to destroy. Additionally, the sub is written, that it you have an item on your cursor after /autoinv it will check it against your ini and decide weather to keep or save it again.

If you want it to set it up to automatically inventory more then one item (due to bounty AA) and just ignore the ini settings for the second item (which is what happens when you run YAFM or MQ2AutoForage), just add a second /autoinv line right below the first one.

One other thing you could try (I don't use this macro or I would try it) is just insert a delay of some length, after the /autoinv, before the /if (${Cursor.ID}) /goto :Keep. Something like /delay 1s just to give it time to inventory before checking the next item (thats if autoinv has changed and only inventories one item at a time).
Rich (BB code):
sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notse  t}]} 
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /autoinv 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return
twen said:
I usually have my heal spell in slot 9 but when patch heal is on it will unmem slot 8 and 9 and move heal to 8.
It's defined in the macro to mem the patch heal spell in slot 8, you could change this by changing
Rich (BB code):
/if (${patchheal}) /memspell 8 "${Healspell}"
to this
Rich (BB code):
/if (${patchheal}) /memspell 9 "${Healspell}"
Hope this helps you out in fixing / getting this to work.
 
thank you=) now just to get it to be able to click unequippable click items. i suppose i could maybe find some potion clicking code should work same way.
 
Actually with the foraging there was a line missing and also a typo.
The underlined text had spaces in it for some reason, which is proibably jsut a typo. The other problem I fixed was that at the red text it was going through too quick to be able to detect the second item.

Rich (BB code):
sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notse    t}]}
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
     /autoinv 
      /if (${Cursor.ID}) /goto :Keep  
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return

so if you add a /delay 10 it works most of the time. Sometimes still does nothing to the second item foraged.

Rich (BB code):
      /autoinv 
      /delay 10
      /if (${Cursor.ID}) /goto :Keep
 
Rich (BB code):
/call cast "Item Name Here" Item
As long as your using a good spell_routines.inc, should work fine. You might also want to incluse a Spell_routines.inc since this macro references it, some may not have it, so that will cause problems with running it. Here is the copy I use, which should work fine with this macro.

Rich (BB code):
|http://www.macroquest2.com/phpBB2/viewtopic.php?t=7568
| spell_routines.inc
|
| Written by Rusty~
| Last Modified 11/07/2004
|
| Features:
| - Casts spells, clicks items, or uses AA abilities for you
| - Allows back to back casting without waiting on spell gems to pop all the way up
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left
|   is greater than 7 seconds, else it will move forward a bit to interrupt, then move you back
|    ** IMPORTANT: if you don't want to interrupt a spell while mounted, put this at the top of your macro: **
|    **   /declare noInterrupt int outer 1                                                                  **
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0)
|   If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED
| - Lets you call a custom subroutine while waiting for spell to finish casting
|   Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true
| - This file also includes a sub named Interrupt. You can call this to interrupt any spell you're casting instantly.
| - You can also use the SwapItem sub included in this to swap items to certain slots
| - Added EquipItem sub to easily equip items in your main Inventory slots.
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top:
|      /declare noInvis int outer 1
|   This will make it return CAST_INVIS if you're invis
|
|  Below is a list of outer scope variables you can access in your macros:
|      refreshTime        - How much time is left till you're done recovering from casting
|      castEndTime        - How much time left till you're done casting the current spell... usable in custom spell Subs
|      spellNotHold       - 1 if your last spell didn't take hold, 0 otherwise
|      spellRecastTime1-9 - How much time left till that spell is back up
|
|======================================================================================================================
|  EquipItem:  An easier way to equip items you have in bags ( useful for weapons or focus items )
|              slot name is optional. If not given, it will equip it in the first possible spot
|
|    Usage:   
|        /call EquipItem "item name|slotname"
|
|        Returns: "old item name|slotname"
|    Examples:
|   
|    To Equip Sharp Ended Broken Lever when you have Serpent of Vindication equiped:
|        /call EquipItem "Sharp Ended Broken Lever"
|    It will return "Staff of Vindication|mainhand"
|    To reequip the original item, you can save the return in a variable, and then use it later like this:
|       /varset oldPrimary ${Macro.Return}
|       | ... do stuff here with your new item equiped
|       /call EquipItem ${oldPrimary}
|
|======================================================================================================================
|  SwapItem:  a subroutine which is used in the Cast sub itself. You don't need to do this to cast an item in a bag
|             but you can call it in your macro to SwapItems (such as weapons or focus items)
|    Usage:   
|        /call SwapItem "item name" slotname|slotID
|    Examples:
|   
|    To swap Darkblade of the Warlord to your main hand:
|        /call SwapItem "Darkblade of the Warlord" mainhand
|
|    To swap stat food in one bag with other food in another bag:
|        /call SwapItem "Bristlebanes Party Platter" ${FindItem[halas 10lb meat pie].InvSlot}
|
|======================================================================================================================
|  Cast: the main subroutine that casts spells or items for you
|     Usage:
|        /call Cast "spellname|itemname|AAname|AA#" [item|alt|gem#] [give up time][s|m] [custom subroutine name]
|     Examples:
|
|     To cast Howl of Tashan and mem it in slot 3 if not memmed:
|       /call Cast "Howl of Tashan" gem3
|
|     To cast Arcane Rune and keep trying for 7 seconds, in case of interrupts.
|       /call Cast "Arcane Rune" gem5 7s
|
|     To click Grim Aura earring that's in a bag:
|       /call Cast "Shrunken Goblin Skull Earring" item
|
|     To use AA ability Eldritch Rune:
|       /call Cast "Eldritch Rune" alt
|         or
|       /call Cast "173" alt
|
|     To call a subroutine that interrupts CH if target gets healed before it lands:
|       /call Cast "Complete Healing" gem1 0 CheckHP
|     Then in your macro have somewhere:
|       Sub CheckHP
|          /if ( ${Target.PctHPs}>=80 ) /call Interrupt
|       /return
|
| Returns these values:
|----------------------+----------------------------------------------------------------------+
| CAST_CANCELLED       | Spell was cancelled by ducking (either manually or because mob died) |
| CAST_CANNOTSEE       | You can't see your target                                            |
| CAST_IMMUNE          | Target is immune to this spell                                       |
| CAST_INTERRUPTED     | Casting was interrupted and exceeded the given time limit            |
| CAST_INVIS           | You were invis, and noInvis is set to true                           |
| CAST_NOTARGET        | You don't have a target selected for this spell                      |
| CAST_NOTMEMMED       | Spell is not memmed and you gem to mem was not specified             |
| CAST_NOTREADY        | AA ability or spell is not ready yet                                 |
| CAST_OUTOFMANA       | You don't have enough mana for this spell!                           |
| CAST_OUTOFRANGE      | Target is out of range                                               |
| CAST_RESISTED        | Your spell was resisted!                                             |
| CAST_SUCCESS         | Your spell was cast successfully! (yay)                              |
| CAST_UNKNOWNSPELL    | Spell/Item/Ability was not found                                     |
|----------------------+----------------------------------------------------------------------+

#event BeginCast "You begin casting#*#"
#event Collapse "Your gate is too unstable, and collapses.#*#"
#event FDFail "#1# has fallen to the ground.#*#"
#event Fizzle "Your spell fizzles#*#"
#event Immune "Your target is immune to changes in its attack speed#*#"
#event Immune "Your target is immune to changes in its run speed#*#"
#event Immune "Your target cannot be mesmerized#*#"
#event Interrupt "Your casting has been interrupted#*#"
#event Interrupt "Your spell is interrupted#*#"
#event NoHold "Your spell did not take hold#*#"
#event NoLOS "You cannot see your target.#*#"
#event NoTarget "You must first select a target for this spell!#*#"
#event NotReady "Spell recast time not yet met.#*#"
#event OutOfMana "Insufficient Mana to cast this spell!#*#"
#event OutOfRange "Your target is out of range, get closer!#*#"
#event Recover "You haven't recovered yet...#*#"
#event Recover "Spell recovery time not yet met#*#"
#event Resisted "Your target resisted the #1# spell#*#"
#event Resisted2 "You resist the #1# spell#*#"
#event Standing "You must be standing to cast a spell#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"


Sub Cast(string spellName,string spellType,timer giveUpTimer,string mySub)
   /declare castTime float local
   /if ( ${spellType.Equal[item]} ) {
      /varset castTime ${FindItem[${spellName}].CastTime}
   } else /if ( ${spellType.Equal[alt]} ) {
      /varset castTime ${Me.AltAbility[${spellName}].Spell.MyCastTime}
   } else {
      /varset castTime ${Spell[${spellName}].MyCastTime}
   }
   /if ( ${Me.Invis} && ${noInvis} ) {
      /return
   }
   :wait_for_stop
   /if ( !${Defined[spellType]} ) /declare spellType string local spell
   /if ( ${Me.Casting.ID} ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_for_stop
   } 
   /if ( ${Me.Speed} ) {
   :wait_for_stop2
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /if ( ${Me.Moving} && ${castTime}>0.1 ) /goto :wait_for_stop2
   }
   /if ( !${Defined[giveUpTimer]} ) /declare giveUpTimer timer local 0
   /if ( !${Defined[spellRecastTime1]} ) {
      /if ( !${Defined[noInterrupt]} ) /declare noInterrupt int outer 0
      /declare moveBack bool outer false
      /declare selfResist int outer
      /declare selfResistSpell string outer
      /declare castEndTime timer outer
      /declare refreshTime timer outer 0
      /declare itemRefreshTime float outer 0
      /declare startCastingLoc string outer
      /declare i int local
      /declare castReturn string outer
      /declare spellNotHold string outer
      /delay 5
      /for i 1 to 9
         /declare spellRecastTime${i} timer outer
         /if ( ${Me.SpellReady[${i}]} ) {
            /varset spellRecastTime${i} 0
         } else {
            /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime}
         }
      /next i
   }
   /varset spellNotHold 0
   /varset selfResist 0
   /declare delayTime timer local
   /declare swapItemBack bool local false
   /declare slotName int local
   /declare oldItemName string local
   /declare slotID int local
   /declare oldSlotID int local
   /declare spellID int local
   /declare charges int local

   /if ( ${Window[SpellBookWnd].Open} ) /keypress spellbook
   /if ( ${Me.Ducking} ) /keypress duck
   /if ( !${Me.Standing} ) /stand

   /doevents Recover
   /doevents BeginCast
   /doevents Fizzle
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents OutOfMana
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady
   /varset castReturn CAST_SUCCESS
   
      /if ( ${spellType.Equal[item]} ) /goto :cast_item
   /if ( ${spellType.Equal[alt]} ) /goto :cast_alt

:cast_spell
   /if ( !${Int[${Me.Book[${spellName}]}]} ) {
      /echo Spell: "${spellName}" was not found in your book
      /return CAST_UNKNOWNSPELL
   }
   /if ( !${Me.Gem[${spellName}]} ) {
   :mem_spell
      /if ( ${Cursor.ID} ) {
         /autoinventory
         /delay 5
         /goto :mem_spell 
      }
      /if ( ${spellType.Left[3].Equal[gem]} ) {
         /memspell ${spellType.Right[1]} "${spellName}"
      } else {
         /return CAST_NOTMEMMED
      }
      /delay 6s ( ${Me.Gem[${spellName}]} || !${Window[SpellBookWnd].Open} )
      :close_spell_book
      /if ( ${Window[SpellBookWnd].Open} ) {
         /echo *** SpellBookWnd Stuck Open ***
         /notify SpellBookWnd DoneButton leftmouseup
         /goto :close_spell_book
      }
      /if ( ${Me.Sitting} ) {
         /sit
      }
      /if ( !${Me.Gem[${spellName}]} ) {
         /echo Spell mem interrupted...
         /return CAST_INTERRUPTED
      }
      :wait_for_mem
     
      /delay 15s ${Me.SpellReady[${spellName}]}
      /if ( !${Me.SpellReady[${spellName}]} ) {
         /if ( ${giveUpTimer} ) /goto :wait_for_mem
         /return CAST_NOTREADY
      }
   }
   /varset spellType spell
   /if ( ${spellName.Find[illusion: ]} && ${Me.AltAbilityReady[project illusion]} ) /call Cast "project illusion" alt

   /varset giveUpTimer ${giveUpTimer.OriginalValue}
   /declare recoverWaitTime timer local 30

:cast_spell_loop
:wait_for_spell
   /if ( ${Me.SpellReady[${spellName}]} ) {
      /varset spellRecastTime${Me.Gem[${spellName}]} 0
      /goto :skip_delay 
   }
   /if ( ${spellRecastTime${Me.Gem[${spellName}]}}  ) {
      /if ( !${giveUpTimer} ) /return CAST_NOTREADY
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_for_spell
   }
   /if ( !${refreshTime} ) /goto :skip_delay
:wait_on_refresh
   /if ( ${Me.SpellReady[${spellName}]} ) /varset refreshTime 0
   /if ( ${refreshTime}>0 ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :wait_on_refresh
   }
   /varcalc delayTime 10*(1.5-${Spell[${spellName}].MyCastTime})
:cast_delay_loop
   /if ( ${delayTime}>0 ) {
      /if ( ${Defined[mySub]} ) /call ${mySub}
      /goto :cast_delay_loop
   }
:skip_delay
   /varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
   /cast "${spellName}"

   /if ( ${Me.Casting.ID} ) {
      /varset spellID ${Me.Casting.ID}
      /varcalc castEndTime ${Me.Casting.MyCastTime}*10
      /if ( ${castEndTime}<${Math.Calc[${Me.Casting.CastTime}*5]} ) /varcalc castEndTime ${Me.Casting.CastTime}*5
      /echo Casting: ${Me.Casting.Name}${If[!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
   }

   /varset moveBack false

   /call WaitCast ${mySub}

   /if ( ${moveBack} ) {
      /keypress back hold
      /delay 4
      /keypress back
      /delay 15 !${Me.Moving}
   }

   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }

   /doevents Recover
   /doevents BeginCast
   /doevents Fizzle
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents OutOfMana
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady
   
   /if ( !${spellID} ) /varset spellID ${Spell[${spellName}].ID}
   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
      /if ( ${castReturn.Equal[CAST_FIZZLE]} ) {
         /echo Spell Fizzled. Recasting...
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_RECOVER]} ) {
         /if ( !${recoverWaitTime} ) {
            /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
            /if ( !${giveUpTimer} ) /return CAST_NOTREADY
         }
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_spell_loop
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_spell_loop
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_spell_loop
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
   /if ( !${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} ) {
      /varcalc refreshTime 10*${Spell[${spellID}].RecoveryTime}
      /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellID}].RecastTime}
   }
   /if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
      /varset giveUpTimer 200
      /goto :cast_spell_loop
   }
/return ${castReturn}


:cast_item
	|gimp added check:
	/if (${Cursor.ID} && ${Cursor.NoDrop}) {
		/echo You have a no-drop item on cursor, please bag it first.
		/return CAST_CANCELLED
	}

   /if ( !${FindItem[${spellName}].InvSlot} ) {
      /echo Cannot find item: ${spellName}
      /return CAST_UNKNOWNSPELL
   } 
   /if ( ${FindItem[${spellName}].InvSlot}>21 ) {
      /varset swapItemBack true
      /if ( ${FindItem[${spellName}].WornSlot[1]} && ${FindItem[${spellName}].EffectType.Find[worn]} ) {
         /varset slotName ${FindItem[${spellName}].WornSlot[1]}
      } else /if ( ${FindItem[${spellName}].InvSlot}>29 ) {
         /varset slotName 29
      } else {
         /varset slotName ${FindItem[${spellName}].InvSlot}
      }
      /varset slotID ${InvSlot[${slotName}].ID}     
      /varset oldSlotID ${FindItem[${spellName}].InvSlot.ID}
      /varset oldItemName ${InvSlot[${slotID}].Item.Name}
      /call SwapItem "${spellName}" ${slotID}
   }
:cast_item_loop
:wait_item_loop
   /if ( ${itemRefreshTime} > ${MacroQuest.Running} ) {
      /delay 1
      /goto :wait_item_loop
   }
   /varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+000]}
   /varset charges ${FindItem[${spellName}].Charges}
   /varset startCastingLoc ${Me.X} ${Me.Y} ${Me.Z}
   /cast item "${spellName}"
   /if ( ${Me.Casting.ID} ) {
      /varcalc castEndTime ${FindItem[${spellName}].CastTime}*10
      /echo Casting: ${FindItem[${spellName}].Spell.Name}${If[!${FindItem[${spellName}].Spell.TargetType.Equal[PB AE]} && !${FindItem[${spellName}].Spell.TargetType.Equal[self]} && ${Target.ID}, on >> ${Target.CleanName} <<,]}
   }
   /if ( ${charges}>0 ) /delay 1s ${FindItem[${spellName}].Charges}!=${charges}

   /call WaitCast ${mySub}
   
   /if ( ${swapItemBack} ) {
      /if ( ${FindItem[${spellName}].ID} ) {
         /call SwapItem "${spellName}" ${oldSlotID}
      } else /if ( ${FindItem[${oldItemName}].ID} ) {
         /call SwapItem "${oldItemName}" ${slotID}         
      }
      /if ( ${Cursor.Container} ) /autoinventory
   }

   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }

   /doevents BeginCast
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents Collapse
   /doevents NoTarget
   /doevents NotReady

   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_item
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_item
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_item
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
   /if ( ${castReturn.Equal[CAST_COLLAPSE]} ) {
      /varset giveUpTimer 200
      /goto :cast_item
   }
/return ${castReturn}


:cast_alt
   /if ( !${Me.AltAbilityReady[${spellName}]} ) /return CAST_NOTREADY
   /echo Using AA Ability: ${Me.AltAbility[${spellName}].Name}
   /alt activate ${Me.AltAbility[${spellName}].ID}
   /if ( ${Me.AltAbility[${spellName}].Spell.MyCastTime}>=0.5 ) /delay 1s ${Me.Casting.ID}
   /call WaitCast ${mySub}
   
   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) {
      /echo Spell was cancelled...
      /return CAST_CANCELLED
   }
   
   /doevents BeginCast
   /doevents Interrupt
   /doevents Standing
   /doevents FDFail
   /doevents OutOfRange
   /doevents NoLOS
   /doevents Resisted2
   /doevents Resisted
   /doevents Immune
   /doevents Stunned
   /doevents NoTarget
     
   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) {
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_alt
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) {
         /if ( ${Me.Stunned} ) {
            /delay 3s !${Me.Stunned}
         } else {
            /delay 7
         }
         /goto :cast_alt
      }
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) {
         /if ( ${giveUpTimer} ) {
            /echo Spell was interrupted. Recasting...
            /goto :cast_alt
         }
         /echo Spell was interrupted...
         /return CAST_INTERRUPTED
      }
   }
/return ${castReturn}


Sub EquipItem(string ItemName)
   /declare DestName string local
   /declare SlotName string local
   |/if (${SlotName.Equal[NULL]}) 
   /varset SlotName ${InvSlot[${FindItem[=${ItemName}].WornSlot[1]}].Name}

	/echo #itemname: ${ItemName}
	/echo #slotname: ${SlotName}

   /echo # itemname invslot: ${FindItem[=${ItemName}].InvSlot}
   /echo # itemname wornslot: ${FindItem[=${ItemName}].WornSlot[${SlotName}]}, slotname: ${SlotName}

   /if (${FindItem[=${ItemName}].InvSlot}<22 || !${FindItem[=${ItemName}].WornSlot[${SlotName}]}) /return
   /if (!${InvSlot[${SlotName}].Item.Name.Equal[NULL]}) /varset DestName "${InvSlot[${SlotName}].Item.Name}"
   /call SwapItem "${ItemName}" "${SlotName}"
/return "${DestName}"

| Sub EquipItem(string itemName,string slotName)
   /if ( !${Defined[slotName]} ) /declare slotName string local ${FindItem[${itemName}].WornSlot[1]}
   /declare oldItem string local ${Me.Inventory[${slotName}].Name}
   /call SwapItem "${itemName}" ${slotName}
/return "${oldItem}" ${slotName}

Sub SwapItem(string itemName,string slotName)

   /if ( ${InvSlot[${slotName}].Item.Name.Equal[${itemName}]} ) /return
   /declare slotID int local
   /declare oldSlotID int local
   /declare oldItem string local
   /declare i int local
   /varset slotID ${InvSlot[${slotName}].ID}           | slotID = slot you're swapping item to
   /varset oldSlotID ${FindItem[${itemName}].InvSlot.ID} | oldSlotID = slot the item was originally in
   /varset oldItem ${InvSlot[${slotName}].Item.Name}     | oldItem = name of item in the slot you're swapping WITH
   /if ( !${slotID} ) {
      /echo Invalid slot name: ${slotName}
      /return
   }
   /if ( !${oldSlotID} ) {
      /echo Could not find item ${itemName}
      /return
   }
:auto_inv
   /if ( ${Cursor.ID} && !${Cursor.Name.Equal[${itemName}]} ) {
      /if ( ${Cursor.Container} ) {
         /for i 1 to 8
            /if ( !${InvSlot[pack${i}].Item.Container} ) {
               /nomodkey /itemnotify pack${i} leftmouseup
            }
         /next i
      } else {
         /autoinventory
      }
      /goto :auto_inv
   }
   

:pick_up_item
 | if the item is in a bag and it's not open, then open it!
   /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup

 | if the slot you're putting it in is inside a bag and it's not open, then open it!
   /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

 | ok.. pick up the item now!
   /squelch /nomodkey /shiftkey /itemnotify ${InvSlot[${oldSlotID}]} leftmouseup

 | if item isn't on your cursor, try again!
   /if ( !${Cursor.Name.Equal[${itemName}]} ) {
      /if ( ${Cursor.ID} && !${Cursor.Container} ) /autoinventory
      /goto :pick_up_item
   }
:exchange_items
   /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
   /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup

 | put the item in the new slot, and pick up whatever item was there
   /squelch /nomodkey /shiftkey /itemnotify ${slotID} leftmouseup

 | if it didnt get exchanged, try again!
   /if ( ${Cursor.ID} && !${Cursor.Name.Equal[${oldItem}]} && !${Cursor.Name.Equal[${itemName}]} && !${Cursor.Container} ) /autoinventory
   /if ( !${InvSlot[${slotID}].Item.Name.Equal[${itemName}]} ) /goto :exchange_items
:drop_item
   /if ( !${Cursor.Container} || ( ${InvSlot[${oldSlotID}]}<30 && ${InvSlot[${oldSlotID}]}>=22 ) ) {
      /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
      /if ( ${InvSlot[${slotID}].Pack} && !${Window[${InvSlot[${slotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
      /squelch /nomodkey /itemnotify ${oldSlotID} leftmouseup
      /if ( ${Cursor.ID} ) {
         /if ( !${Cursor.Name.Equal[${oldItem}]} ) /autoinventory
         /goto :drop_item
      }
   }
:close_pack
   /if ( ${InvSlot[${oldSlotID}].Pack} && ${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
      /squelch /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup
      /goto :close_pack
   }
   /if ( ${InvSlot[${slotID}].Pack} && ${Window[${InvSlot[${slotID}].Pack.Name}].Open} && ( ${Cursor.Name.Equal[${itemName}]} || ${FindItem[${itemName}].ID} ) ) {
      /squelch /nomodkey /itemnotify ${InvSlot[${slotID}].Pack} rightmouseup
      /goto :close_pack
   }
/return

Sub Interrupt
   /if ( ${Me.Mount.ID} ) /dismount
   /stopcast
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANCELLED
/return ${Macro.Return}


Sub WaitCast(string mySub)
   /declare currentTarget int local ${Target.ID}
   /declare currentTargetType string local ${Target.Type}
:wait_cast_loop
   /if ( ${Bool[${mySub}]} ) /call ${mySub}
   /if ( ${Me.Casting.ID} ) {
      /if ( ${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]} ) {
         /if ( !${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} && ( !${Me.Mount.ID} || !${noInterrupt} ) ) {
            /if ( !${Me.Mount.ID} || ${castEndTime}>70 ) {
               /call Interrupt
            } else /if ( ${Me.Casting.RecastTime}>3 ) {
               /varset castReturn CAST_CANCELLED
               /keypress forward hold
               /delay 6
               /keypress forward
               /varset moveBack true
            }
         }
      }
      /if ( ${Me.State.Equal[DUCK]} ) /varset castReturn CAST_CANCELLED
      /delay 1
      /goto :wait_cast_loop
   }
/return

Sub Event_Fizzle
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_FIZZLE
/return

Sub Event_Resisted(string line,string name)
   /if ( ${selfResist} && ${name.Equal[${selfResistSpell}]} ) {
      /varset selfResist 0
      /return   
   }
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESISTED
/return

Sub Event_Resisted2(string line,string name)
   /if ( ${Defined[selfResist]} ) {
      /varset selfResist 1
      /varset selfResistSpell ${name}
   }
/return

Sub Event_Interrupt
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_INTERRUPTED
/return

Sub Event_Recover
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RECOVER
/return

Sub Event_Immune
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_IMMUNE
/return

Sub Event_Stunned
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_STUNNED
/return

Sub Event_NoLOS
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANNOTSEE
/return

Sub Event_Standing
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESTART
/return

Sub Event_Collapse
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_COLLAPSE
/return

Sub Event_OutOfMana
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFMANA
/return

Sub Event_OutOfRange
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFRANGE
/return

Sub Event_NoTarget
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTARGET
/return

Sub Event_NotReady
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTREADY
/return

Sub Event_NoHold
   /if ( ${Defined[spellNotHold]} ) /varset spellNotHold 1
/return

Sub Event_BeginCast
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_SUCCESS
/return

Sub Event_FDFail(string line,string name)
   /if ( ${name.Equal[${Me.Name}]} && ${Defined[castReturn]} ) {
      /if ( !${Me.Standing} ) /stand
      /varset castReturn CAST_RESTART
   }
/return
 
If you have MQ2 VIP Access you can also get an updated spell routines based off of Rusty's original 2 yrs ago if you think that you have a problem there. I havent had a problem with either though

Also I believe that Crystane has an updated one to work with AFnuke
 
Since the june 16 update to mq2 my arch.mac is giving me errors when it tries to iclick stuff.

DoCommand - couldn't parse '/iclick xxxxxxx'
arch.mac@320 (Main): /if (${doIclick}) /docommand /iclick ${ialias}

and spams that for each clicky. any clue as to what is wrong, needs, updated etc?

Rich (BB code):
|** arch.mac Auto-Archery 
 Version 2.6        24 Sep 2005 
 by loadingpleasewait , updated by NeXuS With the help of a few people, autofire changes by Bardscorpse_01**|

#chat group 
#chat tell 

#include Spell_Routines.inc 
#turbo 40 
#Event exp                 "#*#experience!#*#" 
#Event reroot              "#*#Roots spell has worn off#*#" 
#Event Casting             "#*#You begin casting#*#" 
#Event Death               "You died#*#" 
#Event Death               "You have been slain by #*#!" 
#Event Zoned               "You have entered#*#" 
#Event EarthCall           "#*#slowed by the embracing earth#*#" 
#Event GotHit              "#*#YOU, but#*#" 
#Event GotHit              "#*#YOU for #*#" 
#Event Enraged             "#*#|${Target.CleanName}| has become ENRAGED#*#" 
#Event NLEnraged           "#*#|${Target.CleanName}| is no longer enraged#*#" 

#Event SetForage           "[MQ2] SetForage#*#" 
#Event SetSelfBuff         "[MQ2] SetSelfBuff#*#" 
#Event SetSnare            "[MQ2] SetSnare#*#" 
#Event SetTaunt            "[MQ2] SetTaunt#*#" 
#Event SetVerbose          "[MQ2] SetVerbose#*#" 
#Event SetRoot             "[MQ2] SetRoot#*#" 
#Event SetAutoAssist       "[MQ2] SetAutoAssist#*#" 
#Event SetAssistDistance   "[MQ2] SetAssistDistance#*#" 
#Event SetTankName         "[MQ2] SetTankName#*#" 
#Event AddSelfBuff         "[MQ2] AddSelfBuff#*#" 
#Event RemSelfBuff         "[MQ2] RemSelfBuff#*#" 
#Event DisplayHelp         "[MQ2] DisplayHelp#*#" 
#Event ArchStatus          "[MQ2] ArchStatus#*#" 
#Event SetNoArch           "[MQ2] SetNoArch#*#" 
#Event SetTargetSpells     "[MQ2] SetTSpells#*#" 
#Event LootMyCorpse        "[MQ2] LootMyCorpse#*#" 
#Event Harmony             "[MQ2] DoHarmony#*#" 
#Event AutoJolt            "[MQ2] SetJolt#*#" 
#Event PatchHeal           "[MQ2] SetPatchHeal#*#" 
#Event HealPct             "[MQ2] SetHealPct#*#" 
#Event ItemSet             "[MQ2] ItemSet#*#" 
#Event ItemBounce          "[MQ2] ItemBounce#*#" 
#Event ItemCast            "[MQ2] ItemCast#*#" 
#Event StopFight           "[MQ2] StopFighting!#*#" 
#Event SetDD1              "[MQ2] SetDD1#*#" 
#Event SetDD2              "[MQ2] SetDD2#*#" 
#Event SetUseepic          "[MQ2] Setuseepic#*#" 

Sub Main 
   /echo Auto-Arch Macro Loading. 
   /declare j int outer 
   /declare g int outer 
   /declare Version outer 0 
   /declare autoassist bool outer FALSE 
   /declare noInvis int outer 1 
   /declare tankname string outer "Unknown" 
   /declare assistdistance outer 60 
   /declare healgrouppct outer 25 
   /declare PctToAssist outer 95 
   /declare noarch bool outer FALSE 
   /declare verbose bool outer FALSE 
   /declare targetspells bool outer FALSE 
   /declare foragetoggle bool outer FALSE 
   /declare waitforage bool outer FALSE 
   /declare invset outer 0 
   /declare notset outer -1 
   /declare sitstatus bool outer FALSE 
   /declare snaretoggle bool outer FALSE 
   /declare taunttoggle bool outer FALSE 
   /declare roottoggle bool outer FALSE 
   /declare needsnare outer 0 
   /declare immunetosnare bool outer FALSE 
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp} 
   /declare battle bool outer FALSE 
   /declare selfbuff bool outer FALSE 
   /declare autojolt bool outer FALSE 
   /declare diedBeforeZone bool outer FALSE 
   /declare useMU bool outer FALSE 
   /declare stickonnoarch bool outer FALSE 
   /declare rangerslowed bool outer FALSE 
   /declare leaveSlot string outer 
   /declare patchheal bool outer FALSE 
   /declare Healspell string outer "none" 
   /declare spellname string outer "none" 
   /declare triggername string outer "none" 
   /declare rootspell string outer "Earthen Roots" 
   /declare snarespell string outer "Ensnare" 
   /declare joltspell string outer "Cinder Jolt" 
   /declare targetarray[4] string outer 
   /declare ialias string outer None 
   /declare doIclick bool outer FALSE 
   /declare bouncenum int outer 1 
   /declare ibounce string outer None 
   /declare itemspellname string outer None 
   /declare isEnraged bool outer FALSE 
   /declare dd1 bool outer FALSE 
   /declare dd2 bool outer FALSE 
   /declare needdd1 bool outer TRUE 
   /declare needdd2 bool outer TRUE 
   /declare ddspell1 string outer "none" 
   /declare ddspell2 string outer "none" 
   /declare dir int outer 
   /declare behindTarget bool outer FALSE 
   /declare stopfighting bool outer FALSE 
   /declare eqassistonoff bool outer TRUE 
   /declare EpicReady timer outer 
   /declare Epic outer "Heartwood Blade" 
   /declare Useepictoggle bool outer FALSE 
   /declare autofire bool outer FALSE

/if (${Ini[ArchSettings.ini,Version,ArchMacVersion].NotEqual[NULL]}) /varset Version ${Ini[ArchSettings.ini,Version,ArchMacVersion]} 
/if (${Stick.Status.Length}) { 
    /varset useMU TRUE 
    /echo ** MQ2MoveUtils FOUND AutoMovement AVAILABLE) 
  } else { 
    /varset useMU FALSE 
    /echo ** MQ2MoveUtils NOT FOUND AutoMovement UNAVAILABLE 
  } 
/if (!${Version.Equal[2.6]}) { 
      /echo Loading Aliases 
      /delay 1s 
   /squelch /alias /setforage /echo SetForage 
   /squelch /alias /setselfbuff /echo SetSelfBuff 
   /squelch /alias /setsnare /echo SetSnare 
   /squelch /alias /settaunt /echo SetTaunt 
   /squelch /alias /setverbose /echo SetVerbose 
   /squelch /alias /setroot /echo SetRoot 
   /squelch /alias /setnoarch /echo SetNoArch 
   /squelch /alias /setautoassist /echo SetAutoAssist 
   /squelch /alias /setassistdistance /echo SetAssistDistance 
   /squelch /alias /settankname /echo SetTankName 
   /squelch /alias /addselfbuff /echo AddSelfBuff 
   /squelch /alias /remselfbuff /echo RemSelfBuff 
   /squelch /alias /archhelp /echo DisplayHelp 
   /squelch /alias /archstatus /echo ArchStatus 
   /squelch /alias /lootmycorpse /echo LootMyCorpse 
   /squelch /alias /settspells /echo SetTSpells 
   /squelch /alias /harmony /echo DoHarmony 
   /squelch /alias /setjolt /echo SetJolt 
   /squelch /alias /setpatchheal /echo SetPatchHeal 
   /squelch /alias /sethealpct /echo SetHealPct 
   /squelch /alias /iset /echo ItemSet 
   /squelch /alias /ibounce /echo ItemBounce 
   /squelch /alias /iclick /echo ItemCast 
   /squelch /alias /stopfight /echo StopFighting! 
   /squelch /alias /setdd1 /echo SetDD1 
   /squelch /alias /setdd2 /echo SetDD2 
   /squelch /alias /setuseepic /echo Setuseepic 
    
      /echo Aliases Loaded, play on! 
   } else { 
      /echo Aliases Up To Date, Finished Loading 
   } 
   /echo Type /ArchHelp for assistance 
    
/ini "ArchSettings.ini" "Version" "ArchMacVersion" "2.6" 

  /if (${Ini[ArchSettings.ini,General,HealSpell].NotEqual[NULL]}) /varset Healspell ${Ini[ArchSettings.ini,General,HealSpell]} 
  /if (${Ini[ArchSettings.ini,General,PatchHeal].NotEqual[NULL]}) /varset patchheal ${Ini[ArchSettings.ini,General,PatchHeal]} 
  /if (${Ini[ArchSettings.ini,General,JoltSpell].NotEqual[NULL]}) /varset joltspell ${Ini[ArchSettings.ini,General,JoltSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoJolt].NotEqual[NULL]}) /varset autojolt ${Ini[ArchSettings.ini,General,AutoJolt]} 
  /if (${Ini[ArchSettings.ini,General,RootSpell].NotEqual[NULL]}) /varset rootspell ${Ini[ArchSettings.ini,General,RootSpell]} 
  /if (${Ini[ArchSettings.ini,General,SnareSpell].NotEqual[NULL]}) /varset snarespell ${Ini[ArchSettings.ini,General,SnareSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoTaunt].NotEqual[NULL]}) /varset taunttoggle ${Ini[ArchSettings.ini,General,AutoTaunt]} 
  /if (${Ini[ArchSettings.ini,General,AutoForage].NotEqual[NULL]}) /varset foragetoggle ${Ini[ArchSettings.ini,General,AutoForage]} 
  /if (${Ini[ArchSettings.ini,General,AutoReRoot].NotEqual[NULL]}) /varset roottoggle ${Ini[ArchSettings.ini,General,AutoReRoot]} 
  /if (${Ini[ArchSettings.ini,General,Verbosity].NotEqual[NULL]}) /varset verbose ${Ini[ArchSettings.ini,General,Verbosity]} 
  /if (${Ini[ArchSettings.ini,General,NoArchery].NotEqual[NULL]}) /varset noarch ${Ini[ArchSettings.ini,General,NoArchery]} 
  /if (${Ini[ArchSettings.ini,General,StickOnNoArchery].NotEqual[NULL]}) /varset stickonnoarch ${Ini[ArchSettings.ini,General,StickOnNoArchery]} 
  /if (${Ini[ArchSettings.ini,General,SelfBuffing].NotEqual[NULL]}) /varset selfbuff ${Ini[ArchSettings.ini,General,SelfBuffing]} 
  /if (${Ini[ArchSettings.ini,General,TargetSpells].NotEqual[NULL]}) /varset targetspells ${Ini[ArchSettings.ini,General,TargetSpells]} 
  /if (${Ini[ArchSettings.ini,General,AutoAssist].NotEqual[NULL]}) /varset autoassist ${Ini[ArchSettings.ini,General,AutoAssist]} 
  /if (${Ini[ArchSettings.ini,General,TankToAssist].NotEqual[NULL]}) /varset tankname ${Ini[ArchSettings.ini,General,TankToAssist]} 
  /if (${Ini[ArchSettings.ini,General,AssistDistance].NotEqual[NULL]}) /varset assistdistance ${Ini[ArchSettings.ini,General,AssistDistance]} 
  /if (${Ini[ArchSettings.ini,General,PctHPsToAssist].NotEqual[NULL]}) /varset PctToAssist ${Ini[ArchSettings.ini,General,PctHPsToAssist]} 
  /if (${Ini[ArchSettings.ini,General,HealPct].NotEqual[NULL]}) /varset healgrouppct ${Ini[ArchSettings.ini,General,HealPct]} 
  /if (${Ini[ArchSettings.ini,General,EQAssistOnOff].NotEqual[NULL]}) /varset eqassistonoff ${Ini[ArchSettings.ini,General,EQAssistOnOff]} 
  /if (${Ini[ArchSettings.ini,General,AutoSnare].NotEqual[NULL]}) /varset snaretoggle ${Ini[ArchSettings.ini,General,AutoSnare]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell1].NotEqual[NULL]}) /varset ddspell1 ${Ini[ArchSettings.ini,General,DDSpell1]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD1].NotEqual[NULL]}) /varset dd1 ${Ini[ArchSettings.ini,General,AutoDD1]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell2].NotEqual[NULL]}) /varset ddspell2 ${Ini[ArchSettings.ini,General,DDSpell2]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD2].NotEqual[NULL]}) /varset dd2 ${Ini[ArchSettings.ini,General,AutoDD2]} 
  /if (${Ini[ArchSettings.ini,General,Useepic].NotEqual[NULL]}) /varset Useepictoggle ${Ini[ArchSettings.ini,General,Useepic]} 
  /if (${snaretoggle}) { 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         } 

/for j 0 to 7 
  /if (${Defined[Param${j}]}) { 
     /if (${Param${j}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle TRUE 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
         } 
      /if (${Param${j}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
         } 
      /if (${Param${j}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
         } 
      /if (${Param${j}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
         } 
      /if (${Param${j}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose TRUE 
         /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
         } 
      /if (${Param${j}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch TRUE 
         /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
         } 
      /if (${Param${j}.Equal[selfbuff]}) { 
         /echo "SelfBuffing enabled" 
         /varset selfbuff TRUE 
         /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
         } 
       /if (${Param${j}.Equal[Useepic]}) { 
         /echo "Useepic enabled" 
         /varset Useepictoggle TRUE 
         /ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
         } 
      /if (${Param${j}.Equal[autoassist]}) { 
         /echo "Auto-Assist enabled" 
    /if (${eqassistonoff}) /assist on  
         /varset autoassist TRUE 
         /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
         /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
            /echo You need to target your assist, and make sure its a player character! 
            /endmacro 
         } else { 
         /varset tankname ${Target.CleanName} 
         /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
         /echo Assist set to ${tankname} 
         /if (${eqassistonoff}) /assist off 
         /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}"  
            } 
         } 
   } 
/next j 

      /if (!${Ini[ArchSettings.ini,SelfBuffs,SelfBuff1].Length}) { 
         /for j 1 to 10 
         /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "TargetBuffs" "TBuffTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "TargetBuffs" "TargetBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "AssistSpells" "ASpellTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "AssistSpells" "AssistSpell${j}" "NoSpellListed" 
         /next j 
      } 
/if (${autojolt}) /memspell 5 "${joltspell}" 
/if (${patchheal}) /memspell 9 "${Healspell}" 

:mainloop 
 /if (${patchheal}) /call healer 
/if (${autoassist}) { 
   /assist ${tankname} 
      /if (${Target.Type.NotEqual[PC]} && ${Target.Distance}<${assistdistance} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs}<${PctToAssist}) { 
         /if (${Me.Sitting}) { 
            /stand 
            /varset sitstatus TRUE 
         } 
         /call Archery 
      } 
/delay 5 
} 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if ((${foragetoggle}) && (${Me.AbilityReady[Forage]})) /call forage 
         /doevents 
         /if (${selfbuff} && !${Me.Invis}) /call LazyRanger 

     |- If we're not hiding or moving, check clicky maintained spells 
     /if (${Me.Moving} || ${clicktimer} || ${Me.Invis}) /goto :DoneItemChecks 
     /varset j 1 
     :ItemCheckLoop 
     /varset ialias ${Ini[ArchSettings.ini].Arg[${j},|]} 
     /if (${ialias.NotEqual[NULL]}) { 
       |- Obtained an itemalias from the ArchSettings.ini file 
       |- We supposed to keep this spell up? 
       /if (${Ini[ArchSettings.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[ArchSettings.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[ArchSettings.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 j ${j}+1 
     } else /goto :DoneItemChecks 
     /goto :ItemCheckLoop 
     :DoneItemChecks 

/goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /varset battle TRUE 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
  /face nolook 
  :CloserAF    
  /if (${Me.Combat}) /attack off 
  /if (${Target.Distance}>30 && ${Me.RangedReady} && !${noarch} && ${Target.LineOfSight} && ${Target.Animation}!=32 && ${Target.Animation}!=110 && !${autofire}) {
  /varset autofire TRUE
  /autofire on
  }
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[OFF]}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 behind uw 
       } else { 
         /squelch /stick 10 behind 
       } 
     } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
         /if (${patchheal}) /call healer 
         /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) /call forage 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
               /if (${castReturn.Equal[CAST_IMMUNE]}) {                
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
                  } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
   /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
    } /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /doevents 
    /if (${Target.Distance}<15) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
   /if (${stopfighting}) /goto :StopFight 
|         /if (${selfbuff}) /call LazyRanger 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /varset autofire FALSE
    /autofire off 
:StopFight 
/if (${stopfighting}) { 
   /varset stopfighting FALSE
   /Popup AutoArch/Attack on ${targetarray[1]} is now OFF 
   /if (${useMU}) /stick off 
   /attack off 
   /varset autoassist FALSE 
   /echo AutoAssist is now OFF!! 
} 
    /if (${snaretoggle}) { 
      /varset needsnare 1 
      /varset immunetosnare FALSE 
   } 
    /keypress Num_5 
       /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
         /if (${dd1}) /varset needdd1 TRUE 
         /if (${dd2}) /varset needdd2 TRUE 
   /varset battle FALSE 
   /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[ON]}) /stick off 
   /varset rangerslowed FALSE 
  /varset isEnraged FALSE 
/return 

Sub closecombat 
   /popup Within Melee Range! CloseCombat Initiated!! 
   /attack on 
   :stillclose 
            /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
      /if (${patchheal}) /call healer 
      /if (${Useepictoggle} !${EpicReady}) /call Useepic 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle} && ${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /if (!${Me.AltAbilityReady[entrap]}) /goto :waitforentrap 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
                /if (${castReturn.Equal[CAST_IMMUNE]}) {                  
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
               } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
    /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
 } 
   :waitforentrap 
   /if (${isEnraged} && ${Target.ID} && !${Me.Combat}) { 
     /call Check_Behind 
     /varset behindTarget ${Macro.Return} 
     /if (${Target.ID} && ${behindTarget}) { 
       /attack on 
       /echo ** Attack re-started (No Enrage Risk): ${Target.CleanName} 
     }  
   } 
     /if (${isEnraged} && ${Target.ID}) { 
       /call Check_Behind 
       /varset behindTarget ${Macro.Return} 
       /if (${Target.ID} && !${behindTarget}) { 
         /attack off 
         /echo ** Attack ceased (Enrage Risk): ${Target.CleanName} 
       }  
     } 
/if (${stopfighting}) { 
/attack off 
/return 
} 
    /if (${Target.Distance}<${Target.MaxRangeTo} && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub DD1 
   /if (${needdd1} && ${Target.PctHPs}<70 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell1}" gem1 5s 
      /varset needdd1 FALSE 
   } 
   /return 

Sub Useepic  
   /if (${Useepictoggle} && !${EpicReady}) /call cast ${Epic} item 
   } 
   /varset EpicReady 360s 
   } 
   /return 


Sub Event_SetUseepic(string Line) 
   /if (${Useepictoggle}) { 
    /varset Useepictoggle FALSE 
    /echo ** Useepic is now OFF! 
  } else { 
    /varset Useepictoggle TRUE 
    /echo ** Useepic is now ON! 
  } 
}  
/ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
/return 

Sub Event_SetDD1(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell1 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell1" "${ddspell1}" 
} else { 
   /if (${dd1}) { 
    /varset dd1 FALSE 
    /echo ** Auto-DD @70% is now OFF! 
  } else { 
    /varset dd1 TRUE 
    /echo ** Auto-DD @70% is now ON! 
  } 
} 
  /echo ** DDSpell #1 == ${ddspell1} 
   /ini "ArchSettings.ini" "General" "AutoDD1" "${dd1}" 
/return 

Sub DD2 
   /if (${needdd2} && ${Target.PctHPs}<30 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell2}" gem3 5s 
      /varset needdd2 FALSE 
   } 
   /return 

Sub Event_SetDD2(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell2 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell2" "${ddspell2}" 
} else { 
   /if (${dd2}) { 
    /varset dd2 FALSE 
    /echo ** Auto-DD @30% is now OFF! 
  } else { 
    /varset dd2 TRUE 
    /echo ** Auto-DD @30% is now ON! 
  } 
} 
  /echo ** DDSpell #2 == ${ddspell2} 
   /ini "ArchSettings.ini" "General" "AutoDD2" "${dd2}" 
/return 



Sub Check_Behind 
  /declare behindIt FALSE 
  |- Are we behind our target? 
  /for j -1 to 1 
    /varcalc dir (${Target.Heading.Clock}+${j})%12 
    /if (${dir}<1) /varcalc dir ${dir}+12 
    /if (${dir}>12) /varcalc dir ${dir}-12 
    /if (${dir} == ${Me.Heading.Clock}) /varset behindIt TRUE 
  /next j    
/return ${behindIt} 

Sub Event_exp 
  /echo ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /popup ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /varset LDExp ${Me.PctGroupLeaderExp} 
  /varset AAExp ${Me.PctAAExp} 
  /varset Exp ${Me.PctExp} 
/return 


Sub event_reroot 
      /if (${roottoggle}) { 
         /target npc ${targetarray[3]} 
         :tryagain 
         /call Cast "${rootspell}" gem2 10s 
         /doevents 
         /if (${castReturn}.Equal[CAST_RESIST]) /goto :tryagain 
      } 
/return 

sub event_GotHit 
    /if (${autojolt} && ${Me.SpellReady[${joltspell}]}) { 
      /popup Agro Detected, Casting Jolt! 
      /call cast "${joltspell}" gem5 5s 
} 
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.MoveBehind}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 uw 
       } else { 
         /squelch /stick 10 
       } 
     } 
/return 

sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 

sub forage 
   /delay 3 
   /if (${Me.Sitting}) { 
      /stand 
      /varset sitstatus TRUE 
   } 
   /if (${Me.Ducking}) /stand 
    
  :WaitLoop 
   /if (${Me.Casting.ID}) { 
      /delay 1 
      /goto :WaitLoop 
   } else { 
   /doability Forage 
   /doevents 
   } 
        
   /call destroyornot 
   /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
/return 

sub Event_waitforage 
   /if (${foragetoggle}) /varset waitforage TRUE 
/return 

sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notset}]} 
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /autoinv 
	  /delay 5
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return 

Sub Wait4Rez 
/echo Now Waiting for rez, Will auto accept and loot all items! 

:waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
      /delay 5s ${Window[ConfirmationDialogBox].Open} 
      /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
:zonein 
   /delay 5 
   /squelch /target mycorpse 
   /delay 5 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /delay 3s 
      /call Loot_Corpse 
   } else /goto :zonein 

/return 

Sub Loot_Corpse 

  /declare LootTotal int local 0 
  /declare LootSlot int local 

  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 3s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 

  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 

  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 
  

/return  



Sub Event_SetForage 
  /if (${foragetoggle}) { 
    /varset foragetoggle FALSE 
    /echo ** Auto-Forage is now OFF! 
  } else { 
    /varset foragetoggle TRUE 
    /echo ** Auto-Forage is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
/return 
            
Sub Event_SetSelfBuff        
  /if (${selfbuff}) { 
    /varset selfbuff FALSE 
    /echo ** Self Buffing is now OFF! 
  } else { 
    /varset selfbuff TRUE 
    /echo ** Self Buffing is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
/return 

Sub Event_SetSnare(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset snarespell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "SnareSpell" "${snarespell}" 
} else { 
   /if (${snaretoggle}) { 
    /varset snaretoggle FALSE 
    /echo ** Auto-Snare is now OFF! 
  } else { 
    /varset snaretoggle TRUE 
    /echo ** Auto-Snare is now ON! 
  } 
} 
  /echo ** SnareSpell == ${snarespell} 
   /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
/return 

Sub Event_AutoJolt(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset joltspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "JoltSpell" "${joltspell}" 
} else { 
   /if (${autojolt}) { 
    /varset autojolt FALSE 
    /echo ** Auto-Jolt is now OFF! 
  } else { 
    /varset autojolt TRUE 
    /echo ** Auto-Jolt is now ON! 
    /memspell 5 "${joltspell}" 
  } 
} 
  /echo ** JoltSpell == ${joltspell} 
   /ini "ArchSettings.ini" "General" "AutoJolt" "${autojolt}" 
/return 
            
Sub Event_SetTaunt            
  /if (${taunttoggle}) { 
    /varset taunttoggle FALSE 
    /echo ** Auto-Taunt is now OFF! 
  } else { 
    /varset taunttoggle TRUE 
    /echo ** Auto-Taunt is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
/return 

Sub Event_SetVerbose 
  /if (${verbose}) { 
    /varset verbose FALSE 
    /echo ** Verbosity is now OFF! 
  } else { 
    /varset verbose TRUE 
    /echo ** Verbosity is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
/return 

Sub Event_SetNoArch(string Line) 
/if (${Line.Arg[3].Equal[stick]}) { 
  /if (!${useMU}) { 
   /echo Sorry, MQ2MoveUtils UNAVAILABLE, go get the plugin!! 
} else { 
   /if (${stickonnoarch}) { 
    /varset stickonnoarch FALSE 
    /echo ** /stick on NoArch Melee is now OFF! 
  } else { 
    /varset stickonnoarch TRUE 
    /echo ** /stick on NoArch Melee is now ON! 
  } 
} 
} else { 
  /if (${noarch}) { 
    /varset noarch FALSE 
    /echo ** Archery is now ON! 
  } else { 
    /varset noarch TRUE 
    /echo ** Archery is now OFF! 
  } 
} 
   /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
   /ini "ArchSettings.ini" "General" "StickOnNoArchery" "${stickonnoarch}" 
/return 
          
Sub Event_SetRoot(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset rootspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "RootSpell" "${rootspell}" 
} else { 
   /if (${roottoggle}) { 
    /varset roottoggle FALSE 
    /echo ** Auto-ReRoot is now OFF! 
  } else { 
    /varset roottoggle TRUE 
    /echo ** Auto-ReRoot is now ON! 
  } 
} 
  /echo ** RootSpell == ${rootspell} 
   /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
/return 
            
Sub Event_SetAutoAssist(string Line) 
/if (${Line.Arg[3].Length}) { 
   /varset PctToAssist ${Line.Arg[3]} 
   /echo ** HP% to Assist = ${PctToAssist} 
   /ini "ArchSettings.ini" "General" "PctHPsToAssist" "${PctToAssist}" 
} else { 
  /if (${autoassist}) { 
    /varset autoassist FALSE 
    /echo ** AutoAssist is now OFF! 
    /if (${eqassistonoff}) /squelch /assist on 
  } else { 
    /varset autoassist TRUE 
    /echo ** AutoAssist is now ON! 
    /if (${eqassistonoff}) /squelch /assist off 
  } 
} 
    /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/return 
      
Sub Event_SetAssistDistance(string Line) 
  /if (${Line.Arg[3].Length}) /varset assistdistance ${Line.Arg[3]} 
   /echo ** New AssistDistance == ${assistdistance} 
    /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}" 
/return 

Sub Event_SetTankName(string Line) 
  /if (${Line.Arg[3].Length}) /varset tankname ${Line.Arg[3]} 
   /echo ** New TankName == ${tankname} 
    /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
/return 

Sub Event_SetTargetSpells 
  /if (${targetspells}) { 
    /varset targetspells FALSE 
    /echo ** TargetSpells are now OFF! 
  } else { 
    /varset targetspells TRUE 
    /echo ** TargetSpells are now ON! 
  } 
   /ini "ArchSettings.ini" "General" "TargetSpells" "${targetspells}" 
/return 

Sub Event_Death 
  /varset diedBeforeZone TRUE 
  /echo ** YOU DIED... Setting autoassist and selfbuff to off! 
  /varset autoassist FALSE 
  /varset selfbuff FALSE 
  /call Wait4Rez 
} 
/return 

Sub Event_Zoned 
  /if (${eqassistonoff}) /squelch /assist off 
  /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/if (${diedBeforeZone}) { 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
   /varset diedBeforeZone FALSE 
   } 
/return 

Sub LazyRanger 

|====[Self Buffs]======================================== 

/for j 1 to 8 
/doevents 
/if (!${selfbuff}) /goto :FallOut 
      /varset spellname "${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}]}" 
        /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].NotEqual[NoBuffListed]}) { 
            /if (!${Me.Buff[${spellname}].ID}) { 
               /if (${Me.Sitting}) { 
               /stand 
               /varset sitstatus TRUE 
            } 
            /target ${Me} 
            /call Cast ${spellname} gem7 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
            /if (${sitstatus} && !${battle}) { 
               /sit 
               /varset sitstatus FALSE 
   } 
} 
      } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
    /doevents 
    :Fallout 
/return 

Sub Event_AddSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[NoBuffListed]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "${Line.Arg[3]}" 
        /echo ** ${Line.Arg[3]} added as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Self Buff slots all filled! Get rid of some! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_RemSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[${Line.Arg[3]}]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
        /echo ** ${Line.Arg[3]} removed as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Can't find ${Line.Arg[3]} in SelfBuff list! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
      /if (!${targetspells}) /return 
|====[Target Buffs]======================================== 
/for j 1 to 8 
         /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}].Equal[NoBuffListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,TargetBuffs,TBuffTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
                  /if (${targetspells}) { 
                     /target ${Sender} 
                     /delay 2s 
                     /call cast ${spellname} gem4 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
                     /if (${verbose}) /tell ${Sender} inc ${triggername} 
               } 
            } 
         } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to 8 
      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}].Equal[NoSpellListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,AssistSpell,ASpellTriggerWord${j}  ]}" 
         /varset spellname "${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
               /assist ${Sender} 
               /delay 2s 
               /call cast ${spellname} gem4 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /if (${verbose}) /tell ${Sender} Inc ${spellname]} on %T. 
            } 
         } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
/return 

Sub Event_Harmony(string Line) 
   /declare spawnnum int local 1 
   /declare targ int local 0 
   /declare range int local 20 
   /if (${Line.Arg[3].Length}) /varset range ${Line.Arg[3]} 
   |Auto-harmonies mobs within a certain range of your target 
   |Directions: have a mob targeted, run the snippet, 
   |by the end of the code all of the mobs should be harmonied and your 
   |target ready to pull. 
   /echo ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /popup ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /varset targ ${Target.ID} 
   /varset spawnnum 1 
   :harmonyLoop 
      /if ( ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}].ID} ) { 
      /target ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}]} 
      /call Cast "Harmony of Nature" gem7 10s 
      /delay 55 
      /varset spawnnum ${Math.Calc[${spawnnum}+1]} 
      /echo incremented, retargeting ${targ} 
      /goto :harmonyLoop 
   } 
   /target id ${targ} 
   /echo ** Harmony Complete.. Go Ahead and Pull..  
   /popup ** Harmony Complete.. Go Ahead and Pull..  
/return 

Sub Event_LootMyCorpse(string Line) 
   /if (${Line.Arg[3].Length}) /varset leaveSlot ${Line.Arg[3]} 
   /declare lootTotal int local 0 
   /declare lootSlot int local 0 
   /declare skippedCount int local 0 
   /declare wornSlotNumber int local 0 
   /target mycorpse 

   /if (${Target.Type.NotEqual[CORPSE]}) { 
      /echo ** Can't target my corpse. 
      /return 
   } 
   /corpse 
   /delay 1s 
   /loot 
   /delay 1s 
   /if (${Me.State.NotEqual[BIND]}) { 
      /echo ** Error in getting onto corpse! Aborting. 
      /return 
   } 

   :lootLag 
   /varset lootTotal ${Corpse.Items}    
   /delay 2 
   /if (${lootTotal}!=${Corpse.Items}) { 
      /goto :lootLag 
   } 

   :doAgain 
   /for lootSlot 1 to ${lootTotal} 
      /if (${leaveSlot.Length}) { 
         /for wornSlotNumber 1 to ${Corpse.Item[${lootSlot}].WornSlots} 
            /if (${Corpse.Item[${lootSlot}].WornSlot[${wornSlotNumber}]} == ${InvSlot[${leaveSlot}].ID}) { 
               /varcalc skippedCount (${skippedCount} + 1) 
               /next lootSlot 
            } 
         /next wornSlotNumber 
      } 

      :lootItem 
      /if (${Corpse.Item[${lootSlot}].ID}) { 
         /itemnotify loot${lootSlot} rightmouseup 
         /delay 2 
         /goto :lootItem 
      } 
      /delay 2 
   /next lootSlot 
   /if (${Corpse.Items} > ${skippedCount}) /goto :doAgain 
   /delay 5 
   /echo ** Done looting my corpse. 
   /notify LootWnd DoneButton leftmouseup 
   /varset leaveSlot 
/return 

sub Event_EarthCall 
   /if (${verbose} && !${rangerslowed}) /gsay Ranger Slow Landed.. Hope it helps.. 
   /varset rangerslowed TRUE 
   /return 

Sub Event_PatchHeal(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset Healspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "HealSpell" "${Healspell}" 
} else { 
   /if (${patchheal}) { 
    /varset patchheal FALSE 
    /echo ** PatchHealing is now OFF! 
  } else { 
    /varset patchheal TRUE 
    /echo ** PatchHealing is now ON! 
    /memspell 9 "${Healspell}" 
  } 
} 
  /echo ** HealSpell == ${Healspell} 
   /ini "ArchSettings.ini" "General" "PatchHeal" "${patchheal}" 
/return 

Sub Event_HealPct(string Line) 
  /if (${Line.Arg[3].Length}) /varset healgrouppct ${Line.Arg[3]} 
   /echo ** New GroupHealPct == ${healgrouppct} 
    /ini "ArchSettings.ini" "General" "HealPct" "${healgrouppct}" 
/return 

Sub Healer 
/varset spellname "${Healspell}" TRUE 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].ID} && ${Group.Member[${g}].PctHPs}<${healgrouppct}) { 
               /target PC ${Group.Member[${g}]} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
           } 
            /next g 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].Pet.ID} && ${Group.Member[${g}].Pet.PctHPs}<${healgrouppct}) { 
               /target Pet ${Group.Member[${g}].Pet} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
               } 
            /next g 
               /if (${Me.PctHPs}<${healgrouppct}) { 
               /target ${Me} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]} 
            }              
/return 

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

Sub Event_ItemBounce(string Line) 
  |- Sanity check parameters 
  /if (!${Line.Arg[4].Length}) { 
    /echo ** Improper use of /ibounce 
    /echo -- /ibounce <itemalias> "Some Spell Name" 
    /echo -- For example: 
    /echo -- /ibounce gobby "Strength of Tunare" 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${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[ArchSettings.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 "ArchSettings.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
    /echo ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list 
  } 
/return 

Sub Event_ItemCast(string Line) 
  |- Sanity check parameter 
  /if (!${Line.Arg[3].Length}) { 
    /echo ** Improper use of /icast 
    /echo -- /icast <itemalias> 
    /echo -- For example: 
    /echo -- /icast gobby 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${Line.Arg[3]}] not in INI file! 
    /return 
  } 
  /declare fullname string local ${Ini[ArchSettings.ini,${Line.Arg[3]},FullName]} 
  |- Is it in a Bag? 
  /echo ** 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 
    /echo ** 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}) { 
      /echo ** Clicking: ${fullname} 
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup 
      /delay 2 
    } else { 
      /echo ** "${fullname}" not found! 
    } 
  } 
  :CastLoop 
  /delay 1 
  /if (${Me.Casting.ID}) /goto :CastLoop 
/return 

Sub Event_Enraged 
  /echo Enrage detected! Target: ${Target.CleanName} 
  /varset isEnraged TRUE 
/return 

Sub Event_NLEnraged 
  /echo Enrage done! Target: ${Target.CleanName} 
  /varset isEnraged FALSE 
  /if (${Target.ID} && ${battle}) /attack on 
/return 

Sub Event_StopFight 
/varset stopfighting TRUE
/varset autofire FALSE
/autofire off  
/return 

sub Event_DisplayHelp 
   /echo -=Arch.Mac Help=- 
   /echo /SetSnare <SnareSpell> Toggles AutoSnare off/on or sets the snare spell 
   /echo /SetRoot <RootSpell> Toggles AutoReRoot off/on or sets the root spell 
   /echo /SetJolt <JoltSpell> Toggles AutoJolt off/on or sets the jolt spell 
   /echo /SetDD1 <DD1 Spell> Toggles AutoDD at 70% off/on or sets the DD1 spell 
   /echo /SetDD2 <DD2 Spell> Toggles AutoDD at 30% off/on or sets the DD2 spell 
   /echo /SetPatchHeal <HealSpell> Toggles PatchHealing off/on or sets the heal spell 
   /echo /SetHealPct <#> Sets the % when to patch heal 
   /echo /SetTaunt Toggles AutoTaunt off/on 
   /echo /SetForage Toggles AutoForage off/on 
   /echo /SetVerbose Toggles Verbosity off/on 
   /echo /SetSelfBuff Toggles SelfBuffing off/on 
   /echo /AddSelfBuff <BuffName> Adds a SelfBuff 
   /echo /RemSelfBuff <BuffName> Removes a SelfBuff 
   /echo /SetTSpells Toggles Targeted spells on tell on/off 
   /echo /SetAutoAssist <HP%> Toggles AutoAssist off/on with #% HP at which to Assist 
   /echo /SetTankName <TankName> Sets the TankName to AutoAssist 
   /echo /SetAssistdistance <distance> Sets the distance to target to start attacking 
   /echo /SetNoArch <stick> Turns Archery off/on if MQ2MoveUtils, <stick> will stick on the Target. 
   /echo /LootMyCorpse <ItemSlot> Loots your corpse except for <itemslot> if specified 
   /echo /Harmony <range> Harmonies all spawns within <range> of your target. 
   /echo /iset <itemalias> keepup|nokeepup <"Item Name"> - Item settings    
   /echo /ibounce <itemalias> <"Spell Name"> - Add bounce-off spell 
   /echo /iclick <itemalias> - Click cast item defined in <itemalias> 
   /echo /stopfight Stop Attacking Current Target 
   /echo /Setuseepic off/on epic 1.5 
   /echo /ArchHelp Shows this dialog 
   /echo /ArchStatus Shows Current Status 
/return 

sub Event_ArchStatus 
   /echo -=Arch.Mac Status=- 
   /echo AutoSnare: ${snaretoggle}, SnareSpell: ${snarespell} 
   /echo AutoReRoot: ${roottoggle}, RootSpell: ${rootspell} 
   /echo AutoDD 70%: ${dd1}, DDSpell1: ${ddspell1} 
   /echo AutoDD 30%: ${dd2}, DDSpell2: ${ddspell2} 
   /echo AutoJolt: ${autojolt}, JoltSpell: ${joltspell} 
   /echo PatchHeal: ${patchheal}, HealSpell: ${Healspell}, HealPct: ${healgrouppct} 
   /echo AutoTaunt: ${taunttoggle} 
   /echo AutoForage: ${foragetoggle} 
   /echo Verbosity: ${verbose} 
   /echo NoArchery: ${noarch} StickOnNoArchery: ${stickonnoarch} 
   /echo AutoSelfBuff: ${selfbuff} 
   /echo TargetSpells: ${targetspells} 
   /echo AutoAssist: ${autoassist}, TankName: ${tankname}, AssistDistance: ${assistdistance}, HPsToAssist: ${PctToAssist} 
   /echo Useepic: ${useepictoggle} 
   /echo Status Complete.... 
   /return
 
Oh and im just noticing some other problems. all commands seem to give me errors just like this when i type in mq2 window. if i type in a chat window i get the normal eq command not recognized message.
 
OK fixed it for somereason the archsetting.ini was causing the problems somehow. I removed it and arch started working no problem. Although with the clicky part of the mac it still cant click a clicky that is unequippable like Fractured Bone Ridges and Shield of the immaculate. And I do have druids most recent spell_routines.inc file.
 
Anyone updating this? few odd bugs with TSS. Like if a clicky is place in a slot that is a clicky it removes immediately and clicks the item that is normally there causing a bug that makes it think its casting . never ends unless i camp or zone. Also if DoT toggle and/or a spam nuke toggle can be added that would be nice. Can't think of anything else atm. If anyone else can think of something to throw in to make it more up to date I am all for it!
 
Oh it my version works it just has a few quirks and bugs to it i would like fixed. and some other options thrown.
 
This is the macro I currently use. I would like the snare thing fixed. Will only cast snare if entrap is the set snare. the clicky thing ive posted above. I would like a DoT toggle at 90 or 95% or a adjustable pct toggle. Jolting kicks toggle with possibly a do not go below XX% endurance toggle so i still have end to disc. Maybe a spam nukes toggle and be able to list multiple nukes to be spammed. Current works fine but i am a lazy ranger and I also like to play a healer and not pa attention to my ranger.

Rich (BB code):
|** arch.mac Auto-Archery 
 Version 2.6        24 Sep 2005 
 by loadingpleasewait , updated by NeXuS With the help of a few people, autofire changes by Bardscorpse_01**|

#chat group 
#chat tell 

#include Spell_Routines.inc 
#turbo 40 
#Event exp                 "#*#experience!#*#" 
#Event reroot              "#*#Roots spell has worn off#*#" 
#Event Casting             "#*#You begin casting#*#" 
#Event Death               "You died#*#" 
#Event Death               "You have been slain by #*#!" 
#Event Zoned               "You have entered#*#" 
#Event EarthCall           "#*#slowed by the embracing earth#*#" 
#Event GotHit              "#*#YOU, but#*#" 
#Event GotHit              "#*#YOU for #*#" 
#Event Enraged             "#*#|${Target.CleanName}| has become ENRAGED#*#" 
#Event NLEnraged           "#*#|${Target.CleanName}| is no longer enraged#*#" 

#Event SetForage           "[MQ2] SetForage#*#" 
#Event SetSelfBuff         "[MQ2] SetSelfBuff#*#" 
#Event SetSnare            "[MQ2] SetSnare#*#" 
#Event SetTaunt            "[MQ2] SetTaunt#*#" 
#Event SetVerbose          "[MQ2] SetVerbose#*#" 
#Event SetRoot             "[MQ2] SetRoot#*#" 
#Event SetAutoAssist       "[MQ2] SetAutoAssist#*#" 
#Event SetAssistDistance   "[MQ2] SetAssistDistance#*#" 
#Event SetTankName         "[MQ2] SetTankName#*#" 
#Event AddSelfBuff         "[MQ2] AddSelfBuff#*#" 
#Event RemSelfBuff         "[MQ2] RemSelfBuff#*#" 
#Event DisplayHelp         "[MQ2] DisplayHelp#*#" 
#Event ArchStatus          "[MQ2] ArchStatus#*#" 
#Event SetNoArch           "[MQ2] SetNoArch#*#" 
#Event SetTargetSpells     "[MQ2] SetTSpells#*#" 
#Event LootMyCorpse        "[MQ2] LootMyCorpse#*#" 
#Event Harmony             "[MQ2] DoHarmony#*#" 
#Event AutoJolt            "[MQ2] SetJolt#*#" 
#Event PatchHeal           "[MQ2] SetPatchHeal#*#" 
#Event HealPct             "[MQ2] SetHealPct#*#" 
#Event ItemSet             "[MQ2] ItemSet#*#" 
#Event ItemBounce          "[MQ2] ItemBounce#*#" 
#Event ItemCast            "[MQ2] ItemCast#*#" 
#Event StopFight           "[MQ2] StopFighting!#*#" 
#Event SetDD1              "[MQ2] SetDD1#*#" 
#Event SetDD2              "[MQ2] SetDD2#*#" 
#Event SetUseepic          "[MQ2] Setuseepic#*#" 

Sub Main 
   /echo Auto-Arch Macro Loading. 
   /declare j int outer 
   /declare g int outer 
   /declare Version outer 0 
   /declare autoassist bool outer FALSE 
   /declare noInvis int outer 1 
   /declare tankname string outer "Unknown" 
   /declare assistdistance outer 60 
   /declare healgrouppct outer 25 
   /declare PctToAssist outer 95 
   /declare noarch bool outer FALSE 
   /declare verbose bool outer FALSE 
   /declare targetspells bool outer FALSE 
   /declare foragetoggle bool outer FALSE 
   /declare waitforage bool outer FALSE 
   /declare invset outer 0 
   /declare notset outer -1 
   /declare sitstatus bool outer FALSE 
   /declare snaretoggle bool outer FALSE 
   /declare taunttoggle bool outer FALSE 
   /declare roottoggle bool outer FALSE 
   /declare needsnare outer 0 
   /declare immunetosnare bool outer FALSE 
   /declare LDExp float outer ${Me.PctGroupLeaderExp} 
   /declare AAExp float outer ${Me.PctAAExp} 
   /declare Exp float outer ${Me.PctExp} 
   /declare battle bool outer FALSE 
   /declare selfbuff bool outer FALSE 
   /declare autojolt bool outer FALSE 
   /declare diedBeforeZone bool outer FALSE 
   /declare useMU bool outer FALSE 
   /declare stickonnoarch bool outer FALSE 
   /declare rangerslowed bool outer FALSE 
   /declare leaveSlot string outer 
   /declare patchheal bool outer FALSE 
   /declare Healspell string outer "none" 
   /declare spellname string outer "none" 
   /declare triggername string outer "none" 
   /declare rootspell string outer "Earthen Roots" 
   /declare snarespell string outer "Ensnare" 
   /declare joltspell string outer "Cinder Jolt" 
   /declare targetarray[4] string outer 
   /declare ialias string outer None 
   /declare doIclick bool outer FALSE 
   /declare bouncenum int outer 1 
   /declare ibounce string outer None 
   /declare itemspellname string outer None 
   /declare isEnraged bool outer FALSE 
   /declare dd1 bool outer FALSE 
   /declare dd2 bool outer FALSE 
   /declare needdd1 bool outer TRUE 
   /declare needdd2 bool outer TRUE 
   /declare ddspell1 string outer "none" 
   /declare ddspell2 string outer "none" 
   /declare dir int outer 
   /declare behindTarget bool outer FALSE 
   /declare stopfighting bool outer FALSE 
   /declare eqassistonoff bool outer TRUE 
   /declare EpicReady timer outer 
   /declare Epic outer "Aurora, the Heartwood Blade" 
   /declare Useepictoggle bool outer FALSE 
   /declare autofire bool outer FALSE

/if (${Ini[ArchSettings.ini,Version,ArchMacVersion].NotEqual[NULL]}) /varset Version ${Ini[ArchSettings.ini,Version,ArchMacVersion]} 
/if (${Stick.Status.Length}) { 
    /varset useMU TRUE 
    /echo ** MQ2MoveUtils FOUND AutoMovement AVAILABLE) 
  } else { 
    /varset useMU FALSE 
    /echo ** MQ2MoveUtils NOT FOUND AutoMovement UNAVAILABLE 
  } 
/if (!${Version.Equal[2.6]}) { 
      /echo Loading Aliases 
      /delay 1s 
   /squelch /alias /setforage /echo SetForage 
   /squelch /alias /setselfbuff /echo SetSelfBuff 
   /squelch /alias /setsnare /echo SetSnare 
   /squelch /alias /settaunt /echo SetTaunt 
   /squelch /alias /setverbose /echo SetVerbose 
   /squelch /alias /setroot /echo SetRoot 
   /squelch /alias /setnoarch /echo SetNoArch 
   /squelch /alias /setautoassist /echo SetAutoAssist 
   /squelch /alias /setassistdistance /echo SetAssistDistance 
   /squelch /alias /settankname /echo SetTankName 
   /squelch /alias /addselfbuff /echo AddSelfBuff 
   /squelch /alias /remselfbuff /echo RemSelfBuff 
   /squelch /alias /archhelp /echo DisplayHelp 
   /squelch /alias /archstatus /echo ArchStatus 
   /squelch /alias /lootmycorpse /echo LootMyCorpse 
   /squelch /alias /settspells /echo SetTSpells 
   /squelch /alias /harmony /echo DoHarmony 
   /squelch /alias /setjolt /echo SetJolt 
   /squelch /alias /setpatchheal /echo SetPatchHeal 
   /squelch /alias /sethealpct /echo SetHealPct 
   /squelch /alias /iset /echo ItemSet 
   /squelch /alias /ibounce /echo ItemBounce 
   /squelch /alias /iclick /echo ItemCast 
   /squelch /alias /stopfight /echo StopFighting! 
   /squelch /alias /setdd1 /echo SetDD1 
   /squelch /alias /setdd2 /echo SetDD2 
   /squelch /alias /setuseepic /echo Setuseepic 
    
      /echo Aliases Loaded, play on! 
   } else { 
      /echo Aliases Up To Date, Finished Loading 
   } 
   /echo Type /ArchHelp for assistance 
    
/ini "ArchSettings.ini" "Version" "ArchMacVersion" "2.6" 

  /if (${Ini[ArchSettings.ini,General,HealSpell].NotEqual[NULL]}) /varset Healspell ${Ini[ArchSettings.ini,General,HealSpell]} 
  /if (${Ini[ArchSettings.ini,General,PatchHeal].NotEqual[NULL]}) /varset patchheal ${Ini[ArchSettings.ini,General,PatchHeal]} 
  /if (${Ini[ArchSettings.ini,General,JoltSpell].NotEqual[NULL]}) /varset joltspell ${Ini[ArchSettings.ini,General,JoltSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoJolt].NotEqual[NULL]}) /varset autojolt ${Ini[ArchSettings.ini,General,AutoJolt]} 
  /if (${Ini[ArchSettings.ini,General,RootSpell].NotEqual[NULL]}) /varset rootspell ${Ini[ArchSettings.ini,General,RootSpell]} 
  /if (${Ini[ArchSettings.ini,General,SnareSpell].NotEqual[NULL]}) /varset snarespell ${Ini[ArchSettings.ini,General,SnareSpell]} 
  /if (${Ini[ArchSettings.ini,General,AutoTaunt].NotEqual[NULL]}) /varset taunttoggle ${Ini[ArchSettings.ini,General,AutoTaunt]} 
  /if (${Ini[ArchSettings.ini,General,AutoForage].NotEqual[NULL]}) /varset foragetoggle ${Ini[ArchSettings.ini,General,AutoForage]} 
  /if (${Ini[ArchSettings.ini,General,AutoReRoot].NotEqual[NULL]}) /varset roottoggle ${Ini[ArchSettings.ini,General,AutoReRoot]} 
  /if (${Ini[ArchSettings.ini,General,Verbosity].NotEqual[NULL]}) /varset verbose ${Ini[ArchSettings.ini,General,Verbosity]} 
  /if (${Ini[ArchSettings.ini,General,NoArchery].NotEqual[NULL]}) /varset noarch ${Ini[ArchSettings.ini,General,NoArchery]} 
  /if (${Ini[ArchSettings.ini,General,StickOnNoArchery].NotEqual[NULL]}) /varset stickonnoarch ${Ini[ArchSettings.ini,General,StickOnNoArchery]} 
  /if (${Ini[ArchSettings.ini,General,SelfBuffing].NotEqual[NULL]}) /varset selfbuff ${Ini[ArchSettings.ini,General,SelfBuffing]} 
  /if (${Ini[ArchSettings.ini,General,TargetSpells].NotEqual[NULL]}) /varset targetspells ${Ini[ArchSettings.ini,General,TargetSpells]} 
  /if (${Ini[ArchSettings.ini,General,AutoAssist].NotEqual[NULL]}) /varset autoassist ${Ini[ArchSettings.ini,General,AutoAssist]} 
  /if (${Ini[ArchSettings.ini,General,TankToAssist].NotEqual[NULL]}) /varset tankname ${Ini[ArchSettings.ini,General,TankToAssist]} 
  /if (${Ini[ArchSettings.ini,General,AssistDistance].NotEqual[NULL]}) /varset assistdistance ${Ini[ArchSettings.ini,General,AssistDistance]} 
  /if (${Ini[ArchSettings.ini,General,PctHPsToAssist].NotEqual[NULL]}) /varset PctToAssist ${Ini[ArchSettings.ini,General,PctHPsToAssist]} 
  /if (${Ini[ArchSettings.ini,General,HealPct].NotEqual[NULL]}) /varset healgrouppct ${Ini[ArchSettings.ini,General,HealPct]} 
  /if (${Ini[ArchSettings.ini,General,EQAssistOnOff].NotEqual[NULL]}) /varset eqassistonoff ${Ini[ArchSettings.ini,General,EQAssistOnOff]} 
  /if (${Ini[ArchSettings.ini,General,AutoSnare].NotEqual[NULL]}) /varset snaretoggle ${Ini[ArchSettings.ini,General,AutoSnare]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell1].NotEqual[NULL]}) /varset ddspell1 ${Ini[ArchSettings.ini,General,DDSpell1]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD1].NotEqual[NULL]}) /varset dd1 ${Ini[ArchSettings.ini,General,AutoDD1]} 
  /if (${Ini[ArchSettings.ini,General,DDSpell2].NotEqual[NULL]}) /varset ddspell2 ${Ini[ArchSettings.ini,General,DDSpell2]} 
  /if (${Ini[ArchSettings.ini,General,AutoDD2].NotEqual[NULL]}) /varset dd2 ${Ini[ArchSettings.ini,General,AutoDD2]} 
  /if (${Ini[ArchSettings.ini,General,Useepic].NotEqual[NULL]}) /varset Useepictoggle ${Ini[ArchSettings.ini,General,Useepic]} 
  /if (${snaretoggle}) { 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         } 

/for j 0 to 7 
  /if (${Defined[Param${j}]}) { 
     /if (${Param${j}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle TRUE 
         /varset needsnare 1 
         /varset immunetosnare FALSE 
         /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
         } 
      /if (${Param${j}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
         } 
      /if (${Param${j}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
         } 
      /if (${Param${j}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle TRUE 
         /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
         } 
      /if (${Param${j}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose TRUE 
         /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
         } 
      /if (${Param${j}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch TRUE 
         /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
         } 
      /if (${Param${j}.Equal[selfbuff]}) { 
         /echo "SelfBuffing enabled" 
         /varset selfbuff TRUE 
         /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
         } 
       /if (${Param${j}.Equal[Useepic]}) { 
         /echo "Useepic enabled" 
         /varset Useepictoggle TRUE 
         /ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
         } 
      /if (${Param${j}.Equal[autoassist]}) { 
         /echo "Auto-Assist enabled" 
    /if (${eqassistonoff}) /assist on  
         /varset autoassist TRUE 
         /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
         /if (!${Target.ID} || ${Target.Type.NotEqual[PC]}) { 
            /echo You need to target your assist, and make sure its a player character! 
            /endmacro 
         } else { 
         /varset tankname ${Target.CleanName} 
         /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
         /echo Assist set to ${tankname} 
         /if (${eqassistonoff}) /assist off 
         /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}"  
            } 
         } 
   } 
/next j 

      /if (!${Ini[ArchSettings.ini,SelfBuffs,SelfBuff1].Length}) { 
         /for j 1 to 10 
         /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "TargetBuffs" "TBuffTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "TargetBuffs" "TargetBuff${j}" "NoBuffListed" 
         /next j 
      } 

      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell1].Length}) { 
         /for j 1 to 8 
         /ini "ArchSettings.ini" "AssistSpells" "ASpellTriggerWord${j}" "NoTriggerListed" 
         /ini "ArchSettings.ini" "AssistSpells" "AssistSpell${j}" "NoSpellListed" 
         /next j 
      } 
/if (${autojolt}) /memspell 5 "${joltspell}" 
/if (${patchheal}) /memspell 9 "${Healspell}" 

:mainloop 
 /if (${patchheal}) /call healer 
/if (${autoassist}) { 
   /assist ${tankname} 
      /if (${Target.Type.NotEqual[PC]} && ${Target.Distance}<${assistdistance} && !${Target.Type.Equal[Corpse]} && !${Target.Type.Equal[PET]} && ${Target.PctHPs}<${PctToAssist}) { 
         /if (${Me.Sitting}) { 
            /stand 
            /varset sitstatus TRUE 
         } 
         /call Archery 
      } 
/delay 5 
} 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if ((${foragetoggle}) && (${Me.AbilityReady[Forage]})) /call forage 
         /doevents 
         /if (${selfbuff} && !${Me.Invis}) /call LazyRanger 

     |- If we're not hiding or moving, check clicky maintained spells 
     /if (${Me.Moving} || ${clicktimer} || ${Me.Invis}) /goto :DoneItemChecks 
     /varset j 1 
     :ItemCheckLoop 
     /varset ialias ${Ini[ArchSettings.ini].Arg[${j},|]} 
     /if (${ialias.NotEqual[NULL]}) { 
       |- Obtained an itemalias from the ArchSettings.ini file 
       |- We supposed to keep this spell up? 
       /if (${Ini[ArchSettings.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[ArchSettings.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[ArchSettings.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 j ${j}+1 
     } else /goto :DoneItemChecks 
     /goto :ItemCheckLoop 
     :DoneItemChecks 

/goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /varset battle TRUE 
  /varset targetarray[1] ${Target.CleanName} 
  /varset targetarray[2] ${Target.Level} 
  /varset targetarray[3] ${Target.Name} 
  /varset targetarray[4] ${Target.ID} 
    
   /echo Fighting a ${targetarray[2]} ${targetarray[1]} 
  /face nolook 
  :CloserAF    
  /if (${Me.Combat}) /attack off 
  /if (${Target.Distance}>30 && ${Me.RangedReady} && !${noarch} && ${Target.LineOfSight} && ${Target.Animation}!=32 && ${Target.Animation}!=110 && !${autofire}) {
  /varset autofire TRUE
  /autofire on
  }
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[OFF]}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 behind uw 
       } else { 
         /squelch /stick 10 behind 
       } 
     } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
         /if (${patchheal}) /call healer 
         /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) /call forage 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.PctHPs}>1 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem3 10s 
         } 
         /delay 5 
         /doevents 
               /if (${castReturn.Equal[CAST_IMMUNE]}) {                
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
                  } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
   /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
    } /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /doevents 
    /if (${Target.Distance}<15) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
   /if (${stopfighting}) /goto :StopFight 
|         /if (${selfbuff}) /call LazyRanger 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /varset autofire FALSE
    /autofire off 
:StopFight 
/if (${stopfighting}) { 
   /varset stopfighting FALSE
   /Popup AutoArch/Attack on ${targetarray[1]} is now OFF 
   /if (${useMU}) /stick off 
   /attack off 
   /varset autoassist FALSE 
   /echo AutoAssist is now OFF!! 
} 
    /if (${snaretoggle}) { 
      /varset needsnare 1 
      /varset immunetosnare FALSE 
   } 
    /keypress Num_5 
       /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
         /if (${dd1}) /varset needdd1 TRUE 
         /if (${dd2}) /varset needdd2 TRUE 
   /varset battle FALSE 
   /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.Status.Equal[ON]}) /stick off 
   /varset rangerslowed FALSE 
  /varset isEnraged FALSE 
/return 

Sub closecombat 
   /popup Within Melee Range! CloseCombat Initiated!! 
   /attack on 
   :stillclose 
            /if (${foragetoggle} && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
         /if (${dd1}) /call DD1 
         /if (${dd2}) /call DD2 
      /if (${patchheal}) /call healer 
      /if (${Useepictoggle} !${EpicReady}) /call Useepic 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle} && ${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && !${Target.LineOfSight}) /popup Can't Snare, Need Line Of SIGHT!! 
         /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}<150 && ${Target.LineOfSight}) { 
         /Popup Attempting To Snare ${Target.CleanName}... 
         /if (${snarespell.Equal[Entrap]}) { 
            /if (!${Me.AltAbilityReady[entrap]}) /goto :waitforentrap 
            /call Cast "Entrap" Alt 
         } else { 
            /call Cast ${snarespell} gem4 10s 
         } 
         /delay 5 
         /doevents 
                /if (${castReturn.Equal[CAST_IMMUNE]}) {                  
                     /varset needsnare 0 
                     /varset immunetosnare TRUE 
                     /popup Immune To Snare! 
                     /if (${verbose}) /gsay %t is Immune to snare 
               } 
               /if (${castReturn.Equal[CAST_RESISTED]}) { 
                  /varset needsnare 1 
                  /popup Snare Resisted! 
               } 
               /if (${castReturn.Equal[CAST_SUCCESS]} && !${immunetosnare}) { 
                  /if (${verbose}) /gsay %t has been snared 
                  /varset needsnare 0 
                  /popup Snare Success!!  
               } 
    /if (${snaretoggle} && ${needsnare}==1 && ${Target.PctHPs}<60 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
 } 
   :waitforentrap 
   /if (${isEnraged} && ${Target.ID} && !${Me.Combat}) { 
     /call Check_Behind 
     /varset behindTarget ${Macro.Return} 
     /if (${Target.ID} && ${behindTarget}) { 
       /attack on 
       /echo ** Attack re-started (No Enrage Risk): ${Target.CleanName} 
     }  
   } 
     /if (${isEnraged} && ${Target.ID}) { 
       /call Check_Behind 
       /varset behindTarget ${Macro.Return} 
       /if (${Target.ID} && !${behindTarget}) { 
         /attack off 
         /echo ** Attack ceased (Enrage Risk): ${Target.CleanName} 
       }  
     } 
/if (${stopfighting}) { 
/attack off 
/return 
} 
    /if (${Target.Distance}<${Target.MaxRangeTo} && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub DD1 
   /if (${needdd1} && ${Target.PctHPs}<70 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell1}" gem1 5s 
      /varset needdd1 FALSE 
   } 
   /return 

Sub Useepic  
   /if (${Useepictoggle} && !${EpicReady}) /call cast ${Epic} item 
   } 
   /varset EpicReady 180s 
   } 
   /return 


Sub Event_SetUseepic(string Line) 
   /if (${Useepictoggle}) { 
    /varset Useepictoggle FALSE 
    /echo ** Useepic is now OFF! 
  } else { 
    /varset Useepictoggle TRUE 
    /echo ** Useepic is now ON! 
  } 
}  
/ini "ArchSettings.ini" "General" "Useepic" "${Useepictoggle}" 
/return 

Sub Event_SetDD1(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell1 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell1" "${ddspell1}" 
} else { 
   /if (${dd1}) { 
    /varset dd1 FALSE 
    /echo ** Auto-DD @70% is now OFF! 
  } else { 
    /varset dd1 TRUE 
    /echo ** Auto-DD @70% is now ON! 
  } 
} 
  /echo ** DDSpell #1 == ${ddspell1} 
   /ini "ArchSettings.ini" "General" "AutoDD1" "${dd1}" 
/return 

Sub DD2 
   /if (${needdd2} && ${Target.PctHPs}<30 && ${Target.LineOfSight} && ${Target.Animation}!=32) { 
      /call cast "${ddspell2}" gem3 5s 
      /varset needdd2 FALSE 
   } 
   /return 

Sub Event_SetDD2(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset ddspell2 ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "DDSpell2" "${ddspell2}" 
} else { 
   /if (${dd2}) { 
    /varset dd2 FALSE 
    /echo ** Auto-DD @30% is now OFF! 
  } else { 
    /varset dd2 TRUE 
    /echo ** Auto-DD @30% is now ON! 
  } 
} 
  /echo ** DDSpell #2 == ${ddspell2} 
   /ini "ArchSettings.ini" "General" "AutoDD2" "${dd2}" 
/return 



Sub Check_Behind 
  /declare behindIt FALSE 
  |- Are we behind our target? 
  /for j -1 to 1 
    /varcalc dir (${Target.Heading.Clock}+${j})%12 
    /if (${dir}<1) /varcalc dir ${dir}+12 
    /if (${dir}>12) /varcalc dir ${dir}-12 
    /if (${dir} == ${Me.Heading.Clock}) /varset behindIt TRUE 
  /next j    
/return ${behindIt} 

Sub Event_exp 
  /echo ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /popup ** XP-Delta: REG (${Math.Calc[${Me.PctExp}-${Exp}]}%), AA (${Math.Calc[${Me.PctAAExp}-${AAExp}]}%), LDR (${Math.Calc[${Me.PctGroupLeaderExp}-${LDExp}]}%) 
  /varset LDExp ${Me.PctGroupLeaderExp} 
  /varset AAExp ${Me.PctAAExp} 
  /varset Exp ${Me.PctExp} 
/return 


Sub event_reroot 
      /if (${roottoggle}) { 
         /target npc ${targetarray[3]} 
         :tryagain 
         /call Cast "${rootspell}" gem2 10s 
         /doevents 
         /if (${castReturn}.Equal[CAST_RESIST]) /goto :tryagain 
      } 
/return 

sub event_GotHit 
    /if (${autojolt} && ${Me.SpellReady[${joltspell}]}) { 
      /popup Agro Detected, Casting Jolt! 
      /call cast "${joltspell}" gem5 5s 
} 
    /if (${noarch} && ${useMU} && ${stickonnoarch} && ${Stick.MoveBehind}) { 
       /if (${Me.Underwater}) { 
         /squelch /stick 10 uw 
       } else { 
         /squelch /stick 10 
       } 
     } 
/return 

sub Event_Casting 
   :checkcast 
    /delay 1 
    /if (${Me.Casting.ID}) /goto :checkcast 
/return 

sub forage 
   /delay 3 
   /if (${Me.Sitting}) { 
      /stand 
      /varset sitstatus TRUE 
   } 
   /if (${Me.Ducking}) /stand 
    
  :WaitLoop 
   /if (${Me.Casting.ID}) { 
      /delay 1 
      /goto :WaitLoop 
   } else { 
   /doability Forage 
   /doevents 
   } 
        
   /call destroyornot 
   /if (${sitstatus}) { 
      /sit 
      /varset sitstatus FALSE 
   } 
/return 

sub Event_waitforage 
   /if (${foragetoggle}) /varset waitforage TRUE 
/return 

sub destroyornot 
      :Keep 
   /delay 5 
   /if (!${Cursor.ID}) /return 
   /varset invset ${Ini[ArchSettings.ini,ForageList,${Cursor.Name},${notset}]} 
   /if (${invset}==${notset}) { 
      /ini "ArchSettings.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      /echo Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /popup Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /mqlog Found ${Math.Calc[${FindItemCount[${Cursor.Name}]}+1].Int} ${Cursor.Name}'s so far! 
      /autoinv 
	  /delay 5
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /mqlog "${Cursor.Name} Destroyed!" 
      /destroy 
      /if (${Cursor.ID}) /goto :Keep 
      } 
/return 

Sub Wait4Rez 
/echo Now Waiting for rez, Will auto accept and loot all items! 

:waitforrez 
   /if (!${Window[ConfirmationDialogBox].Open}) { 
      /delay 5s ${Window[ConfirmationDialogBox].Open} 
      /goto :waitforrez 
   } 
   /if (${Window[ConfirmationDialogBox].Open}) /notify ConfirmationDialogBox Yes_Button leftmouseup 
:zonein 
   /delay 5 
   /squelch /target mycorpse 
   /delay 5 
   /if (${Target.CleanName.NotEqual[${Me}'s corpse]}) /goto :zonein 
   /if (${Target.CleanName.Equal[${Me}'s corpse]}) { 
      /delay 3s 
      /call Loot_Corpse 
   } else /goto :zonein 

/return 

Sub Loot_Corpse 

  /declare LootTotal int local 0 
  /declare LootSlot int local 

  /squelch /target mycorpse 
  /if (${Target.Type.NotEqual[CORPSE]} || !${Target.ID}) { 
    /echo ** Can't target my corpse. 
    /return 
  }    
  /corpse 
  /delay 1s 
  /loot 
  /delay 3s 
  /if (${Me.State.NotEqual[BIND]}) { 
    /echo ** Massive lag right now... Aborting looting. 
    /return 
  } 

  :LootLag 
  /if (${LootTotal}!=${Corpse.Items}) { 
    /varset LootTotal ${Corpse.Items} 
    /delay 5 
    /goto :LootLag 
  } 

  /for LootSlot 1 to ${LootTotal} 
    :LootItem 
    /itemnotify loot${LootSlot} rightmouseup 
    /delay 3 
    /if (${Corpse.Item[${LootSlot}].ID}) { 
      /delay 2 
      /goto :LootItem 
    } 
  /next LootSlot 
  /delay 5 
  /echo ** Done looting my corpse. 
  /notify LootWnd DoneButton leftmouseup 
  

/return  



Sub Event_SetForage 
  /if (${foragetoggle}) { 
    /varset foragetoggle FALSE 
    /echo ** Auto-Forage is now OFF! 
  } else { 
    /varset foragetoggle TRUE 
    /echo ** Auto-Forage is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoForage" "${foragetoggle}" 
/return 
            
Sub Event_SetSelfBuff        
  /if (${selfbuff}) { 
    /varset selfbuff FALSE 
    /echo ** Self Buffing is now OFF! 
  } else { 
    /varset selfbuff TRUE 
    /echo ** Self Buffing is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
/return 

Sub Event_SetSnare(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset snarespell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "SnareSpell" "${snarespell}" 
} else { 
   /if (${snaretoggle}) { 
    /varset snaretoggle FALSE 
    /echo ** Auto-Snare is now OFF! 
  } else { 
    /varset snaretoggle TRUE 
    /echo ** Auto-Snare is now ON! 
  } 
} 
  /echo ** SnareSpell == ${snarespell} 
   /ini "ArchSettings.ini" "General" "AutoSnare" "${snaretoggle}" 
/return 

Sub Event_AutoJolt(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset joltspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "JoltSpell" "${joltspell}" 
} else { 
   /if (${autojolt}) { 
    /varset autojolt FALSE 
    /echo ** Auto-Jolt is now OFF! 
  } else { 
    /varset autojolt TRUE 
    /echo ** Auto-Jolt is now ON! 
    /memspell 5 "${joltspell}" 
  } 
} 
  /echo ** JoltSpell == ${joltspell} 
   /ini "ArchSettings.ini" "General" "AutoJolt" "${autojolt}" 
/return 
            
Sub Event_SetTaunt            
  /if (${taunttoggle}) { 
    /varset taunttoggle FALSE 
    /echo ** Auto-Taunt is now OFF! 
  } else { 
    /varset taunttoggle TRUE 
    /echo ** Auto-Taunt is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "AutoTaunt" "${taunttoggle}" 
/return 

Sub Event_SetVerbose 
  /if (${verbose}) { 
    /varset verbose FALSE 
    /echo ** Verbosity is now OFF! 
  } else { 
    /varset verbose TRUE 
    /echo ** Verbosity is now ON! 
  } 
   /ini "ArchSettings.ini" "General" "Verbosity" "${verbose}" 
/return 

Sub Event_SetNoArch(string Line) 
/if (${Line.Arg[3].Equal[stick]}) { 
  /if (!${useMU}) { 
   /echo Sorry, MQ2MoveUtils UNAVAILABLE, go get the plugin!! 
} else { 
   /if (${stickonnoarch}) { 
    /varset stickonnoarch FALSE 
    /echo ** /stick on NoArch Melee is now OFF! 
  } else { 
    /varset stickonnoarch TRUE 
    /echo ** /stick on NoArch Melee is now ON! 
  } 
} 
} else { 
  /if (${noarch}) { 
    /varset noarch FALSE 
    /echo ** Archery is now ON! 
  } else { 
    /varset noarch TRUE 
    /echo ** Archery is now OFF! 
  } 
} 
   /ini "ArchSettings.ini" "General" "NoArchery" "${noarch}" 
   /ini "ArchSettings.ini" "General" "StickOnNoArchery" "${stickonnoarch}" 
/return 
          
Sub Event_SetRoot(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset rootspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "RootSpell" "${rootspell}" 
} else { 
   /if (${roottoggle}) { 
    /varset roottoggle FALSE 
    /echo ** Auto-ReRoot is now OFF! 
  } else { 
    /varset roottoggle TRUE 
    /echo ** Auto-ReRoot is now ON! 
  } 
} 
  /echo ** RootSpell == ${rootspell} 
   /ini "ArchSettings.ini" "General" "AutoReRoot" "${roottoggle}" 
/return 
            
Sub Event_SetAutoAssist(string Line) 
/if (${Line.Arg[3].Length}) { 
   /varset PctToAssist ${Line.Arg[3]} 
   /echo ** HP% to Assist = ${PctToAssist} 
   /ini "ArchSettings.ini" "General" "PctHPsToAssist" "${PctToAssist}" 
} else { 
  /if (${autoassist}) { 
    /varset autoassist FALSE 
    /echo ** AutoAssist is now OFF! 
    /if (${eqassistonoff}) /squelch /assist on 
  } else { 
    /varset autoassist TRUE 
    /echo ** AutoAssist is now ON! 
    /if (${eqassistonoff}) /squelch /assist off 
  } 
} 
    /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/return 
      
Sub Event_SetAssistDistance(string Line) 
  /if (${Line.Arg[3].Length}) /varset assistdistance ${Line.Arg[3]} 
   /echo ** New AssistDistance == ${assistdistance} 
    /ini "ArchSettings.ini" "General" "AssistDistance" "${assistdistance}" 
/return 

Sub Event_SetTankName(string Line) 
  /if (${Line.Arg[3].Length}) /varset tankname ${Line.Arg[3]} 
   /echo ** New TankName == ${tankname} 
    /ini "ArchSettings.ini" "General" "TankToAssist" "${tankname}" 
/return 

Sub Event_SetTargetSpells 
  /if (${targetspells}) { 
    /varset targetspells FALSE 
    /echo ** TargetSpells are now OFF! 
  } else { 
    /varset targetspells TRUE 
    /echo ** TargetSpells are now ON! 
  } 
   /ini "ArchSettings.ini" "General" "TargetSpells" "${targetspells}" 
/return 

Sub Event_Death 
  /varset diedBeforeZone TRUE 
  /echo ** YOU DIED... Setting autoassist and selfbuff to off! 
  /varset autoassist FALSE 
  /varset selfbuff FALSE 
  /call Wait4Rez 
} 
/return 

Sub Event_Zoned 
  /if (${eqassistonoff}) /squelch /assist off 
  /ini "ArchSettings.ini" "General" "AutoAssist" "${autoassist}" 
/if (${diedBeforeZone}) { 
   /ini "ArchSettings.ini" "General" "SelfBuffing" "${selfbuff}" 
   /varset diedBeforeZone FALSE 
   } 
/return 

Sub LazyRanger 

|====[Self Buffs]======================================== 

/for j 1 to 8 
/doevents 
/if (!${selfbuff}) /goto :FallOut 
      /varset spellname "${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}]}" 
        /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].NotEqual[NoBuffListed]}) { 
            /if (!${Me.Buff[${spellname}].ID}) { 
               /if (${Me.Sitting}) { 
               /stand 
               /varset sitstatus TRUE 
            } 
            /target ${Me} 
            /call Cast ${spellname} gem7 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
            /if (${sitstatus} && !${battle}) { 
               /sit 
               /varset sitstatus FALSE 
   } 
} 
      } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
    /doevents 
    :Fallout 
/return 

Sub Event_AddSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[NoBuffListed]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "${Line.Arg[3]}" 
        /echo ** ${Line.Arg[3]} added as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Self Buff slots all filled! Get rid of some! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_RemSelfBuff(string Line) 
  /if (${Line.Arg[3].Length}) { 
    /for j 1 to 20 
      /if (${Ini[ArchSettings.ini,SelfBuffs,SelfBuff${j}].Equal[${Line.Arg[3]}]}) { 
        /ini "ArchSettings.ini" "SelfBuffs" "SelfBuff${j}" "NoBuffListed" 
        /echo ** ${Line.Arg[3]} removed as a SelfBuff. 
        /goto :FallOut 
      } 
    /next j 
    /echo ** Can't find ${Line.Arg[3]} in SelfBuff list! 
  } else { 
    /echo ** Huh? 
  } 
  :FallOut 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 
      /if (!${targetspells}) /return 
|====[Target Buffs]======================================== 
/for j 1 to 8 
         /if (!${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}].Equal[NoBuffListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,TargetBuffs,TBuffTriggerWord${j}]}" 
         /varset spellname "${Ini[ArchSettings.ini,TargetBuffs,TargetBuff${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
                  /if (${targetspells}) { 
                     /target ${Sender} 
                     /delay 2s 
                     /call cast ${spellname} gem4 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
                     /if (${verbose}) /tell ${Sender} inc ${triggername} 
               } 
            } 
         } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to 8 
      /if (!${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}].Equal[NoSpellListed]}) { 
         /varset triggername "${Ini[ArchSettings.ini,AssistSpell,ASpellTriggerWord${j}  ]}" 
         /varset spellname "${Ini[ArchSettings.ini,AssistSpells,AssistSpell${j}]}" 
         /if ( ${ChatText.Find[${triggername}]} ) { 
               /assist ${Sender} 
               /delay 2s 
               /call cast ${spellname} gem4 ${Math.Calc[${Spell[${spellname}].CastTime}+${Spell[${spellname}].RecastTime}+5].Int}s 
               /if (${verbose}) /tell ${Sender} Inc ${spellname]} on %T. 
            } 
         } 
/next j 
    /if (${battle}) /target ${targetarray[3]} 
/return 

Sub Event_Harmony(string Line) 
   /declare spawnnum int local 1 
   /declare targ int local 0 
   /declare range int local 20 
   /if (${Line.Arg[3].Length}) /varset range ${Line.Arg[3]} 
   |Auto-harmonies mobs within a certain range of your target 
   |Directions: have a mob targeted, run the snippet, 
   |by the end of the code all of the mobs should be harmonied and your 
   |target ready to pull. 
   /echo ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /popup ** Begining to HARMONY everything within a range of ${range} around ${Target.Name}. 
   /varset targ ${Target.ID} 
   /varset spawnnum 1 
   :harmonyLoop 
      /if ( ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}].ID} ) { 
      /target ${Spawn[${targ}].NearestSpawn[${spawnnum}, npc radius ${range}]} 
      /call Cast "Harmony of Nature" gem7 10s 
      /delay 55 
      /varset spawnnum ${Math.Calc[${spawnnum}+1]} 
      /echo incremented, retargeting ${targ} 
      /goto :harmonyLoop 
   } 
   /target id ${targ} 
   /echo ** Harmony Complete.. Go Ahead and Pull..  
   /popup ** Harmony Complete.. Go Ahead and Pull..  
/return 

Sub Event_LootMyCorpse(string Line) 
   /if (${Line.Arg[3].Length}) /varset leaveSlot ${Line.Arg[3]} 
   /declare lootTotal int local 0 
   /declare lootSlot int local 0 
   /declare skippedCount int local 0 
   /declare wornSlotNumber int local 0 
   /target mycorpse 

   /if (${Target.Type.NotEqual[CORPSE]}) { 
      /echo ** Can't target my corpse. 
      /return 
   } 
   /corpse 
   /delay 1s 
   /loot 
   /delay 1s 
   /if (${Me.State.NotEqual[BIND]}) { 
      /echo ** Error in getting onto corpse! Aborting. 
      /return 
   } 

   :lootLag 
   /varset lootTotal ${Corpse.Items}    
   /delay 2 
   /if (${lootTotal}!=${Corpse.Items}) { 
      /goto :lootLag 
   } 

   :doAgain 
   /for lootSlot 1 to ${lootTotal} 
      /if (${leaveSlot.Length}) { 
         /for wornSlotNumber 1 to ${Corpse.Item[${lootSlot}].WornSlots} 
            /if (${Corpse.Item[${lootSlot}].WornSlot[${wornSlotNumber}]} == ${InvSlot[${leaveSlot}].ID}) { 
               /varcalc skippedCount (${skippedCount} + 1) 
               /next lootSlot 
            } 
         /next wornSlotNumber 
      } 

      :lootItem 
      /if (${Corpse.Item[${lootSlot}].ID}) { 
         /itemnotify loot${lootSlot} rightmouseup 
         /delay 2 
         /goto :lootItem 
      } 
      /delay 2 
   /next lootSlot 
   /if (${Corpse.Items} > ${skippedCount}) /goto :doAgain 
   /delay 5 
   /echo ** Done looting my corpse. 
   /notify LootWnd DoneButton leftmouseup 
   /varset leaveSlot 
/return 

sub Event_EarthCall 
   /if (${verbose} && !${rangerslowed}) /gsay Ranger Slow Landed.. Hope it helps.. 
   /varset rangerslowed TRUE 
   /return 

Sub Event_PatchHeal(string Line) 
  /if (${Line.Arg[3].Length}) { 
   /varset Healspell ${Line.Arg[3]} 
  /ini "ArchSettings.ini" "General" "HealSpell" "${Healspell}" 
} else { 
   /if (${patchheal}) { 
    /varset patchheal FALSE 
    /echo ** PatchHealing is now OFF! 
  } else { 
    /varset patchheal TRUE 
    /echo ** PatchHealing is now ON! 
    /memspell 9 "${Healspell}" 
  } 
} 
  /echo ** HealSpell == ${Healspell} 
   /ini "ArchSettings.ini" "General" "PatchHeal" "${patchheal}" 
/return 

Sub Event_HealPct(string Line) 
  /if (${Line.Arg[3].Length}) /varset healgrouppct ${Line.Arg[3]} 
   /echo ** New GroupHealPct == ${healgrouppct} 
    /ini "ArchSettings.ini" "General" "HealPct" "${healgrouppct}" 
/return 

Sub Healer 
/varset spellname "${Healspell}" TRUE 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].ID} && ${Group.Member[${g}].PctHPs}<${healgrouppct}) { 
               /target PC ${Group.Member[${g}]} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
           } 
            /next g 
               /for g 1 to ${Group} 
               /if (${Group.Member[${g}].Pet.ID} && ${Group.Member[${g}].Pet.PctHPs}<${healgrouppct}) { 
               /target Pet ${Group.Member[${g}].Pet} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]}    
               } 
            /next g 
               /if (${Me.PctHPs}<${healgrouppct}) { 
               /target ${Me} 
               /if (${verbose}) /g Inc ${Healspell} to %t 
               /call cast ${spellname} gem8 
               /if (${battle}==1) /target ${targetarray[3]} 
            }              
/return 

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

Sub Event_ItemBounce(string Line) 
  |- Sanity check parameters 
  /if (!${Line.Arg[4].Length}) { 
    /echo ** Improper use of /ibounce 
    /echo -- /ibounce <itemalias> "Some Spell Name" 
    /echo -- For example: 
    /echo -- /ibounce gobby "Strength of Tunare" 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${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[ArchSettings.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 "ArchSettings.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
    /echo ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list 
  } 
/return 

Sub Event_ItemCast(string Line) 
  |- Sanity check parameter 
  /if (!${Line.Arg[3].Length}) { 
    /echo ** Improper use of /icast 
    /echo -- /icast <itemalias> 
    /echo -- For example: 
    /echo -- /icast gobby 
    /return 
  } 
  |- Look for that item's section, return if non-existent 
  /if (!${Ini[ArchSettings.ini,${Line.Arg[3]}].Length}) { 
    /echo ** [${Line.Arg[3]}] not in INI file! 
    /return 
  } 
  /declare fullname string local ${Ini[ArchSettings.ini,${Line.Arg[3]},FullName]} 
  |- Is it in a Bag? 
  /echo ** 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 
    /echo ** 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}) { 
      /echo ** Clicking: ${fullname} 
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup 
      /delay 2 
    } else { 
      /echo ** "${fullname}" not found! 
    } 
  } 
  :CastLoop 
  /delay 1 
  /if (${Me.Casting.ID}) /goto :CastLoop 
/return 

Sub Event_Enraged 
  /echo Enrage detected! Target: ${Target.CleanName} 
  /varset isEnraged TRUE 
/return 

Sub Event_NLEnraged 
  /echo Enrage done! Target: ${Target.CleanName} 
  /varset isEnraged FALSE 
  /if (${Target.ID} && ${battle}) /attack on 
/return 

Sub Event_StopFight 
/varset stopfighting TRUE
/varset autofire FALSE
/autofire off  
/return 

sub Event_DisplayHelp 
   /echo -=Arch.Mac Help=- 
   /echo /SetSnare <SnareSpell> Toggles AutoSnare off/on or sets the snare spell 
   /echo /SetRoot <RootSpell> Toggles AutoReRoot off/on or sets the root spell 
   /echo /SetJolt <JoltSpell> Toggles AutoJolt off/on or sets the jolt spell 
   /echo /SetDD1 <DD1 Spell> Toggles AutoDD at 70% off/on or sets the DD1 spell 
   /echo /SetDD2 <DD2 Spell> Toggles AutoDD at 30% off/on or sets the DD2 spell 
   /echo /SetPatchHeal <HealSpell> Toggles PatchHealing off/on or sets the heal spell 
   /echo /SetHealPct <#> Sets the % when to patch heal 
   /echo /SetTaunt Toggles AutoTaunt off/on 
   /echo /SetForage Toggles AutoForage off/on 
   /echo /SetVerbose Toggles Verbosity off/on 
   /echo /SetSelfBuff Toggles SelfBuffing off/on 
   /echo /AddSelfBuff <BuffName> Adds a SelfBuff 
   /echo /RemSelfBuff <BuffName> Removes a SelfBuff 
   /echo /SetTSpells Toggles Targeted spells on tell on/off 
   /echo /SetAutoAssist <HP%> Toggles AutoAssist off/on with #% HP at which to Assist 
   /echo /SetTankName <TankName> Sets the TankName to AutoAssist 
   /echo /SetAssistdistance <distance> Sets the distance to target to start attacking 
   /echo /SetNoArch <stick> Turns Archery off/on if MQ2MoveUtils, <stick> will stick on the Target. 
   /echo /LootMyCorpse <ItemSlot> Loots your corpse except for <itemslot> if specified 
   /echo /Harmony <range> Harmonies all spawns within <range> of your target. 
   /echo /iset <itemalias> keepup|nokeepup <"Item Name"> - Item settings    
   /echo /ibounce <itemalias> <"Spell Name"> - Add bounce-off spell 
   /echo /iclick <itemalias> - Click cast item defined in <itemalias> 
   /echo /stopfight Stop Attacking Current Target 
   /echo /Setuseepic off/on epic 1.5 
   /echo /ArchHelp Shows this dialog 
   /echo /ArchStatus Shows Current Status 
/return 

sub Event_ArchStatus 
   /echo -=Arch.Mac Status=- 
   /echo AutoSnare: ${snaretoggle}, SnareSpell: ${snarespell} 
   /echo AutoReRoot: ${roottoggle}, RootSpell: ${rootspell} 
   /echo AutoDD 70%: ${dd1}, DDSpell1: ${ddspell1} 
   /echo AutoDD 30%: ${dd2}, DDSpell2: ${ddspell2} 
   /echo AutoJolt: ${autojolt}, JoltSpell: ${joltspell} 
   /echo PatchHeal: ${patchheal}, HealSpell: ${Healspell}, HealPct: ${healgrouppct} 
   /echo AutoTaunt: ${taunttoggle} 
   /echo AutoForage: ${foragetoggle} 
   /echo Verbosity: ${verbose} 
   /echo NoArchery: ${noarch} StickOnNoArchery: ${stickonnoarch} 
   /echo AutoSelfBuff: ${selfbuff} 
   /echo TargetSpells: ${targetspells} 
   /echo AutoAssist: ${autoassist}, TankName: ${tankname}, AssistDistance: ${assistdistance}, HPsToAssist: ${PctToAssist} 
   /echo Useepic: ${useepictoggle} 
   /echo Status Complete.... 
   /return
 
I am using the macro on page one in the first post for me everything is working the only thing I Can NOT get to work is the Root.. Anyone have a tip on how to get root to work? Here is my ini file i have tried several entries none seem to work.. Not sure if I am doing something wrong the snare works fine

[General]
SnareSpell=Snare
SetRoot=Grasping
RootSpell=Grasping Roots
HealSpell=Minor Healing
AutoSnare=TRUE
AutoReRoot=TRUE
Auto-ReRoot=TRUE
Root=TRUE
AutoReRoot=on
AutoRoot=TRUE
AutoRoot=on
Root=TRUE


The other issue with this macro is that in TSS, the mobs come up to you and start to hit you. It says they are to close to hit with ranged.. But They are like 1 step away so you can not use melee either so you die.. The MQ2MoveUtil needs to make u move forward one or 2 steps not sure if there is a way to do that either.
 
Ranger Macro help..

Users who are viewing this thread

Back
Top
Cart