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

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

Moderator: MacroQuest Developers

Advari
decaying skeleton
decaying skeleton
Posts: 9
Joined: Thu Feb 19, 2004 1:03 pm

CTD'ing now.

Post by Advari » Thu Jun 17, 2004 1:35 pm

As of the latest patch, this macro no longer works, causes CTD instantly upon autoattack.

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

Post by loadingpleasewait » Thu Jun 17, 2004 2:48 pm

Yeah, getting the same thing :( seems the latest zip probably has issues.. /ranged also seems not to work.. Hopefully Lax or one of the devs will be able to pull a magical fix out of their collective posterior..
LOADING PLEASE WAIT...

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

working

Post by Riven » Fri Jun 18, 2004 2:49 pm

well im just got on today to do a little hacking. and long behold my most favorite mac kind does not work now. i can load the mac and it seems to be running but, it wont fire arrows. I sure hope u someone can fix mac for the new zip file. ill go in and see what lax changed to cause the mac to stop working.

User avatar
Tel0net
orc pawn
orc pawn
Posts: 14
Joined: Wed May 05, 2004 1:07 pm
Location: California
Contact:

Post by Tel0net » Fri Jun 18, 2004 6:42 pm

I confirm the crashing
MOO goes the Cow and WOOT goes the Tel0net

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

Post by loadingpleasewait » Fri Jun 18, 2004 11:25 pm

Ok, it appears that the macro is broken with the new calculate function.. there is a workaround that involves editing your MQ2Utilities.cpp You can read about it in this thread:

http://macroquest2.com/phpBB2/viewtopic ... highlight=

I have applied the workaround, and it appears to work. I have NOT checked out all the functions of the macro yet tho..

Its sad, this macro has made playing my ranger so basic and simple, AKA BORING that I've practically stopped playing him, yet when I do, I rely on this macro.. :)
LOADING PLEASE WAIT...

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

checking

Post by Riven » Sat Jun 19, 2004 4:34 pm

well i think i applied the workaround correct , but it still wont fire any arrows. going back to double check my work.

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

Post by loadingpleasewait » Sat Jun 19, 2004 9:44 pm

MACRO UPDATED!

it now works with the latest (June 19th) zip.

ALSO ADDED AUTOASSIST!!
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! = )
The code has been updated in the first post! :)
LOADING PLEASE WAIT...

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

thanks

Post by Riven » Sun Jun 20, 2004 12:24 am

I want to thank the author for the time i has placed into getting the mac working. It is one of the most used macs i have and i love it. I just wish i had more knowlege on the mq2 script and able to just write a mac from scratch. thanks for the up date. was wandering if u could put in the part to goto the target and follow it. kinda like the genbot does im going to work on that part. i have a hunter mac that i updated a while back that usees the what i talk about. once it kills the target it runs back to the anchor if i had it set, or it just moves on to the next kill. this then would make the ranger make almost complete i would think.

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

help

Post by Riven » Sun Jun 20, 2004 4:14 pm

well I have a revison of this mac. It is acting just like the other one did few zips back. It wont auto arch. I have the new zip up and that still didnt fix it. Please go threw it and tell me whats wrong with it. So might learn from my mistake.

Code: Select all

|**
arch.mac Auto-Archery
USAGE:
/mac arch <forage|snare|taunt|root|verbose|noarch> 
Use all, or none, in any order seperated by spaces to do specified action
**|

#include spellcast.inc
#turbo 40
#Event exp 		"#*#experience!#*#"
#Event haste 		"#*#The quickening spirit departs#*#"
#Event eagle 		"#*#The avian presence departs#*#"
#Event resist 		"#*#Your target resisted the tangling weeds spell#*#"
#Event resist 		"#*#Your Tangling weeds spell has worn off#*#"
#Event Snaresuccess 	"#*#movements slow as their feet are covered in tangling weeds#*#"
#Event Immune 		"#*#changes in its run speed#*#"
#Event reroot 		"#*#Your grasping Roots spell has worn off#*#"
#Event reroot 		"#*#Your target resisted the grasping Roots spell#*#"
#Event Casting 		"#*#You begin casting#*#"
#Event waitforage 	"#*#before you can forage#*#"
#Event nohold 		"#*#Your spell did not take hold#*#"
#Event thorns 		"#*#Your skin returns to normal.#*#"
#Event fist		"#*#your hand is extinguished#*#"

