Page 1 of 1

Ranger Auto Archery w/ snare

Posted: Wed May 05, 2004 4:22 pm
by kasodo
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]

Posted: Wed May 05, 2004 10:11 pm
by Wink-
You misspelled ensnare in your events, easy fix tho :)

Updated

Posted: Tue May 11, 2004 1:21 pm
by kasodo
Changed events and my spelling of ensnare. Anyone tried this mac? No feedback hehe.

Posted: Sat May 15, 2004 7:26 pm
by loadingpleasewait
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.

Posted: Sun May 16, 2004 6:36 pm
by amml
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 :)

Parsing error

Posted: Mon Aug 02, 2004 1:58 am
by nbjeter3
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..

Posted: Mon Aug 02, 2004 2:11 am
by magictiger
*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 

Posted: Fri Aug 06, 2004 6:36 pm
by soulsedge
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 

Posted: Fri Aug 06, 2004 8:24 pm
by loadingpleasewait
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.)