Page 1 of 7

ARCH.Mac v2.4 [All Purpose Ranger Mac] (Updated: 10-27-04)

Posted: Sun Sep 19, 2004 3:11 am
by loadingpleasewait
UPDATED: 10/27/2004

October 27, 2004
Tweaked /stopfight to turn autoassist off, before if you had autoassist on, stopfight would just assist yer tank again and start fighting again.
Added an Target Animation check to the archery to hopefully keep from shooting arrows at mezzed mobs.
Added a line of sight check to archery and snare to help get rid of some of the spam.
Added an invis check before calling the selfbuffs so if yer invis, the whole macro doesnt pause. (doing this within spell_routines paused the whole thing.)
Added a check for the AA entrap so if resisted it should recast. (it was getting the resist message but it couldnt recast because the ability wasnt ready.)
Added /SetDD1 <DD1 Spell> Toggles AutoDD at 70% off/on or sets the DD1 spell.
Added /SetDD2 <DD2 Spell> Toggles AutoDD at 30% off/on or sets the DD2 spell.
(technically these two would work for any spell, not just DD spells.)
More Tweaks And Adjustments.. Etc. etc...

October 5, 2004
Tweaked forage just a smidge, thanks fennecfox.
Enrage check should actually be working now, Thanks dman.

October 3, 2004
Forage hopefully fixxed now (stupid mistakes, and ini file still screwed up <wasnt thinking>)
Recast of snare on resist is TRULY fixed <Tested, Tested, and Tested some more>
Added /consent raid and /consent group upon death

September 30, 2004
Added support for new OOW Forage aa (checks for multiple foraged items)
Fixxed forage ini issue (wrong file called)
Added check for enrage when in melee (will automatically turn off melee if riposte damage is possible)
Added /stopfight command to stop all types of combat (almost acts as if the mob died)
Added Ini setting under the [General] settings for EQAssistOnOff=TRUE/FALSE for turning on/off eq's native attack on assist automatically. You have to set this to false yourself in the ini if you dont want eq's assist to do anything. (didnt want to add an alias for this).
Added autojolt via /setjolt command (automatically detects agro and casts the joltspell you specify via /setjolt <spellname>
Added patch healing via /SetPatchHeal <HealSpell> Toggles PatchHealing off/on or sets the heal spell
Added /SetHealPct <#> Sets the % when to patch heal
Added auto clickie support via the /iclick, /ibounce, and /iset commands (exactly like in other similiar macros)
RESNARE ON RESIST STILL APPEARS BROKEN, DONT ASK ABOUT IT! IF YOU CAN FIX IT, PLEASE DO..

September 21, 2004 2nd Update
Added HP% to /SetAutoAssist, usage /SetAutoAssist 95 ** This would wait untill the mob is below 95%HPs before Assisting.
The version number remains the same as I did not add any new aliases, just added more functionability to the current one.

September 21, 2004
Added /LootMyCorpse function taken from RH.mac again. :)
Added /Harmony <range> Taken from the Snippets section, It will attempt to harmony all mobs within <range> of your target. Default Range is 20. The range is not set in the INI, because I feel with harmony your range would be set on a case by case basis.
Added /SetTSpells to toggle targeted spells on tell off and on.
Added GhetoRangerEpicSlow message if Verbose=TRUE. When Earthcall Fires, it lets your group know. Was gheto slowing for my group, and felt I needed it.
Added /SetNoArch <Stick> to the NoArch, so if you have the MQ2MoveUtils plugin, then you will now stick to the target during melee.

September 19, 2004
New Era of Arch.mac.. Finally ini support. aliases included now to toggle functions. everything should still work as it used to, but there is alot more "on the fly" functionability. Now using Rusty's Spell_routines.inc, so go get that. Forage ini information has been moved to ArchSettings.ini. Ranger Entrap AA should now work out of the box. load the mac, and type /archhelp for a full list of commands.. Good Luck, and hope you like it.. Thanks to Jerle's RH.mac for alot of the help doing this.

Also to note, the aliases will only be loaded the first time, or when a new version is released.
Macro Code can be found NEXT post

Macro Code

Posted: Sun Sep 19, 2004 1:03 pm
by loadingpleasewait
Most Recent Macro, Version 2.4
October 27, 2004

Code: Select all

|** arch.mac Auto-Archery 
 Version 2.4        October 27, 2004
 by loadingpleasewait  **|
