Ranger Auto Archery w/ snare

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

Moderator: MacroQuest Developers

kasodo
a lesser mummy
a lesser mummy
Posts: 64
Joined: Fri Feb 13, 2004 9:41 am

Ranger Auto Archery w/ snare

Post by kasodo » Wed May 05, 2004 4:22 pm

MQ2Datavarized and MQ2Data Compliant

COMMENT out the Orange code to remove snare I didnt feel like putting the code to pass it a value in command line.

Don't forget to change the red code to suit your rangers specific spells. if you dont have nalots patch remove completely.. Enjoy I did take this code from an old mac, however dont remember who to give credit to.

EDIT: Fixed some formatting sorry...

May 11 - UPDATED Events. Blech... also added new check for ranged ready then fires.

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 
| 
| 
|If the case happens where arrows are poofing, you can auto melee as |well 
|just turn auto attack (For the second time) back on, and run up to yer |target 
|the macro will now auto kick and auto disarm. 
| 
| 
|Fire the macro off with a forage variable and it will autoforage
| example:  /macro arch.mac forage 
| 
|the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS
|the macro will recast the spell "falcon eye"                  CHANGE THIS 
|although not reliably, it will not detect fizzles, interupts, or stuns. 
| 
|It will display the experience gain as an echo and popup. 
|
| REQUIREMENT Spellcast.inc for reliable spell casting
|
| Modified by Kasodo May 5, 2004 updated to MQ2Data /MQ2Datavars
| Autosnare at 70%
| usage /mac arch <Forage>;  enter forage if you want to auto forage


#include spellcast.inc
#turbo 20 
#Event exp "#*#experience!#*#" 
#Event resist "Your target resisted the Ensare spell#*#"
[color=orange]#Event resist "Your Ensnare spell has worn off."[/color]

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

   /varcalc startexp ${Me.PctExp} 
   /varcalc startaaxp ${Me.PctAAExp}
   /varset needsnare 1
 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   } 
      :mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage
            /delay 20 
            /if (${Cursor.ID}) /autoinv
         }
[color=red]   /if (!${Me.Buff[Falcon Eye].ID}) /call Cast "Falcon Eye" gem8
   /if (!${Me.Buff[Captain Nalots Quickening].ID}) /call Cast "Eyepatch of Plunder" item [/color]        
        /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 (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage
            /delay 20 
            /if (${Cursor.ID}) /autoinv
         }
[color=orange]  /if (${needsnare}==1 && ${Target.PctHPs}<70) {
      /call Cast "Ensnare" gem8
      /varset needsnare 0
     } [/color]  
    /doevents 
    /if (!${Target.ID}) /goto :EndAF 
     /doevents
    [color=red]/if (${Me.RangeAttackReady}) /ranged[/color]
    /goto :CloserAF 
/return 

:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead
[color=orange]    /varset needsnare 1 [/color]
    /keypress Num_5 
/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: ${currentxp}% xp - ${currentaa}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${currentxp}% xp - ${currentaa}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/return 

[color=orange]Sub Event_resist
   /varset needsnare 1
/return[/color]
Last edited by kasodo on Mon Aug 02, 2004 1:36 pm, edited 6 times in total.
<Oid> You know whats sad
<Oid> here soon, lax will log in
<Oid> and go "You fucking idiots!"
* Lax has joined #macroquest
* ChanServ sets mode: +o Lax
...
<Lax> you fucking idiots!

Wink-
a ghoul
a ghoul
Posts: 122
Joined: Tue Apr 27, 2004 2:41 pm

Post by Wink- » Wed May 05, 2004 10:11 pm

You misspelled ensnare in your events, easy fix tho :)

kasodo
a lesser mummy
a lesser mummy
Posts: 64
Joined: Fri Feb 13, 2004 9:41 am

Updated

Post by kasodo » Tue May 11, 2004 1:21 pm

Changed events and my spelling of ensnare. Anyone tried this mac? No feedback hehe.
<Oid> You know whats sad
<Oid> here soon, lax will log in
<Oid> and go "You fucking idiots!"
* Lax has joined #macroquest
* ChanServ sets mode: +o Lax
...
<Lax> you fucking idiots!

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

