Ranger Auto-Archery w/ Snare|CloseCombat|Forage|Taunt etc..

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Ranger Auto-Archery w/ Snare|CloseCombat|Forage|Taunt etc..

Post by loadingpleasewait » Mon May 17, 2004 8:50 pm

If yer a ranger, you'll like this..

!UPDATED!


OLD POST!! Find Latest Here:
http://macroquest2.com/phpBB2/viewtopic.php?t=9338



September 07, 2004
Just posting the fixxed version that Neith has so kindly provided. Thanks..

August 18, 2004
Updated to incorporate the Lazy Ranger mac by Ranjah_Down with the array support included by zanomo.
I was going to include support for user defined snare and root spells, but I dont know how to put custom variables into #Events, since variables are declared after events, so if ya wanna use somthing different, you gotta figure it out.. = )

June 19, 2004 Fixxed to work with June 19th zip. Basically set all variables to 0 as it appears they no longer default to 0. ADDED auto-assist toggle. I've had this in my own version for a while, I was just
to lazy to add it to the site. Basically, you target who you want to assist and start the macro. It MUST be a Player Character, if it is not, then the macro will end. The macro will now auto assist when the assist's Target is an NPC and within assistdistance, which is defaulted to 60. You may change the assistdistance at any time using the /varset assistdistance ### command. (replace ### with the distance you want to use. duh!) This will NOT follow your target, it will just let you stand, or sit, where you want and stand ya up when your target is near and begin firing arrows, or meleeing if the target is in range. Enjoy! = )

May 25, 2004 Modified by loadingpleasewait to add a toggle for arch.mac not to use archery?!? go figure.. but its done.. use "noarch" as the toggle argument

May 24, 2004 Modified by loadingpleasewait Added verbose toggle to announce snares and immune messages to group. Added distance check for auto-snare cast. Added .ini support to the autoforage, filename ArchForage.ini. Added check to see if you were sitting before forage, if you are, it will stand forage then sit again, if your not sitting, it will just continue standing. Fixed it so it will no longer assume that you have a 200 skill in forage.

May 21, 2004: updated to make foraging work a little more reliably, also added check for mobs immune to snare so it doesnt keep casting over and over... etc... fixxed the forage looping issue when you would have to wait longer to forage.. :(

updated to add auto taunt code

updated to add auto-reroot code and cleaned up parameters :)

Code: Select all

|** 
 arch.mac Auto-Archery 
 by loadingpleasewait 
  
 REQUIREMENT Spellcast.inc for reliable spell casting which can be found here: 
 http://macroquest2.com/phpBB2/viewtopic.php?t=6748 

 USAGE: 
 /mac arch <forage|snare|taunt|root|verbose|noarch|autoassist>  
 Use all, or none, in any order seperated by spaces to do specified action 
**| 
#chat group 
#chat tell 

#include spellcast.inc 
#turbo 40 
#Event exp "#*#experience!#*#" 
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off#*#" 
#Event Snaresuccess "#*#has been ensnared#*#" 
#Event Immune "#*#changes in its run speed#*#" 
#Event reroot "Your Earthen Roots spell has worn off#*#" 
#Event reroot "Your target resisted the Earthen Roots spell#*#" 
#Event Casting "#*#You begin casting#*#" 


Sub Main 


|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
| Lazy Ranger Macro by Rajah_Down 
| Incorporation begins here with 
| The Array changes done by zanomo 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

/declare j int outer 
/declare MyBuffs[5] string outer 
/varset MyBuffs[1] "Eagle Eye" 
/varset MyBuffs[2] "Mask of the Stalker" 
/varset MyBuffs[3] "Protection of the Wild" 
/varset MyBuffs[4] "Nature's Precision" 
/varset MyBuffs[5] "Cry of Thunder" 


/declare TargetBuff[4] string outer 
/declare TBuffsName[4] string outer 
/varset TBuffsName[1] " soe " 
/varset TargetBuff[1] "Spirit of Eagle" 
/varset TBuffsName[2] " sot " 
/varset TargetBuff[2] "Strength of Tunare" 
/varset TBuffsName[3] " sop " 
/varset TargetBuff[3] "Spirit of the Predator" 
/varset TBuffsName[4] " cor " 
/varset TargetBuff[4] "Call of the Rathe" 

/declare AssistBuff[2] string outer 
/declare ABuffsName[2] string outer 
/varset ABuffsName[1] "snare" 
/varset AssistBuff[1] "Ensnare" 
/varset ABuffsName[2] "snare pet" 
/varset AssistBuff[2] "Ensnare" 

/echo Lazy Ranjah Loaded... 

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
| Lazy Ranger Array Declares END 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

   /echo "Auto-Arch Macro has begun." 
   /declare i int local 
   /declare autoassist outer 0 
   /declare tankname outer 0 
   /declare assistdistance outer 60 
   /declare noarch outer 0 
   /declare verbose outer 0 
   /declare foragetoggle outer 0 
   /declare waitforage outer 0 
   /declare invset outer 0 
   /declare notset outer 0 
   /declare sitstatus outer 0 
   /declare snaretoggle outer 0 
   /declare taunttoggle outer 0 
   /declare roottoggle outer 0 
   /declare needsnare outer 0 
   /declare immunetosnare outer 0 
   /declare startexp outer 0 
   /declare startaaxp outer 0 
   /declare currentxp outer 0 
   /declare xpgain outer 0 
   /declare currentaa outer 0 
   /declare aagain outer 0 
   /declare battle outer 0 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 