Sub Main
   /echo "Auto-Arch Macro has begun."
   /declare i int local
   /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 0
   /declare dottoggle outer 0
   /declare needdot outer 0
   /declare immunetodot outer 0


   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}

/for i 0 to 6
  /if (${Defined[Param${i}]}) {
     /if (${Param${i}.Equal[dot]}) {
         /echo "Auto-Dot enabled"
         /varset dottoggle 1
         /varset needdot 1
         /varset immunetodot 0
         }	
     /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
         }
   }
/next i

:mainloop
   /if (${Me.Combat} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.Name}]}) /call Archery
         /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage
	/if (${Me.AbilityReady[Tracking]}) /doability "tracking"
        /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 (${Me.Combat}) /attack off
	/if (${Target.Distance}>30 && ${Me.RangedReady} && ${noarch}!=1) /ranged
	/delay 2
        /if (${foragetoggle}==1 && ${Me.AbilityReady[Forage]}) /call forage
	/if (${Me.AbilityReady[Tracking]}) /doability "tracking"
	/if (${dottoggle}==1 && ${needdot}==1 && ${Target.PctHPs}<90 && ${Target.Distance}<150) {
         	/call Cast "Stinging Swarm" gem3
         	/varset needdot 0
         	/doevents
        /if (${verbose}==1 && ${immunetodot}==0 && ${needdot}==0) /gsay "%t has successfully been Dotted"
     		 }
    	/if (${dottoggle}==1 && ${needdot}==1 && ${Target.PctHPs}<90 && ${Target.Distance}>150) {
      		/popup "Too Far Away For Auto-Dot, GET CLOSER!!"
      		/delay 2
   		}
	/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) {
         	/call Cast "tangling weeds" gem1
         	/varset needsnare 0
         	/doevents
        /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
     		 }
    	/if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${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
    	/goto :CloserAF
:EndAF
    		/echo a ${targetarray[2]} ${targetarray[1]} is dead
    	/if (${snaretoggle}==1) {
      		/varset needsnare 1
      		/varset immunetosnare 0
   		}
    		/keypress Num_1
		/return

Sub closecombat
   /attack on
   :stillclose
	/if (${Me.AbilityReady[Tracking]}) /doability "tracking"	
        /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 (${dottoggle}==1 && ${needdot}==1 && ${Target.PctHPs}<90 && ${Target.Distance}<150) {
         	/call Cast "Stinging Swarm" gem3
         	/varset needdot 0
      /doevents
        /if (${verbose}==1 && ${immunetoDot}==0 && ${needDot}==0) /gsay "%t has successfully been Dotted"
      		}
    	/if (${dottoggle}==1 && ${needdot}==1 && ${Target.PctHPs}<90 && ${Target.Distance}>150) {
      		/popup "Too Far Away For Auto-dot, GET CLOSER!!"
      /delay 2
   		}
      /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${Target.Distance}<150) {
         /call Cast "tangling weeds" gem1
         /varset needsnare 0
         /doevents
         /if (${verbose}==1 && ${immunetosnare}==0 && ${needsnare}==0) /gsay "%t has successfully been snared"
      }
    /if (${snaretoggle}==1 && ${needsnare}==1 && ${Target.PctHPs}<70 && ${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_eagle
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "hawk Eye" gem6
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/return

Sub event_Fist
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "FireFist" gem5
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/return

Sub event_haste
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "Eyepatch of Plunder" item
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/return   

Sub event_reroot
      /if (${roottoggle}==1) {
         /target npc id ${targetarray[4]}
         /call Cast "grasping Roots" gem2
      }
/return

Sub event_nohold
     /if (${roottoggle}==1) {
         /target npc id ${targetarray[4]}
         /call Cast "grasping Roots" gem2
      }
/return

Sub Event_resist
/doevents
	/if (${dottoggle}==1 && ${immunetodot}==0) /varset needdot 1
   	/if (${snaretoggle}==1 && ${immunetosnare}==0) /varset needsnare 1
      	/return

Sub Event_Immune
	/if (${dottoggle}==1) {
     		/varset needdot 0
      		/varset immunetodot 1
      	/if (${verbose}==1) /gsay "Can't dot %t as it is immune"
   }
   	/if (${snaretoggle}==1) {
      		/varset needsnare 0
      		/varset immunetosnare 1
      		/if (${verbose}==1) /gsay "Can't snare %t as it is immune"
   }
/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
   /doability Forage
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
:waitforage
   /delay 3
   /doevents
   /if (!${Cursor.ID} && ${waitforage}==0 && ${Me.Skill["Forage"]}==200) /goto :waitforage
   /varset waitforage 0
   /call destroyornot
/return

sub Event_waitforage
   /if (${foragetoggle}==1) /varset waitforage 1
/return

Sub event_Thorns
   /if (${Me.Sitting}) {
      /stand
      /varset sitstatus 1
   }
      /call Cast "Barbcoat" gem7
   /if (${sitstatus}==1) {
      /sit
      /varset sitstatus 0
   }
/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

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

fixed

Post by Riven » Sun Jun 20, 2004 6:21 pm

Well after carefull reading, I forgot to add 0's to the /declare statements. It works now. edited my post up above.

student_01
orc pawn
orc pawn
Posts: 17
Joined: Tue Jul 22, 2003 9:22 pm

Post by student_01 » Tue Jun 29, 2004 4:42 pm

First off let me say i realy appreciate the time spent on this great work.Secondly i have a rather noobish question , i made a new macro for the spell casting inc code.Now the macro will not run without that code i think i may have put it in the wrong spot.Do i just add it on to your script is it a plug in or did i do it right by making it a new macro and i am just doing something else wrong?

**edit** when i run the macro it says could not open include ( file path ) spellcast.inc , i have spellcast.inc set up as a macro in the macro folder.

VirusX
orc pawn
orc pawn
Posts: 14
Joined: Sun May 16, 2004 7:52 pm

hmm

Post by VirusX » Tue Jun 29, 2004 6:59 pm

It has to be a .inc file and you cannot use wordpad to edit it only notepad because wordpad formats it as .txt

Take an included .inc file from MQ2-Latest.zip do a copy and past rename it to spellcast.inc edit it with notepad and paste the newest spellcast.inc release code inside and save you should be good to go.

student_01
orc pawn
orc pawn
Posts: 17
Joined: Tue Jul 22, 2003 9:22 pm

Post by student_01 » Tue Jun 29, 2004 7:21 pm

Thank ya master slickness

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Tue Jun 29, 2004 8:29 pm


student_01
orc pawn
orc pawn
Posts: 17
Joined: Tue Jul 22, 2003 9:22 pm

Post by student_01 » Wed Jun 30, 2004 3:56 am

virusx wrote:It has to be a .inc file and you cannot use wordpad to edit it only notepad because wordpad formats it as .txt

Take an included .inc file from MQ2-Latest.zip do a copy and past rename it to spellcast.inc edit it with notepad and paste the newest spellcast.inc release code inside and save you should be good to go.
Ok i am still getting the error saying that it could not open spllcast.inc.This is what i did , i was unable to find any .inc files in mq2 folder.However i did run a system search for any .inc files and did find some , then i used notepad to edit it with the spellcast.inc code.The type of file it is listed as is a "setup information" type file.Did i do this right?
**extra info**Also i don't think this matters but i use a bootleg winxp pro Os and i didnt have notpad.I do have notpad pro though not sure if anyone else uses it or what not it should work the same.