#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.Swimming}) { 
         /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.Swimming}) { 
         /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

Current Commands/Sample ini

Posted: Tue Sep 21, 2004 1:57 pm
by loadingpleasewait
Arch.mac now uses Spell_Routines.inc by Rusty, which can be found here: http://macroquest2.com/phpBB2/viewtopic.php?t=7568

Also, you need to set your snarespell. If you're using the alt ability "entrap" then /setsnare entrap and it will use that ability instead of casting an actual spell.

I've officially made a LongAssMacro. Had to cut the history off of the end of the macro in order to make it fit in the post. :(

The commands currently included are:

Code: Select all

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> 
Also, here is what my ArchSettings.ini looks like.

Code: Select all

[Version]
ArchMacVersion=Arch.mac will set this automatically.

[General]
EQAssistOnOff=TRUE
AutoSnare=TRUE
SnareSpell=entrap
AutoReRoot=FALSE
RootSpell=earthen roots
AutoTaunt=FALSE
AutoForage=FALSE
SelfBuffing=TRUE
TargetSpells=FALSE
Verbosity=FALSE
NoArchery=FALSE
StickOnNoArchery=TRUE
AutoAssist=TRUE
TankToAssist=TankName
AssistDistance=220
PctHPsToAssist=100
AutoJolt=TRUE
JoltSpell=cinder jolt
HealSpell=chloroblast
PatchHeal=TRUE
HealPct=20
DDSpell1=brushfire
AutoDD1=FALSE
DDSpell2=frozen wind
AutoDD2=TRUE

[SelfBuffs]
SelfBuff1=NoBuffListed 
SelfBuff2=Eagle Eye
SelfBuff3=Protection of the wild
SelfBuff4=Nature's Precision
SelfBuff5=NoBuffListed
SelfBuff6=NoBuffListed
SelfBuff7=bladecoat
SelfBuff8=NoBuffListed
SelfBuff9=NoBuffListed
SelfBuff10=NoBuffListed

[TargetBuffs]
TBuffTriggerWord1=soe
TargetBuff1=Spirit of Eagle
TBuffTriggerWord2=sot
TargetBuff2=Strength of Tunare
TBuffTriggerWord3=tunare
TargetBuff3=Strength of Tunare
TBuffTriggerWord4=sop
TargetBuff4=Spirit of the Predator
TBuffTriggerWord5=pred
TargetBuff5=Spirit of the Predator
TBuffTriggerWord6=cor
TargetBuff6=Call of the Rathe
TBuffTriggerWord7=rathe
TargetBuff7=Call of the Rathe
TBuffTriggerWord8=NoTriggerListed
TargetBuff8=NoBuffListed

[AssistSpells]
ASpellTriggerWord1=snare
AssistSpell1=Ensnare
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

[eyepatch]
FullName=eyepatch of plunder
KeepUp=TRUE
BounceOff1=vallon's quickening
BounceOff2=Speed of Vallon
BounceOff3=Swift like the wind
BounceOff4=Celerity
BounceOff5=talisman of alacrity
BounceOff6=alacrity
BounceOff7=speed of the shissar
BounceOff8=quickness
BounceOff9=speed of the brood
BounceOff10=wonderous rapidity
BounceOff11=speed of salik

[ForageList]
Pod of Water=0
Fruit=1
Fishing Grubs=0
Planar Fruit=1
It works quite well, if theres anything you'd like added, i'll see what I can do. Tell me what ya think bout the changes.. :)

Posted: Tue Sep 21, 2004 8:15 pm
by Fizeq
Loading,

This is a tremendous mac, thanks for your work on this :) Any chance of adding a command so that it'll start autofiring when the target is at a certain HP percentage? (i.e. /SetAssistHP 93) It would be a great way to prevent mez breaks when the MA switches to a mezed target.

Posted: Tue Sep 21, 2004 9:35 pm
by loadingpleasewait
that is one of the many things I was considering adding, yes. It shouldnt be hard. I'll work it in.

Posted: Tue Sep 21, 2004 10:18 pm
by loadingpleasewait
Wish Granted.. to set HP percentage, use the current /setautoassist and just use the #% at which you want to autoassist.

Example:
/setautoassist 75

will autoassist when the mobs hps are lower than 75%

The version number remains the same as I did not add any new aliases, just added more functionability to the current one.

Posted: Wed Sep 22, 2004 1:36 pm
by Fizeq
Nice! Much appreciated.

Posted: Fri Sep 24, 2004 12:51 pm
by wknight
any way to include the snare AA into this?

Posted: Fri Sep 24, 2004 1:30 pm
by N3mo
any chance you could post your spell_routines.inc? i have a few problems setting this up, and i think it might be in this part of it.

Thanks

Posted: Fri Sep 24, 2004 2:06 pm
by Fizeq
wknight,

Directly from the post above:

September 19, 2004
"New Era of Arch.mac.. Finally ini support. aliases included now to toggle functions. everything should still work
as it used to, but there is alot more "on the fly" functionability. Now using Rusty's Spell_routines.inc, so go get that.
Forage ini information has been moved to ArchSettings.ini. Ranger Entrap AA should now work out of the box"

Posted: Fri Sep 24, 2004 6:01 pm
by loadingpleasewait
wknight:
To add to what fizeq said, if your having problems with the ranger aa, then after running the macro, type:

Code: Select all

/setsnare entrap
and that would set it to use the entrap aa instead of an actual spell.

n3mo:
spell_routines.inc can be found here: http://macroquest2.com/phpBB2/viewtopic.php?t=7568 the link can be found in the 2nd post on this thread. The link is also found at the top of the actual macro itself.

Posted: Fri Sep 24, 2004 10:08 pm
by wknight
so far entrap doesnt retry on resist

Posted: Sat Sep 25, 2004 9:09 am
by loadingpleasewait
Neither does regular snare. Somthing has changed recently, I dont know what, but some reason the event isnt working. :( I'm still working on this, I've put some debug code in, and it finds the event firing, however it doesnt set the ${needsnare} variable back to true. I'm confused, but I'll figure it out eventually.

Clueless

Posted: Sat Sep 25, 2004 11:21 am
by Bound8
I'm pretty new to all this. I was able to compile mq following the directions using the free tools, got AFnuke/AFcleric to work. But no matter what I do with the arch.mac, it fails to open. I have the inc file in the same dir. Anyhelp or direction would be greatly appreciated.

*Edited* OK I feel stupid, for some reason when Isaved the files on my laptop, it saved them as arch.inc.text, which is why it wouldn't run them. Anyway thanks for all your hard work on this, it works great.

Posted: Sun Sep 26, 2004 11:53 am
by N3mo
thanks load, but that was not what i ment. what i ment was could you post one with the settings you use like the .ini you posted that gavea good idea of what you should put to what :)

and thanks a ton for the work put into this