/for i 0 to 6 
  /if (${Defined[Param${i}]}) { 
     /if (${Param${i}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle 1 
         /varset needsnare 1 
         /varset immunetosnare 0 
         } 
      /if (${Param${i}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle 1 
         } 
      /if (${Param${i}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle 1 
         /varset waitforage 0 
         /varset sitstatus 0 
         /varset notset -1 
         } 
      /if (${Param${i}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle 1 
         } 
      /if (${Param${i}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose 1 
         } 
      /if (${Param${i}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch 1 
         } 
      /if (${Param${i}.Equal[autoassist]}) { 
         /echo "Auto-Assist enabled" 
    /assist on  
         /varset autoassist 1 
         /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} 
         /echo Assist set to ${tankname} 
         /assist off 
            } 
         } 
   } 
/next i 

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

Sub Archery 
  /attack off 
  /varset battle 1 
  /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}!=1) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<40 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents 
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay %t has successfully been snared 
      } 
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<40 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /doevents 
    /if (${Target.Distance}<25) /call closecombat 
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
     /call LazyRanger 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) { 
      /varset needsnare 1 
      /varset immunetosnare 0 
   } 
    /keypress Num_5 
       /if (${sitstatus}==1) { 
      /sit 
      /varset sitstatus 0 
   } 
   /varset battle 0 
/return 

Sub closecombat 
  /attack on 
   :stillclose 
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off 
               /delay 5 
            /call forage 
            /attack on 
         } 
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Kick"]}) /doability "Kick" 
      /if (${taunttoggle}==1 && ${Target.Distance}<11 && ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
      /doevents 
      /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<40 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents 
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay %t has successfully been snared 
      } 
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<40 && ${Target.Distance}>150) { 
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!" 
      /delay 2 
   } 
    /if (${Target.Distance}<25 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]} 
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/return 


Sub event_reroot 
      /if (${roottoggle}==1) { 
         /target npc ${targetarray[3]} 
         /call Cast "Earthen Roots" gem2 
      } 
/return 

Sub Event_resist 
/doevents 
   /if (${snaretoggle}==1 && ${immunetosnare}==0) /varset needsnare 1 
      /return 

Sub Event_Immune 
   /if (${snaretoggle}==1) { 
      /varset needsnare 0 
      /varset immunetosnare 1 
      /if (${verbose}==1) /gsay %t is Immune to snare 
   } 
/return 

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

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

/return 

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

sub destroyornot 
   /varset invset ${Ini[ArchForage.ini,ForageList,${Cursor.Name},${notset}]} 
   /delay 3 
   /if (${invset}==${notset}) { 
      /ini "ArchForage.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! 
      :Keep 
      /autoinv 
      /delay 3 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /popup "${Cursor.Name} Destroyed!" 
      /destroy 
      } 
/return 

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
| Lazy Ranger subs 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

Sub LazyRanger 

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

/for j 1 to ${MyBuffs.Size} 
    /if (!${Me.Buff[${MyBuffs[${j}]}].ID}) { 
        /target ${Me} 
        /call Cast ${MyBuffs[${j}]} gem6 
    } 
/next j 
    /if (${battle}==1) /target ${targetarray[3]} 
    /doevents 
/return 

Sub Event_Chat(ChatType,Sender,ChatText) 

