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

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

Moderator: MacroQuest Developers

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Wed Jun 30, 2004 4:49 am

OK to get the include to work open notepad.. make sure word wrap is turned off.

Paste in your desired spellcast.inc info. Hit save file as.. goto your macro folder and put the name you want such as spellcast.inc. MAKE SURE that you have the bottom box (Save as type) set to all files. Hit ok.

Now makes sure at the top part of your macro you have
#include spellcast.inc

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Jun 30, 2004 5:28 am

Did you remember to save it as a .inc file and not a .inc.txt file?
If you didn't change SAVE FILE TYPE to ALL then you saved it as a .txt which won't work.

Riven
a lesser mummy
a lesser mummy
Posts: 68
Joined: Sat Jan 31, 2004 12:14 pm
Location: Missouri

saveing

Post by Riven » Fri Jul 02, 2004 11:19 am

i find it much easier to look at my macks uesing word pad. but when it come to changeing them and saveing i use notepad. much saver for me.

nuceman
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Dec 01, 2002 3:56 pm

Post by nuceman » Thu Jul 08, 2004 3:43 pm

I'm getting this error message when I turn on auto attack to start firing arrows with the latest version of MQ2.

Failed to parse /if condition '(59.21>30 && FALSE && 0!=1_', non-numeric encountered

Just copy pasted the code into a text file and it used to work fine about a month ago when I played my ranger, tried it today and this keeps happening. Any ideas? I've tried butchering out the parts of the code I'm not using and that didn't seem to help.
You can dance if you want to.

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

Post by loadingpleasewait » Thu Jul 08, 2004 6:21 pm

The boards have a bug, you gotta replace all the &lt with < and all the &gt with >... then it should work.. I believe..
Last edited by loadingpleasewait on Wed Aug 18, 2004 10:15 pm, edited 1 time in total.
LOADING PLEASE WAIT...

Jargo
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Jul 08, 2004 7:47 pm

Post by Jargo » Thu Jul 08, 2004 7:48 pm

love the macro! but i can't seem to get the auto assist to turn off.. EVerytime i load the macro it turns on. Quite annoying. Anyway to turn this off? i am not a programer at all. Thanks.

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

Post by loadingpleasewait » Thu Jul 08, 2004 9:22 pm

Right at the top, here:
Sub Main
/assist on
/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 targetarray[4] string outer

/varset startexp ${Me.PctExp}
/varset startaaxp ${Me.PctAAExp}
Just get rid of that Line.. then you can manually set assist on or off..
LOADING PLEASE WAIT...

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Thu Jul 08, 2004 9:34 pm

I was thinking that he meant automatic assist of MT.

nuceman
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Dec 01, 2002 3:56 pm

Post by nuceman » Fri Jul 09, 2004 1:16 am

Thanks loading, I'll try it out.
You can dance if you want to.

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

Post by loadingpleasewait » Fri Jul 09, 2004 1:19 am

The automatic assist of the MT only fires off if you specify "autoassist" as a parameter.. but I personally put an /assist on in the code, so when you assist someone, it turns on autoattack.. some people dont like this.. i believe this is what he was speaking of..
LOADING PLEASE WAIT...

Jargo
decaying skeleton
decaying skeleton
Posts: 2
Joined: Thu Jul 08, 2004 7:47 pm

Post by Jargo » Fri Jul 09, 2004 10:01 am

Thanks a ton! Much appreciated.

A_Random_Noob_005
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Jul 09, 2004 9:13 pm

Post by A_Random_Noob_005 » Fri Jul 09, 2004 9:15 pm

Instead of casting Ensnare, how would you change the code to use the Entrap AA rangers get?

Cage9d9
RTFM, then ask again
Posts: 6
Joined: Sat Dec 20, 2003 1:52 pm

Experience part

Post by Cage9d9 » Mon Jul 19, 2004 10:02 pm

Hey,

I really like how the experience gained etc is displayed on your screen after the closecombat event ends, is there anyway you can make me a small macro where after each time I see "You have gained Experience!" or "You have gained party experience!" /raid as well? Thanks in advance

Cage

Abbadon
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Jul 23, 2004 12:27 pm

Post by Abbadon » Fri Jul 23, 2004 12:56 pm


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

Finally an update.. :D

Post by loadingpleasewait » Wed Aug 18, 2004 10:17 pm

I incorporated Ranjah_Down's lazy ranger mac... besides that, everything else is unchanged..

enjoy

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

#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#*#" 
#Event waitforage "#*#before you can forage#*#"

Sub Main
/assist on

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

/declare j int outer 
/declare MyBuffs[4] 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" 

/declare TargetBuff[5] string outer 
/declare TBuffsName[5] 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] "tunare" 
/varset TargetBuff[3] "Strength of Tunare" 
/varset TBuffsName[4] "sop" 
/varset TargetBuff[4] "Spirit of the Predator" 
/varset TBuffsName[5] "cor" 
/varset TargetBuff[5] "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" 
         /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
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
   /if (${Me.Ducking}) /stand
:waitforage
   /doability Forage 
   /delay 1
   /doevents
   /if (!${Cursor.ID} && ${waitforage}==0 && ${Me.Skill["Forage"]}==200) /goto :waitforage
   /varset waitforage 0
   /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.Equal[${TBuffName[${j}]]}) { 
        /target ${Sender} 
        /delay 2s 
        /call cast ${TargetBuff[${j}] gem6
        /tell ${Sender} inc ${TBuffName[${j}] 
    } 
/next j 

|====[Assist Buffs]======================================== 
/for j 1 to ${AssistBuff.Size} 
    /if (${ChatText.Equal[${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 Thu Aug 19, 2004 11:27 pm, edited 1 time in total.
LOADING PLEASE WAIT...