Post by loadingpleasewait » Sat May 15, 2004 7:26 pm

First of all, Thanks.. I've been away from my computer for a month and just got back. With all the changes, I was dreading updating this again.. You saved me a buncha work. Havnt tried it yet, but I plan on it.
LOADING PLEASE WAIT...

amml
a lesser mummy
a lesser mummy
Posts: 68
Joined: Thu Apr 22, 2004 4:55 pm

Post by amml » Sun May 16, 2004 6:36 pm

thx that is just perfect if you have two pc's and just using your second ranger to make some dps without having to check him all the time, lets me fix on the main hehe :)

nbjeter3
a lesser mummy
a lesser mummy
Posts: 39
Joined: Wed Jan 21, 2004 12:18 am

Parsing error

Post by nbjeter3 » Mon Aug 02, 2004 1:58 am

Does Anyone know What the &gt is for? Cuz everytime i Get A Macro That has ti in it Somewhere It always Get parsing Errors On the Line With The &gt in it..
Don't hate Me cuz I'm beautiful.. I Can give you MUCH better reasons Than That....

Noone Likes A necro... till Mid-battle And They're OOM..

magictiger
a snow griffon
a snow griffon
Posts: 450
Joined: Sun Mar 21, 2004 2:24 pm

Post by magictiger » Mon Aug 02, 2004 2:11 am

*sigh*
We've been over this before in so many different places.
> is >
< is <
You have to do a find->replace for them and replace them all.

Example:
Find: >
Replace: >

For those who are too fucking lazy to take 30 seconds and do it themselves:

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
|
|
|If the case happens where arrows are poofing, you can auto melee as |well
|just turn auto attack (For the second time) back on, and run up to yer |target
|the macro will now auto kick and auto disarm.
|
|
|Fire the macro off with a forage variable and it will autoforage
| example:  /macro arch.mac forage
|
|the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS
|the macro will recast the spell "falcon eye"                  CHANGE THIS
|although not reliably, it will not detect fizzles, interupts, or stuns.
|
|It will display the experience gain as an echo and popup.
|
| REQUIREMENT Spellcast.inc for reliable spell casting
|
| Modified by Kasodo May 5, 2004 updated to MQ2Data /MQ2Datavars
| Autosnare at 70%
| usage /mac arch <Forage>  enter forage if you want to auto forage


#include spellcast.inc
#turbo 20
#Event exp "#*#experience!#*#"
#Event resist "Your target resisted the Ensare spell#*#"
#Event resist "Your Ensnare spell has worn off."

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

   /varcalc startexp ${Me.PctExp}
   /varcalc startaaxp ${Me.PctAAExp}
   /varset needsnare 1
 
/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) {
   /echo "Auto-Forage enabled"
   }
      :mainloop
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery
         /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) {
            /doability Forage
            /delay 20
            /if (${Cursor.ID}) /autoinv
         }
   /if (!${Me.Buff[Falcon Eye].ID}) /call Cast "Falcon Eye" gem8
   /if (!${Me.Buff[Captain Nalots Quickening].ID}) /call Cast "Eyepatch of Plunder" item        
        /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 (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) {
            /doability Forage
            /delay 20
            /if (${Cursor.ID}) /autoinv
         }
  /if (${needsnare}==1 && ${Target.PctHPs}<70) {
      /call Cast "Ensnare" gem8
      /varset needsnare 0
     }  
    /doevents
    /if (!${Target.ID}) /goto :EndAF
     /doevents
    /if (${Me.RangeAttackReady}) /ranged
    /goto :CloserAF
/return

:EndAF
    /echo a ${targetarray[2]} ${targetarray[1]} is dead
    /varset needsnare 1
    /keypress Num_5
/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: ${currentxp}% xp - ${currentaa}% aa"
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${currentxp}% xp - ${currentaa}% aa"
   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}
/return

Sub Event_resist
   /varset needsnare 1
/return 