|====[Target Buffs]======================================== 
/for j 1 to ${TargetBuff.Size} 
    /if ( ${ChatText.Find[${TBuffsName[${j}]}]}) { 
        /target ${Sender} 
        /delay 2s 
        /call cast ${TargetBuff[${j}]} gem6 
        /tell ${Sender} inc ${TBuffsName[${j}]} 
    } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to ${AssistBuff.Size} 
    /if (${ChatText.Find[${ABuffName[${j}]}]}) { 
        /target ${Sender} 
        /delay 2s 
        /assist ${Sender} 
        /delay 2s 
        /call cast ${AssistBuff[${j}] gem6 
        /tell ${Sender} Inc Snare on %T. 
    } 
/next j 
    /if (${battle}==1) /target ${targetarray[3]} 
/return 

|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
| End Lazy Ranger subs 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

|** 
  HISTORY: 
  
 August 18, 2004 
 Incorporated the Lazy Ranger mac by Ranjah_Down with the array support included by zanomo. 
 I was going to include support for user defined snare and root spells, but I dont know how to put custom variables into #Events, since variables are declared after events, so if ya wanna use somthing different, you gotta figure it out.. = ) 
  
 June 19, 2004 Fixxed to work with June 19th zip. Basically set all variables to 0 as it appears they no 
 longer default to 0.  ADDED auto-assist toggle.  I've had this in my own version for a while, I was just 
 to lazy to add it to the site. Basically, you target who you want to assist and start the macro. It MUST 
 be a Player Character, if it is not, then the macro will end. The macro will now auto assist when the assist's 
 Target is an NPC and within assistdistance, which is defaulted to 60. You may change the assistdistance at 
 any time using the /varset assistdistance ### command. (replace ### with the distance you want to use. duh!) 
 This will NOT follow your target, it will just let you stand, or sit, where you want and stand ya up when 
 your target is near and begin firing arrows, or meleeing if the target is in range. Enjoy!  = ) 

 May 25, 2004 Modified by loadingpleasewait to add a toggle for arch.mac not to use archery?!? go figure.. 
 but its done.. use "noarch" as the toggle argument. 
  
 May 24, 2004 Modified by loadingpleasewait Added verbose toggle to announce snares and immune messages 
 to group. Added distance check for auto-snare cast.  Added .ini support to the autoforage, filename 
 ArchForage.ini. Added check to see if you were sitting before forage, if you are, it will stand forage 
 then sit again, if your not sitting, it will just continue standing. Fixed it so it will no longer 
 assume that you have a 200 skill in forage. 
  
 May 21, 2004 Modified by loadingpleasewait more bugs swatted, added check for mobs immune to snare 
 so the macro doesnt keep trying to cast on the mob, over and over and over and over and over... etc.. 
 fixxed the forage looping issue when you would have to wait longer to forage.. :( 

 May 18,2004 Modified by loadingpleasewait added an autotaunt when within closecombat 
 also added root toggle to toggle weather or not to ReRoot your target 
  
 May 17, 2004 Modified by loadingpleasewait to swat bugs, make automelee 
 work automatically, make the autosnare a toggle and all around make it better :) 
  
 May 5, 2004 Modified by Kasodo  updated to MQ2Data /MQ2Datavars Autosnare at 70% 
  
 UNKNOWN DATE Created by loadingpleasewait  
  
  
 ABOUT: 
 just run this macro, target a mob, and turn on auto attack 
 The macro will detect autoattack, turn it back off, and begin firing arrows 
 or as I do, just /assist your MA =P 
  
 In some situations, you know what I'm talking about, you need to melee.. 
 No Problem!  this macro will auto melee also! When in close range to the target 
 the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
 then just step back out of range and it will start firing arrows again!!! 
 Auto taunt now added as a toggle.  

 Added auto-reroot, good for soloing when root breaks. it does NOT auto root, 
 it just re roots your already rooted target.(wouldnt want it to auto root, 
 as it would root your target at its spawn location) 
  
 It will display the experience gain as an echo and popup. 
**| 
Last edited by loadingpleasewait on Sun Sep 19, 2004 12:42 pm, edited 16 times in total.
LOADING PLEASE WAIT...

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue May 18, 2004 9:14 am

added autotaunt via toggle..

Rangers unite, what else is there that a ranger would want at his/her fingertips at all times?
LOADING PLEASE WAIT...

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Tue May 18, 2004 10:33 am

new, group activation on inc, good for group macros. I use a shaman macro edited from Azum's wizard mac, the auto rogue mac, and the heal bot. they are all activated by group chat hotbottons i make, here is my slightly edited version of this to assist on a group message of "inc"

Code: Select all

|arch.mac Auto-Archery 
|just run this macro, target a mob, and turn on auto attack 
|The macro will detect autoattack, turn it back off, and begin firing arrows 
|or as I do, just /assist your MA =P 
| 
|In some situations, you know what I'm talking about, you need to melee.. 
|No Problem!  this macro will auto melee also! When in close range to the target 
|the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
|then just step back out of range and it will start firing arrows again!!! 
|Auto taunt now added as a toggle. 
| 
|the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
|the macro will recast the spell "Eagle Eye"                  CHANGE THIS 
| REQUIREMENT Spellcast.inc for reliable spell casting 
| 
|It will display the experience gain as an echo and popup. 
| 
| Created by loadingpleasewait on UNKNOWN DATE 
| Modified by Kasodo May 5, 2004 updated to MQ2Data /MQ2Datavars 
| Autosnare at 70% 
| Modified by loadingpleasewait on May 17, 2004 to swat bugs, make automelee 
| work automatically, make the autosnare a toggle and all around make it better  
| Modified by loadingpleasewait on May 18,2004 to add an autotaunt when within closecombat 
| 
| usage: 
| 
| /mac arch Forage               enter forage if you want to auto forage 
| /mac arch Taunt                enter taunt to autotaunt when in melee distance 
| /mac arch Snare                enter snare if you want to snare at 70% 
| /mac arch Snare Forage         enter snare then forage to snare and forage, but not taunt 
| /mac arch Taunt Forage         enter taunt then forage to taunt and forage, but not snare 
| /mac arch Snare Taunt          enter snare then taunt to snare and taunt, but not forage 
| /mac arch Snare Taunt Forage   enter snare, taunt, then forage for it to do all 3 
| 


#include spellcast.inc 
#turbo 40 
#Event exp "#*#experience!#*#" 
#event haste "#*#The quickening spirit departs#*#" 
#event eagle "#*#The avian presence departs#*#" 
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off." 
#Chat group



Sub Main 
   /echo "Auto-Arch Macro has begun." 
   /declare foragetoggle outer 
   /declare snaretoggle outer 
   /declare taunttoggle outer 
   /declare needsnare outer 
   /declare startexp outer 
   /declare startaaxp outer 
   /declare currentxp outer 
   /declare xpgain outer 
   /declare currentaa outer 
   /declare aagain outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 

/if (${Defined[Param0]} && ${String[${Param0}].Equal[snare]}) { 
   /echo "Auto-Snare enabled" 
   /varset snaretoggle 1 
   /varset needsnare 1 
   } 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[taunt]}) { 
   /echo "Auto-Taunt enabled" 
   /varset taunttoggle 1 
   } 
