!UPDATED!
OLD POST!! Find Latest Here:
http://macroquest2.com/phpBB2/viewtopic.php?t=9338
September 07, 2004
Just posting the fixxed version that Neith has so kindly provided. Thanks..
August 18, 2004
Updated to incorporate 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: updated to make foraging work a little more reliably, also added check for mobs immune to snare so it doesnt keep casting over and over... etc... fixxed the forage looping issue when you would have to wait longer to forage..
updated to add auto taunt code
updated to add auto-reroot code and cleaned up parameters :)
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
**|
#chat group
#chat tell
#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#*#"
Sub Main
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Lazy Ranger Macro by Rajah_Down
| Incorporation begins here with
| The Array changes done by zanomo
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/declare j int outer
/declare MyBuffs[5] 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"
/varset MyBuffs[5] "Cry of Thunder"
/declare TargetBuff[4] string outer
/declare TBuffsName[4] 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] " sop "
/varset TargetBuff[3] "Spirit of the Predator"
/varset TBuffsName[4] " cor "
/varset TargetBuff[4] "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"
/assist on
/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
/delay 3s
/if (${Me.Sitting}) {
/stand
/varset sitstatus 1
}
/if (${Me.Ducking}) /stand
:WaitLoop
/if (${Me.Casting.ID}) {
/delay 1
/goto :WaitLoop
} else {
/doability Forage
/delay 2s
/doevents
}
/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.Find[${TBuffsName[${j}]}]}) {
/target ${Sender}
/delay 2s
/call cast ${TargetBuff[${j}]} gem6
/tell ${Sender} inc ${TBuffsName[${j}]}
}
/next j
|====[Assist Buffs]========================================
/for j 1 to ${AssistBuff.Size}
/if (${ChatText.Find[${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.
**|

