CTD'ing now.
Posted: Thu Jun 17, 2004 1:35 pm
As of the latest patch, this macro no longer works, causes CTD instantly upon autoattack.
Need to talk about MacroQuest to other MacroQuest users?
https://mq64.org/phpBB3/
The code has been updated in the first post! :)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! = )
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
}
/returnOk 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?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.