/if (${Defined[Param1]} && ${String[${Param1}].Equal[taunt]}) { 
   /echo "Auto-Taunt enabled" 
   /varset taunttoggle 1 
   } 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
/if (${Defined[Param1]} && ${String[${Param1}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
/if (${Defined[Param2]} && ${String[${Param2}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
      :mainloop 
   Sub Event_Chat(ChatType,Sender,ChatText) 
    /if (${ChatText.Equal[inc]}) { /assist ${Sender}  /attack on  /delay 1s }


	/if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
        /doevents 
      /goto :mainloop 
/return 


Sub Archery 
  /attack off 
  /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}) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
      /call Cast "Ensnare" gem4 
      /varset needsnare 0 
     }  
    /doevents 
    /if (${Target.Distance}<25) /call closecombat 

    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) /varset needsnare 1 
    /keypress Num_5 
/return 


Sub closecombat 
   /attack on 
|   /face nolook 
   :stillclose 
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
            /attack on 
         } 

/if (${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
/if (${Me.AbilityReady["Kick"]}) /doability "Kick" 
/if (${taunttoggle}==1 $$ ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
    /doevents 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
      /call Cast "Ensnare" gem4 
      /varset needsnare 0 
     } 
    /if (${Target.Distance}<18 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]} 
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/return 

Sub event_eagle 
      /call Cast "Eagle Eye" gem6 
      /delay 5s 
/return 

Sub event_haste 
      /call Cast "Eyepatch of Plunder" item 
      /delay 4s 
/return    

Sub Event_resist 
   /varset needsnare 1 
/return 

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue May 18, 2004 11:36 am

theone: thats cool, if you add in distance checks, you could stay in range or out of range and make it a bot instead of an assistant. = )

I updated the original code, made the toggles more userfriendly and less sloppy, added a reroot feature good for soloing, reroots an already rooted target.

hope ya like it..
LOADING PLEASE WAIT...

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue May 18, 2004 12:10 pm

Theone: instead of

Code: Select all

  Sub Event_Chat(ChatType,Sender,ChatText) 
    /if (${ChatText.Equal[inc]}) { /assist ${Sender}  /attack on  /delay 1s } 


wouldnt it be more efficient to just call archery? like this..

Code: Select all

  Sub Event_Chat(ChatType,Sender,ChatText) 
    /if (${ChatText.Equal[inc]}) { /assist ${Sender}  /call Archery} 
/return

or, for that matter, when you /assist ${Sender} that would turn attack on, and you could just do this

Code: Select all

  Sub Event_Chat(ChatType,Sender,ChatText) 
    /if (${ChatText.Equal[inc]}) /assist ${Sender} 
/return
just a suggestion :)
LOADING PLEASE WAIT...

theoneandonly
orc pawn
orc pawn
Posts: 26
Joined: Sun Apr 11, 2004 6:39 pm

Post by theoneandonly » Wed May 19, 2004 4:44 pm

most people have /assist off,so they dont attack when they assist. usefull for not breaking mezzes when assisting the MT of a raid
added to attack at 93% hp. to ensure no agro in any scenarios hopefully.
Also added distance check of 150.. happy botting

Code: Select all

|**arch.mac Auto-Archery 
|Just run this macro, and it will assist the puller and wait till it is in range and at the proper hp to engage. I suggest to put the ranger in a safe corner. for example in poearth, I use the corners in the zone in, or maybe even ontop of the zone to pot and earthb **|
| 
|In some situations, you know what I'm talking about, you need to melee.. 
|No Problem!  this macro will auto melee also! When in close range to the target 
|the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
|then just step back out of range and it will start firing arrows again!!! 
|Auto taunt now added as a toggle. 
| 
|the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
|the macro will recast the spell "Eagle Eye"                  CHANGE THIS 
| REQUIREMENT Spellcast.inc for reliable spell casting 
| 
|It will display the experience gain as an echo and popup. 
| 
| Created by loadingpleasewait on UNKNOWN DATE 
| Modified by Kasodo May 5, 2004 updated to MQ2Data /MQ2Datavars 
| Autosnare at 70% 
| Modified by loadingpleasewait on May 17, 2004 to swat bugs, make automelee 
| work automatically, make the autosnare a toggle and all around make it better  
| Modified by loadingpleasewait on May 18,2004 to add an autotaunt when within closecombat 
| 
| usage: 
| 
| /mac arch Forage               enter forage if you want to auto forage 
| /mac arch Taunt                enter taunt to autotaunt when in melee distance 
| /mac arch Snare                enter snare if you want to snare at 70% 
| /mac arch Snare Forage         enter snare then forage to snare and forage, but not taunt 
| /mac arch Taunt Forage         enter taunt then forage to taunt and forage, but not snare 
| /mac arch Snare Taunt          enter snare then taunt to snare and taunt, but not forage 
| /mac arch Snare Taunt Forage   enter snare, taunt, then forage for it to do all 3 
| 


#include spellcast.inc 
#turbo 40 
#Event exp "#*#experience!#*#" 
#event haste "#*#The quickening spirit departs#*#" 
#event eagle "#*#The avian presence departs#*#" 
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off." 
#Chat group 



