Auto Archery (Thats it!)

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

Moderator: MacroQuest Developers

hytiek
Contributing Member
Contributing Member
Posts: 54
Joined: Mon Jun 14, 2004 5:45 pm

Auto Archery (Thats it!)

Post by hytiek » Sat Aug 28, 2004 3:50 pm

Friend of mine wanted a quick and easy auto-archery macro to use during raids. This is only to press the button for you and that's it. Enjoy War & Peace and your raid.

Code: Select all

#Event exp "#*#experience!#*#" 

Sub Main
:autofire
   /doevents
   /if (${Target.Distance}>30 && ${Me.RangedReady}) {
      /face
      /ranged 
   /goto :autofire
/return

Sub Event_exp 
   /end
/return

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

Post by hiipii » Sun Aug 29, 2004 3:32 am

Good work :D

khozik
orc pawn
orc pawn
Posts: 28
Joined: Fri Oct 10, 2003 1:42 pm

Post by khozik » Sun Aug 29, 2004 6:52 pm

Mostly stolen from the EQ-botman :)

So this would basically assist your main tank and autofire until mob is dead, then repeat.
usage: /Macro ranger <Start Health> <Tank Name>

if you do:
/macro ranger 90

Then basically /assist ${tank} becaomes /assist NULL (doesn't do anything) so you can make an assist key and manually assist like the original macro
Not too great I guess but I couldn't help but make it just a little lazier for raids :) Wrote it as work, untested!

Code: Select all

#Event exp "#*#experience!#*#" 
#Event mezbreak "#*#awakened by ${Me}." 

Sub Main 

/deletevar ShootHealth 
/deletevar tank
 
/declare ShootHealth int global 
/declare tank string global 

/varset ShootHealth ${Param0} 
/varset tank ${Param1} 

/assist off

:MainLoop 
   /call shoot
   /doevents 
   /delay 5 
/goto :MainLoop 

/return

|Assist tank, make sure target is not a corpse or an NPC
|make sure its health is not greater than shoothealth then
|face the mob and shoot it
Sub shoot 
 /assist ${tank} 
 /delay 5
 /if (${String[${Target}].Find["corpse"]}>0) /return 
 /if (!${Target.Type.Equal["NPC"]}) /return 
 /if (!${Target.PctHPs}<=${ShootHealth}) /return

 /if (${Target.Distance}>30 && ${Me.RangedReady}) { 
      /face 
      /ranged
 }
/return 

Sub Event_mezbreak 
 /echo Nice Job!
 /endmacro 
/return 

skyler
a snow griffon
a snow griffon
Posts: 311
Joined: Wed May 11, 2005 9:22 am

Post by skyler » Mon Jun 13, 2005 8:42 pm

Got bored and didn't see any ranger macs using the /autofire, which I've found to be a lot more damage then /ranged. I've also left in my auto snare. This takes 2 param's, assist name and heal %, and will constanly assist the assist name and then start firing at the % you tell it. Hard coded snare to start casting at 75%, and easy change if anyone cared.

Code: Select all

|usage: /Macro ranger <Start Health> <Tank Name>
#include spell_routines.inc


#Event Zoned           "#*#You have entered#*#" 
#Event AutofireOn      "#*#Auto fire on#*#" 
#Event AutofireOff     "#*#Auto fire off#*#" 
#Event Exp             "#*#You gain#*#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#*#"

Sub Main 
/deletevar TargetHealth
/deletevar Assist

/declare TargetHealth int global
/declare Assist string global
/declare auto_fire int outer 0
/declare IsSnared int outer 0

/varset TargetHealth ${Param0}
/varset Assist ${Param1}

:MainLoop 
	/doevents
	/call Archery
	/delay 5 
	/goto :MainLoop 
	/return 

Sub Archery
	/assist ${Assist}
	/delay 3
	/if (${Target.Type.NotEqual[NPC]}) {
		/if (${auto_fire}==1) /autofire
		/return
	}
	/if (${Target.PctHPs}<=${TargetHealth} && ${Target.Distance}>30) {
		/face
		/if (${auto_fire}==0) /autofire
		/call Snare
	}
	/return
	
Sub Snare
	/if (${IsSnared}==0 && ${Target.PctHPs}<=75) /call Cast "Ensnare" gem1
	/return

Sub Event_Zoned 
	/echo Zoned...Autofire is off
	/varset auto_fire 0 
	/varset IsSnared 0
	/return 

Sub Event_AutofireOn 
	/echo Autofire activated! Target: ${Target.CleanName} 
	/varset auto_fire 1 
	/return 

Sub Event_AutofireOff
	/echo Autofire deactivated!
	/varset auto_fire 0 
	/return 

Sub Event_Exp
	/varset auto_fire 0
	/varset IsSnared 0
	/return

Sub Event_resist
	/return

Sub Event_Snaresuccess
	/g ${Target.CleanName} snared
	/varset IsSnared 1
	/return

Sub Event_Immune
	/echo ${Target.CleanName} snare immune
	/varset IsSnared 1
	/return

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Mon Jun 13, 2005 9:39 pm

You could do a spawn check and make sure the MA is in zone, it would reduce chat spam complaining about not being able to assist anybody.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

skyler
a snow griffon
a snow griffon
Posts: 311
Joined: Wed May 11, 2005 9:22 am

Post by skyler » Tue Jun 14, 2005 7:37 am

There's a lot I can/will do with this. I only posted this under khozik because I used his as my base and I liked how simple his was. I'm not really all that familar with the how-to of writting a macro yet so I'm just trying to start small. At the same time I don't feel like putting too much of my time into something like this where there are already 3 other ranger macro's that I'm sure would get more attention.