soulsedge
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Aug 06, 2004 6:32 pm

Post by soulsedge » Fri Aug 06, 2004 6:36 pm

Doesn't seem to be working for me after my editing(never tried before).

It echo's attacking so and so....and then i just kinda sit there doing nothing.

I don't want to cast any spells or anything, and i did a search for the spellcast.inc, but have no clue where to put it. I get 5,000 results and i don't have the time, nor the patience to pick thru them all and find what to do.

I simply want Auto-Archery on target. No special gimmicks, no forage, no nothing. Just simple auto-archery. I tried commenting out what the guy said, and whatever looked like a spell line command to me. *sigh* But no go on it. hehe

Any ideas, wtf i'm doing wrong? i R N00b =) heh

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 
| 
| 
|If the case happens where arrows are poofing, you can auto melee as |well 
|just turn auto attack (For the second time) back on, and run up to yer |target 
|the macro will now auto kick and auto disarm. 
| 
| 
|Fire the macro off with a forage variable and it will autoforage 
| example:  /macro arch.mac forage 
| 
|the macro will recast self haste of "eyepatch of plunder"     CHANGE THIS 
|the macro will recast the spell "falcon eye"                  CHANGE THIS 
|although not reliably, it will not detect fizzles, interupts, or stuns. 
| 
|It will display the experience gain as an echo and popup. 
| 
| REQUIREMENT Spellcast.inc for reliable spell casting 
| 
| Modified by Kasodo May 5, 2004 updated to MQ2Data /MQ2Datavars 
| Autosnare at 70% 
| usage /mac arch <Forage>  enter forage if you want to auto forage 


|#include spellcast.inc 
#turbo 20 
#Event exp "#*#experience!#*#" 
#Event resist "Your target resisted the Ensare spell#*#" 
|#Event resist "Your Ensnare spell has worn off." 

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

   /varcalc startexp ${Me.PctExp} 
   /varcalc startaaxp ${Me.PctAAExp} 
 |  /varset needsnare 1 
  
/if (${Defined[Param0]} && ${String[${Param0}].Equal[forage]}) { 
   /echo "Auto-Forage enabled" 
   } 
      :mainloop 
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery 
         /if (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
 |  /if (!${Me.Buff[Eagle Eye].ID}) /call Cast "Eagle Eye" gem8 
 |  /if (!${Me.Buff[Captain Nalots Quickening].ID}) /call Cast "Eyepatch of Plunder" item        
        /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 (${String[${Param0}].Equal[forage]} && ${Me.AbilityReady[Forage]}) { 
            /doability Forage 
            /delay 20 
            /if (${Cursor.ID}) /autoinv 
         } 
 | /if (${needsnare}==1 && ${Target.PctHPs}<70) { 
 |     /call Cast "Ensnare" gem8 
 |     /varset needsnare 0 
 |    }  
 |   /doevents 
 |   /if (!${Target.ID}) /goto :EndAF 
 |    /doevents 
 |   /if (${Me.RangeAttackReady}) /ranged 
    /goto :CloserAF 
/return 

:EndAF 
    /echo a ${targetarray[2]} ${targetarray[1]} is dead 
|    /varset needsnare 1 
    /keypress Num_5 
/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: ${currentxp}% xp - ${currentaa}% aa" 
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${currentxp}% xp - ${currentaa}% aa" 
   /varset startexp ${Me.PctExp} 
   /varset startaaxp ${Me.PctAAExp} 
/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 Aug 06, 2004 8:24 pm

First thing, yer not using the newest version which lets you choose if you want to snare or not.. You can find it in this http://macroquest2.com/phpBB2/viewtopic.php?t=7308 thread...

But if you insist on using this OLD version, why did you commont out the

Code: Select all

|   /if (!${Target.ID}) /goto :EndAF 
 |    /doevents 
 |   /if (${Me.RangeAttackReady}) /ranged 
??


That line is what makes it do the archery... Un comment it and it should work..

Although, I suggest using the newest version.. (even tho its actually rather old as well.)
LOADING PLEASE WAIT...