Sub Main 
   /echo "Auto-Arch Macro has begun." 
   /declare foragetoggle outer 
   /declare snaretoggle outer 
   /declare taunttoggle outer 
   /declare needsnare outer 
   /declare startexp outer 
   /declare startaaxp outer 
   /declare currentxp outer 
   /declare xpgain outer 
   /declare currentaa outer 
   /declare aagain outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 

/if (${Defined[Param0]} && ${String[${Param0}].Equal[snare]}) { 
   /echo "Auto-Snare enabled" 
   /varset snaretoggle 1 
   /varset needsnare 1 
   } 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[taunt]}) { 
   /echo "Auto-Taunt enabled" 
   /varset taunttoggle 1 
   } 
/if (${Defined[Param1]} && ${String[${Param1}].Equal[taunt]}) { 
   /echo "Auto-Taunt enabled" 
   /varset taunttoggle 1 
   } 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
/if (${Defined[Param1]} && ${String[${Param1}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
/if (${Defined[Param2]} && ${String[${Param2}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   /varset foragetoggle 1 
   } 
      :mainloop 
   Sub Event_Chat(ChatType,Sender,ChatText) 
    
	/if (${ChatText.Equal[inc]}) && (${Target.Distance}>150) :goto mainloop
	/if (${ChatText.Equal[inc]}) && (${Target.Distance}<150) && ${Target.PctHPs}<93) { /assist ${Sender}  /call archery } 
	/if /if (${ChatText.Equal[inc]}) && (${Target.Distance}<150) :goto mainloop
 


   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
        /doevents 
      /goto :mainloop 
/return 


Sub Archery 
  /attack off 
  /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}) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
      /call Cast "Ensnare" gem4 
      /varset needsnare 0 
     }  
    /doevents 
    /if (${Target.Distance}<25) /call closecombat 

    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) /varset needsnare 1 
    /keypress Num_5 
/return 


Sub closecombat 
   /attack on 
|   /face nolook 
   :stillclose 
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
            /attack on 
         } 

/if (${Me.AbilityReady["Disarm"]}) /doability "Disarm" 
/if (${Me.AbilityReady["Kick"]}) /doability "Kick" 
/if (${taunttoggle}==1 $$ ${Me.AbilityReady["Taunt"]}) /doability "Taunt" 
    /doevents 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70) { 
      /call Cast "Ensnare" gem4 
      /varset needsnare 0 
     } 
    /if (${Target.Distance}<18 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose 
    /attack off 
   /return 

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]} 
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/return 

Sub event_eagle 
      /call Cast "Eagle Eye" gem6 
      /delay 5s 
/return 

Sub event_haste 
      /call Cast "Eyepatch of Plunder" item 
      /delay 4s 
/return    

Sub Event_resist 
   /varset needsnare 1 
/return

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Fri May 21, 2004 10:19 pm

updated first post with bug fixes and new checks..
May 21, 2004: updated to make foraging work a little more reliably, also added check for mobs immune to snare so it doesnt keep casting over and over... etc...
LOADING PLEASE WAIT...

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Fri May 21, 2004 11:50 pm

fixxed the forage looping issue when you would have to wait longer to forage..
LOADING PLEASE WAIT...

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Mon May 24, 2004 11:17 pm

May 24, 2004 Modified by loadingpleasewait Added verbose toggle to announce snares and immune messages to group. Added distance check for auto-snare cast. Added .ini support to the autoforage, filename ArchForage.ini. Added check to see if you were sitting before forage, if you are, it will stand forage then sit again, if your not sitting, it will just continue standing. Fixed it so it will no longer assume that you have a 200 skill in forage.

Code: Select all

|**
 arch.mac Auto-Archery 

 ABOUT:
 just run this macro, target a mob, and turn on auto attack 
 The macro will detect autoattack, turn it back off, and begin firing arrows 
 or as I do, just /assist your MA =P 
 
 In some situations, you know what I'm talking about, you need to melee.. 
 No Problem!  this macro will auto melee also! When in close range to the target 
 the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
 then just step back out of range and it will start firing arrows again!!! 
 Auto taunt now added as a toggle.  

 Added auto-reroot, good for soloing when root breaks. it does NOT auto root, 
 it just re roots your already rooted target.(wouldnt want it to auto root, 
 as it would root your target at its spawn location)

 the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
 the macro will recast the spell "Eagle Eye"                  CHANGE THIS 
 REQUIREMENT Spellcast.inc for reliable spell casting which can be found here:
 http://macroquest2.com/phpBB2/viewtopic.php?t=6748
 
 It will display the experience gain as an echo and popup. 
 
 HISTORY:
 UNKNOWN DATE Created by loadingpleasewait  
 
 May 5, 2004 Modified by Kasodo  updated to MQ2Data /MQ2Datavars Autosnare at 70%
 
 May 17, 2004 Modified by loadingpleasewait to swat bugs, make automelee 
 work automatically, make the autosnare a toggle and all around make it better :) 
 
 May 18,2004 Modified by loadingpleasewait added an autotaunt when within closecombat
 also added root toggle to toggle weather or not to ReRoot your target 
 
 May 21, 2004 Modified by loadingpleasewait more bugs swatted, added check for mobs immune to snare
 so the macro doesnt keep trying to cast on the mob, over and over and over and over and over... etc..
 fixxed the forage looping issue when you would have to wait longer to forage.. :(

 May 24, 2004 Modified by loadingpleasewait Added verbose toggle to announce snares and immune messages
 to group. Added distance check for auto-snare cast.  Added .ini support to the autoforage, filename 
 ArchForage.ini. Added check to see if you were sitting before forage, if you are, it will stand forage 
 then sit again, if your not sitting, it will just continue standing. Fixed it so it will no longer 
 assume that you have a 200 skill in forage. 

 USAGE:
 /mac arch <forage|snare|taunt|root|verbose>  
 Use all, or none, in any order seperated by spaces to do specified action
**|

#include spellcast.inc
#turbo 40
#Event exp "#*#experience!#*#" 
#Event haste "#*#The quickening spirit departs#*#"
#Event eagle "#*#The avian presence departs#*#"
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off#*#" 
#Event Snaresuccess "#*#has been ensnared#*#"
#Event Immune "#*#changes in its run speed#*#"
#Event reroot "Your Earthen Roots spell has worn off#*#"
#Event reroot "Your target resisted the Earthen Roots spell#*#"
#Event Casting "#*#You begin casting#*#" 
#Event waitforage "#*#before you can forage#*#"

Sub Main
   /echo "Auto-Arch Macro has begun."
   /declare i int local 
   /declare verbose outer
   /declare foragetoggle outer
   /declare waitforage outer
   /declare invset outer 
   /declare notset outer 
   /declare sitstatus outer
   /declare snaretoggle outer
   /declare taunttoggle outer
   /declare roottoggle outer
   /declare needsnare outer
   /declare immunetosnare outer
   /declare startexp outer 
   /declare startaaxp outer 
   /declare currentxp outer 
   /declare xpgain outer 
   /declare currentaa outer 
   /declare aagain outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp}

