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

Post by loadingpleasewait » Thu Aug 19, 2004 10:22 pm

Fixxed wee little issue with the added Lazy Ranger arrays..
LOADING PLEASE WAIT...

User avatar
Dinstag8tor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Aug 23, 2004 9:15 am

Post by Dinstag8tor » Mon Aug 23, 2004 9:31 am

Everytime I run it (the LazyRanger version) with options or without (or any combo) I get the following: (Grabbed code from first post)

Unparsable in calculation: '$'
arch.mac@324 (LazyRanger): /if (!$!{MeBuff[$Me.Buffs[${i}}}].ID) {
arch.mac@157 (Main): /call LazyRanger
The current macro has ended
Failed to parse /if condition '(!$!{Me.Buff["Eagle Eye"].ID), non-numeric encountered.

This is driving me up the wall sicne this looks like the macro I've been waiting for for a long ass time.

Help plz.
Last edited by Dinstag8tor on Mon Aug 23, 2004 2:24 pm, edited 1 time in total.

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Mon Aug 23, 2004 12:50 pm

Code: Select all

(!$!{MeBuff[$Me.Buffs[${i}}}].ID
That line looks funny... I've never seen !$!{ before. I think it should probably be !${

User avatar
Dinstag8tor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Aug 23, 2004 9:15 am

Post by Dinstag8tor » Mon Aug 23, 2004 2:22 pm

yea it does

looks like its crashing on this section of code:

/for j 1 to ${MyBuffs.Size}
/if (!${Me.Buff[${MyBuffs[${j}]}].ID) {
/target ${Me}
/call Cast ${MyBuffs[${j}]} gem6

Is this correct?

Neith
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 23, 2004 10:18 pm

I think its just missing a }

Post by Neith » Mon Aug 23, 2004 10:20 pm

I think its just missing a }

Code: Select all

  /if (!${Me.Buff[${MyBuffs[${j}]}].ID}) {  

Neith
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 23, 2004 10:18 pm

Post by Neith » Mon Aug 23, 2004 10:30 pm

If anyone has any ideas why i keep on foraging NULL's and it says I need to wait longer before I can forage I would love to hear em :lol:

User avatar
Dinstag8tor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Aug 23, 2004 9:15 am

Re: I think its just missing a }

Post by Dinstag8tor » Mon Aug 23, 2004 10:45 pm

Neith wrote:I think its just missing a }

Code: Select all

  /if (!${Me.Buff[${MyBuffs[${j}]}].ID}) {  
Well that didnt work -- this time it ends in:

Failed to parse /if condition '(2381>0), non-numeric encountered

Damn!

Neith
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 23, 2004 10:18 pm

Post by Neith » Mon Aug 23, 2004 11:10 pm

Need to replace all your less then grater then signs i think.

User avatar
Dinstag8tor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Aug 23, 2004 9:15 am

Post by Dinstag8tor » Tue Aug 24, 2004 7:51 am

tried that - if you mean:

The brackets are fubared for old posts.

You must change < to < and > to >.

did that on both this macro and spellcast.inc - this one didnt need it. I dont even think it has reached the spellcast.inc yet.

/sigh

Neith
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 23, 2004 10:18 pm

Post by Neith » Tue Aug 24, 2004 3:10 pm

Here is the version I am currently useing that works for me including fixes to the foraging and the auto buffing.

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. 
**|

User avatar
Dinstag8tor
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Aug 23, 2004 9:15 am

Post by Dinstag8tor » Wed Aug 25, 2004 2:12 am

TY

It works well for me now!!!!

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

Post by loadingpleasewait » Thu Aug 26, 2004 7:18 pm

Thanks for the update neith.. I have been AFK for a while.. sorry for the troubles..

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

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

OLD POST!! Find Latest Here:
http://macroquest2.com/phpBB2/viewtopic.php?t=9338
Last edited by loadingpleasewait on Sun Sep 19, 2004 12:44 pm, edited 2 times in total.
LOADING PLEASE WAIT...

3djoker
a hill giant
a hill giant
Posts: 167
Joined: Thu Jun 24, 2004 11:19 pm

Post by 3djoker » Tue Aug 31, 2004 9:49 pm

what in the code would i change to make it cast lower lvl spells?

Neith
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Aug 23, 2004 10:18 pm

Post by Neith » Tue Aug 31, 2004 11:52 pm

you would modify these lines to self buff with different spells.

Code: Select all

/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" 

FrankJScott
naggy
naggy
Posts: 2128
Joined: Sun Feb 19, 2023 7:11 am

Top Rated Product Blog

Post by FrankJScott » Tue Jan 30, 2024 10:42 pm

Please try Google before asking about Top Product Info 1b86b3c