/for i 0 to 4 
  /if (${Defined[Param${i}]}) { 
     /if (${Param${i}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle 1 
         /varset needsnare 1
         /varset immunetosnare 0
         } 
      /if (${Param${i}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle 1 
         } 
      /if (${Param${i}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle 1 
         /varset waitforage 0
         /varset sitstatus 0
         /varset notset -1 
         } 
      /if (${Param${i}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle 1 
         } 
      /if (${Param${i}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose 1 
         } 
   } 
/next i

:mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage
        /doevents 
      /goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /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}) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
      }
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}>150) {
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!"
      /delay 2
   }
    /doevents
    /if (${Target.Distance}<25) /call closecombat
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
:EndAF
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) {
      /varset needsnare 1
      /varset immunetosnare 0
   }
    /keypress Num_5 
/return 

Sub closecombat
   /attack on
   :stillclose
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off
               /delay 5
            /call forage
            /attack on
         } 
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Disarm"]}) /doability "Disarm"
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Kick"]}) /doability "Kick"
      /if (${taunttoggle}==1 && ${Target.Distance}<11 && ${Me.AbilityReady["Taunt"]}) /doability "Taunt"
      /doevents 
      /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
      }
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}>150) {
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!"
      /delay 2
   }
    /if (${Target.Distance}<25 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose
    /attack off
   /return

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]}
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}
/return 

Sub event_eagle
      /call Cast "Eagle Eye" gem6
/return

Sub event_haste
      /call Cast "Eyepatch of Plunder" item
/return   

Sub event_reroot
      /if (${roottoggle}==1) {
         /target npc id ${targetarray[4]}
         /call Cast "Earthen Roots" gem2
      }
/return

Sub Event_resist 
/doevents
   /if (${snaretoggle}==1 && ${immunetosnare}==0) /varset needsnare 1 
      /return 

Sub Event_Immune
   /if (${snaretoggle}==1) {
      /varset needsnare 0 
      /varset immunetosnare 1
      /if (${verbose}==1) /gsay "Can't snare %t as it is immune"
   }
/return 

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

sub forage
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
   /if (${Me.Ducking}) /stand
   /doability Forage 
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
:waitforage
   /delay 3 
   /doevents
   /if (!${Cursor.ID} && ${waitforage}==0 && ${Me.Skill["Forage"]}==200) /goto :waitforage
   /varset waitforage 0
   /call destroyornot
/return

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

sub destroyornot
   /varset invset ${Ini[ArchForage.ini,ForageList,${Cursor.Name},${notset}]} 
   /delay 3
   /if (${invset}==${notset}) { 
      /ini "ArchForage.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      :Keep
      /autoinv
      /delay 3 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /destroy 
      } 
/return
LOADING PLEASE WAIT...

User avatar
Tel0net
orc pawn
orc pawn
Posts: 14
Joined: Wed May 05, 2004 1:07 pm
Location: California
Contact:

Post by Tel0net » Tue May 25, 2004 9:12 am

Couple of suggestions:

1. Ability to toggle archery on or off. Since I don't have EQ/AM3 yet, it's difficult to keep using arrows because they run out so quick

I had another one but I lost my train of thought, I'll post more when I come back from school.
MOO goes the Cow and WOOT goes the Tel0net

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue May 25, 2004 4:27 pm

Heh, kinda defeats the purpose of being an autoarchery macro, but then again, I guess its grown to be more than just that.. :) Wish Granted..

use "noarch" as the argument to turn off auto archery.

Code: Select all

|**
 arch.mac Auto-Archery 

 ABOUT:
 just run this macro, target a mob, and turn on auto attack 
 The macro will detect autoattack, turn it back off, and begin firing arrows 
 or as I do, just /assist your MA =P 
 
 In some situations, you know what I'm talking about, you need to melee.. 
 No Problem!  this macro will auto melee also! When in close range to the target 
 the macro automatically turns on autoattack, it auto kicks, and auto disarms. 
 then just step back out of range and it will start firing arrows again!!! 
 Auto taunt now added as a toggle.  

 Added auto-reroot, good for soloing when root breaks. it does NOT auto root, 
 it just re roots your already rooted target.(wouldnt want it to auto root, 
 as it would root your target at its spawn location)

 the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
 the macro will recast the spell "Eagle Eye"                  CHANGE THIS 
 REQUIREMENT Spellcast.inc for reliable spell casting which can be found here:
 http://macroquest2.com/phpBB2/viewtopic.php?t=6748
 
 It will display the experience gain as an echo and popup. 
 
 HISTORY:
 UNKNOWN DATE Created by loadingpleasewait  
 
 May 5, 2004 Modified by Kasodo  updated to MQ2Data /MQ2Datavars Autosnare at 70%
 
 May 17, 2004 Modified by loadingpleasewait to swat bugs, make automelee 
 work automatically, make the autosnare a toggle and all around make it better :) 
 
 May 18,2004 Modified by loadingpleasewait added an autotaunt when within closecombat
 also added root toggle to toggle weather or not to ReRoot your target 
 
 May 21, 2004 Modified by loadingpleasewait more bugs swatted, added check for mobs immune to snare
 so the macro doesnt keep trying to cast on the mob, over and over and over and over and over... etc..
 fixxed the forage looping issue when you would have to wait longer to forage.. :(

 May 24, 2004 Modified by loadingpleasewait Added verbose toggle to announce snares and immune messages
 to group. Added distance check for auto-snare cast.  Added .ini support to the autoforage, filename 
 ArchForage.ini. Added check to see if you were sitting before forage, if you are, it will stand forage 
 then sit again, if your not sitting, it will just continue standing. Fixed it so it will no longer 
 assume that you have a 200 skill in forage. 
 
 May 25, 2004 Modified by loadingpleasewait to add a toggle for arch.mac not use archery?!? go figure.. 
 but its done.. use "noarch" as the toggle argument.

 USAGE:
 /mac arch <forage|snare|taunt|root|verbose|noarch>  
 Use all, or none, in any order seperated by spaces to do specified action
**|

#include spellcast.inc
#turbo 40
#Event exp "#*#experience!#*#" 
#Event haste "#*#The quickening spirit departs#*#"
#Event eagle "#*#The avian presence departs#*#"
#Event resist "Your target resisted the Ensnare spell#*#" 
#Event resist "Your Ensnare spell has worn off#*#" 
#Event Snaresuccess "#*#has been ensnared#*#"
#Event Immune "#*#changes in its run speed#*#"
#Event reroot "Your Earthen Roots spell has worn off#*#"
#Event reroot "Your target resisted the Earthen Roots spell#*#"
#Event Casting "#*#You begin casting#*#" 
#Event waitforage "#*#before you can forage#*#"

Sub Main
   /echo "Auto-Arch Macro has begun."
   /declare i int local 
   /declare noarch outer
   /declare verbose outer
   /declare foragetoggle outer
   /declare waitforage outer
   /declare invset outer 
   /declare notset outer 
   /declare sitstatus outer
   /declare snaretoggle outer
   /declare taunttoggle outer
   /declare roottoggle outer
   /declare needsnare outer
   /declare immunetosnare outer
   /declare startexp outer 
   /declare startaaxp outer 
   /declare currentxp outer 
   /declare xpgain outer 
   /declare currentaa outer 
   /declare aagain outer 
   /declare targetarray[4] string outer 

   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp}

/for i 0 to 5
  /if (${Defined[Param${i}]}) { 
     /if (${Param${i}.Equal[snare]}) { 
         /echo "Auto-Snare enabled" 
         /varset snaretoggle 1 
         /varset needsnare 1
         /varset immunetosnare 0
         } 
      /if (${Param${i}.Equal[taunt]}) { 
         /echo "Auto-Taunt enabled" 
         /varset taunttoggle 1 
         } 
      /if (${Param${i}.Equal[forage]}) { 
         /echo "Auto-Forage enabled" 
         /varset foragetoggle 1 
         /varset waitforage 0
         /varset sitstatus 0
         /varset notset -1 
         } 
      /if (${Param${i}.Equal[root]}) { 
         /echo "Auto-ReRoot enabled" 
         /varset roottoggle 1 
         } 
      /if (${Param${i}.Equal[verbose]}) { 
         /echo "Group Anounce enabled" 
         /varset verbose 1 
         } 
      /if (${Param${i}.Equal[noarch]}) { 
         /echo "Auto-Arch macro will not Auto-Arch.. go figure?!?" 
         /varset noarch 1 
         } 
   } 
/next i

:mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage
        /doevents 
      /goto :mainloop 
/return 

Sub Archery 
  /attack off 
  /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}!=1) /ranged 
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage 
/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
      }
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}>150) {
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!"
      /delay 2
   }
    /doevents
    /if (${Target.Distance}<25) /call closecombat
    /if (${Target.ID}!=${targetarray[4]}) /goto :EndAF 
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents 
    /goto :CloserAF 
:EndAF
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
    /if (${snaretoggle}==1) {
      /varset needsnare 1
      /varset immunetosnare 0
   }
    /keypress Num_5 
/return 

Sub closecombat
   /attack on
   :stillclose
            /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) { 
               /attack off
               /delay 5
            /call forage
            /attack on
         } 
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Disarm"]}) /doability "Disarm"
      /if (${Target.Distance}<11 && ${Me.AbilityReady["Kick"]}) /doability "Kick"
      /if (${taunttoggle}==1 && ${Target.Distance}<11 && ${Me.AbilityReady["Taunt"]}) /doability "Taunt"
      /doevents 
      /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) { 
         /call Cast "Ensnare" gem4 
         /varset needsnare 0 
         /doevents
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
      }
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}>150) {
      /popup "Too Far Away For Auto-Snare, GET CLOSER!!"
      /delay 2
   }
    /if (${Target.Distance}<25 && ${Target.ID} && ${Target.ID}==${targetarray[4]} && ${Target.CleanName.NotEqual[${Me.Name}]}) /goto :stillclose
    /attack off
   /return

Sub Event_exp 
   /varset currentxp ${Me.PctExp} 
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]} 
   /varset currentaa ${Me.PctAAExp} 
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]}
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa" 
   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}
/return 

Sub event_eagle
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "Eagle Eye" gem6
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/return

Sub event_haste
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "Eyepatch of Plunder" item
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/return   

Sub event_reroot
      /if (${roottoggle}==1) {
         /target npc id ${targetarray[4]}
         /call Cast "Earthen Roots" gem2
      }
/return

Sub Event_resist 
/doevents
   /if (${snaretoggle}==1 && ${immunetosnare}==0) /varset needsnare 1 
      /return 

Sub Event_Immune
   /if (${snaretoggle}==1) {
      /varset needsnare 0 
      /varset immunetosnare 1
      /if (${verbose}==1) /gsay "Can't snare %t as it is immune"
   }
/return 

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

sub forage
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
   /if (${Me.Ducking}) /stand
   /doability Forage 
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
:waitforage
   /delay 3 
   /doevents
   /if (!${Cursor.ID} && ${waitforage}==0 && ${Me.Skill["Forage"]}==200) /goto :waitforage
   /varset waitforage 0
   /call destroyornot
/return

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

sub destroyornot
   /varset invset ${Ini[ArchForage.ini,ForageList,${Cursor.Name},${notset}]} 
   /delay 3
   /if (${invset}==${notset}) { 
      /ini "ArchForage.ini" "ForageList" "${Cursor.Name}" "1" 
      /varset invset 1 
      } 
   /if (${invset}==1) { 
      :Keep
      /autoinv
      /delay 3 
      /if (${Cursor.ID}) /goto :Keep 
      } else { 
      /destroy 
      } 
/return
LOADING PLEASE WAIT...

User avatar
Tel0net
orc pawn
orc pawn
Posts: 14
Joined: Wed May 05, 2004 1:07 pm
Location: California
Contact:

Post by Tel0net » Tue May 25, 2004 6:21 pm

I don't know what's wrong but...

After I kill my first kill and the exp pops up, and try another kill, the macro no longer works

I do see "Killing a *level* *name*" (level = level, name = name, ovbiously) but it doesnt kick/disarm/snare.

Even worse, when I /endmacro, I crash EQ :(

Edit: I think it's because I changed

"/call Cast "Ensnare" gem4"

to

"/call Cast "Ensnare" gem1"

Because Ensnare is on gem1, do I need to change this? I also removed the events and code for eye patch and eagle eye
MOO goes the Cow and WOOT goes the Tel0net

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue May 25, 2004 6:33 pm

is this when using the "noarch" toggle? I will have to test it later and see what I can see..

The macro has been working flawlessly with all the toggles for me prior to the noarch change.. Also, the noarch change shouldnt have made much of a difference, but I will check it out anyways..

Let me know what toggles you were using.. (verbose snare root whatever?) thx! :)
LOADING PLEASE WAIT...

User avatar
Tel0net
orc pawn
orc pawn
Posts: 14
Joined: Wed May 05, 2004 1:07 pm
Location: California
Contact:

Post by Tel0net » Tue May 25, 2004 6:51 pm

loadingpleasewait wrote:is this when using the "noarch" toggle? I will have to test it later and see what I can see..

The macro has been working flawlessly with all the toggles for me prior to the noarch change.. Also, the noarch change shouldnt have made much of a difference, but I will check it out anyways..

Let me know what toggles you were using.. (verbose snare root whatever?) thx! :)
THis was pre-noarch

I did /macro arch.mac forage snare

It worked on first kill, then died after next, and crashed on /endmacro (to try and restart it).

I'm using the zip before the latest, if it matters.
MOO goes the Cow and WOOT goes the Tel0net

User avatar
Tel0net
orc pawn
orc pawn
Posts: 14
Joined: Wed May 05, 2004 1:07 pm
Location: California
Contact:

Post by Tel0net » Fri May 28, 2004 6:20 pm

Works great now, not sure why

Suggestion:

Make the Disarm/Kick radius farther, I have to be touching the monster for the commands for kick/disarm to go off
MOO goes the Cow and WOOT goes the Tel0net