This macro was written designed and tested and retested for my main character, a 5.4K hp unbuffed necro with lots of regen, FT, AA's focus effects, the works. So please, oh god please test this macro before running it

Pre-macro:
Run all the way to the camp following the red line. You don't want to go the other way. You don't wand to mess with a train of casters and trying to FD off the aggro, its not worth the aggrevation. Invus up, follow the top path and FD at number "2." If you stop at number "2" correctly and wait for any aggro to FD off you can get up and make a pet and buff up right there without any aggro.
Once you get a pet and self buff, lich, clickies whatever, Look around to see if there is an enchanter mob as oftentimes there is, and they haste the mobs likewhoa. Pull the mob labeled 1 with a dot or annul magic if there was a chanter. 1 and 2 will come/start casting on you. You should annul both mobs as they are inc if there was a chanter around, cause even though the mobs hit for like 150, hasted...2 mobs beating on you interupts almost anything.(and I have all AA's, stun resists etc) its pretty brutal. After they are dead immediatly(cause you want to time it right) pull the mob labeled "3". ONly 3 and 4 shoudl come. Kill them, then kill number 5, then start the macro
The macro:
Each time you kill a mob and the macro loops to the top you will move to the gray number "1" It checks if there are a spawn within a reasonable radius from you and kills everything else(kills the repops). First it casts horror(doens't recast if it doens't land), darkness, kiss BoT, than Mujakis. You'll quickly notice how unnessesary all these dots are, but you want them dead before the next one spawns and whent he next one spawns the dots will kill it np. After it dies it will loot the corpse and search for the wand and destroy everything else. So if you want the inscribible words, well you are goign to change to do some minor changes to the lootnpc(Loot) subroutine.
wand.mac:
Code: Select all
| Wand.mac
| This macro camps the wand of imperceptibility
|
| Suggested Spell line up. This macro uses all spells except for Death Peace.
| 1. Touch of Mujaki
| 2. Horror
| 3. Blood of Thule
| 4. Saryrn's Kiss
| 5. Embracing Darkness
| 6. Sheild of Maelin
| 7. Seduction of Saryn.
| 8. Death Peace
|
#Event exp "#*#experience!#*#"
|#Event Horror "#*#screams in abject terror.#*#"
#Event Kiss "#*#Fresh blood flows through#*#"
#Event Darkness "#*#is engulfed in an embracing darkness#*#"
#Event BoT "#*#veins turn a vile shade of green."
#Event pethaste "Your pet's Rune of Death#*#"
#Event pethaste "Your pet's Plagued T#*#"
#Event NoSnare "Your target is immune to changes in its run speed."
#Event GettingHit "#*#hits YOU for#*#"
#Event tell "#*#tells you, '#*#"
#include necro.inc
#include move.inc
#include travel.inc
Sub Main
/deletevar Darkness
/deletevar Kiss
/deletevar Horror
/deletevar BoT
/deletevar death
/deletevar NoSnare
/deletevar Distance
/deletevar CurrentTargetName
/declare death int global
/declare Horror int global
/declare Darkness int global
/declare Kiss int global
/declare BoT int global
/declare NoSnare int Global
/declare Distance int Global
/declare CurrentTargetName string Global
|-- Set Max Distance
/varset Distance 70
|--------------
|-- Set Home Point
/call MoveToLoc -288.78 2343.59
|--------------
/lfg off
/afk
/echo Running Wand.mac
|DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
:Top
/if (${Me.State.Equal["STAND"]}) {
/delay 1s
/if (${Me.Moving}) /goto :Top
/sit
}
/varset Horror 0
/varset Darkness 0
/varset Kiss 0
/varset BoT 0
/varset death 0
/varset NoSnare 0
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight}) {
/target ${Spawn[npc Radius ${Distance}]}
/if (${String[${Target}].Find["NULL"]}) /goto :Top
/varset CurrentTargetName ${Target}
/goto :Fight
}
/call DidJaDie
/call khf
/call lich
/call shielding
/call GMCheck
/doevents
/delay 1
/goto :Top
|DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
|JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJL
:Fight
/if (!${Me.State.Equal["STAND"]}) /stand
/if (!${Me.Combat}) /attack on
/call Horror
/call Darkness
/call Kiss
/call BoT
/call Mujaki
/goto :Top
|JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJL
/return
|==============================================
Sub Horror
:Horror
/if (!${Me.State.Equal["STAND"]}) /stand
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight} && ${String[${Spawn[npc]}].Find[${CurrentTargetName}]}) {
/target ${CurrentTargetName}
} else {
/return
}
/face fast
/pet attack
/cast "Horror"
/delay 2
/cast "Horror"
/delay 2
/cast "Horror"
/delay 2
/cast "Horror"
/call DidJaDie
/call LoH
/return
|==============================
Sub Darkness
:Darkness
/doevents exp
/if (${death}==1) /return
/if (!${Me.State.Equal["STAND"]}) /stand
/doevents NoSnare
/if (${NoSnare}==1) /return
/if (!${Me.Combat}) /attack on
/if (!${Me.SpellReady["Embracing Darkness"]}) /goto :Darkness
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight} && ${String[${Spawn[npc]}].Find[${CurrentTargetName}]}) {
/target ${CurrentTargetName}
} else {
/return
}
/face fast
/cast "Embracing Darkness"
/delay 2
/cast "Embracing Darkness"
/delay 2
/cast "Embracing Darkness"
/delay 2
/cast "Embracing Darkness"
/call DidJaDie
/call LoH
:DarknessSubLoop
/doevents Darkness
/if (!${Me.SpellReady["Saryrn's Kiss"]}) /goto :DarknessSubLoop
/if (${Darkness}==1) {
/return
} else {
/goto :Darkness
}
/return
|===============================
Sub Kiss
:Kiss
/doevents exp
/if (${death}==1) /return
/if (!${Me.State.Equal["STAND"]}) /stand
/if (!${Me.Combat}) /attack on
/if (!${Me.SpellReady["Saryrn's Kiss"]}) /goto :Kiss
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight} && ${String[${Spawn[npc]}].Find[${CurrentTargetName}]}) {
/target ${CurrentTargetName}
} else {
/return
}
/face fast
/cast "Saryrn's Kiss"
/delay 2
/cast "Saryrn's Kiss"
/delay 2
/cast "Saryrn's Kiss"
/delay 2
/cast "Saryrn's Kiss"
/delay 2
/call DidJaDie
/call LoH
:KissSubLoop
/doevents Kiss
/if (!${Me.SpellReady["Blood of Thule"]}) /goto :KissSubLoop
/if (${Kiss}==1) {
/return
} else {
/goto :Kiss
}
/return
|===================================
Sub BoT
:BoT
/doevents exp
/if (${death}==1) /return
/if (!${Me.State.Equal["STAND"]}) /stand
/if (!${Me.Combat}) /attack on
/if (!${Me.SpellReady["Blood of Thule"]}) /goto :BoT
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight} && ${String[${Spawn[npc]}].Find[${CurrentTargetName}]}) {
/target ${CurrentTargetName}
} else {
/return
}
/face fast
/cast "Blood of Thule"
/delay 2
/cast "Blood of Thule"
/delay 2
/cast "Blood of Thule"
/delay 2
/cast "Blood of Thule"
/delay 2
/call DidJaDie
/call LoH
:BoTSubLoop
/doevents BoT
/if (!${Me.SpellReady["Touch of Mujaki"]}) /goto :BoTSubLoop
/if (${BoT}==1) {
/return
} else {
/goto :BoT
}
/return
|======================================
Sub Mujaki
:Mujaki
/if (!${Me.Combat}) /attack on
/face
/call DidJaDie
/if (!${Me.State.Equal["STAND"]}) /stand
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight} && ${String[${Spawn[npc]}].Find[${CurrentTargetName}]}) /target ${CurrentTargetName}
/doevents exp
/if (${death}==0) {
/if (!${Me.SpellReady["Touch of Mujaki"]}) /goto :Mujaki
/if (${Me.PctHPs}>92) /goto :Mujaki
/face fast
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/call DidJaDie
/call LoH
/goto :Mujaki
} else /if (${death}==1) {
/return
} else {
/echo if you see this something is bugged
}
/return
|===========================================
Sub Event_Horror
/varset Horror 1
/echo Horror Landed
/return
|===========================================
Sub Event_BoT
/varset BoT 1
/echo BoT Landed
/return
|===========================================
Sub Event_Kiss
/varset Kiss 1
/echo Kiss Landed
/return
|===========================================
Sub Event_NoSnare
/varset NoSnare 1
/echo Not Snareable, skipping Snare
/return
|===========================================
Sub Event_Darkness
/varset Darkness 1
/echo Darkness Landed
/itemnotify legs rightmouseup
/return
|===========================================
Sub Event_exp
/echo You killed a mob
/if (${Me.Combat}) /attack off
/pet back off
/pet hold
/call LootMob "Wand of Imperceptibility"
/call MoveToLoc -288.78 2343.59
/varset death 1
/return
|===========================================
Sub Event_pethaste
/call PetHaste
/return
|========================================
Sub DidJaDie
/if (${String[${Zone.ShortName}].Find["Tranquility"]}>0) {
/echo You died, WTG Ass Hole. . .
/quit
/endmacro
}
/return
|=======================================
Sub LoH
:Mujaki
/doevents exp
/if (${death}==1) /return
/if (!${Me.State.Equal["STAND"]}) /stand
/if (${Me.PctHPs}<=60) {
/if (${String[${Target}].Find["NULL"]}>0) /goto :Mujaki
/if (${Spawn[npc Radius ${Distance}].ID} && ${Spawn[npc Radius ${Distance}].LineOfSight}) {
/target ${Spawn[npc Radius ${Distance}]}
} else {
/return
}
/if (!${Me.SpellReady["Touch of Mujaki"]}) /goto :Mujaki
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/cast "Touch of Mujaki"
/delay 2
/if (${Me.PctHPs}>60) /return
/goto :Mujaki
} else {
/return
}
/return
|===================================================
Sub Event_tell(line)
/if (${String[${line}].Find[${Spawn[${Me}].Pet.CleanName}]}) /return
/sound 3
/returnCode: Select all
Sub PetHaste
/echo Hasteing Pet, don't move
/exchange "Vorshar's Pants of the Blight" Legs
/delay 5
/itemnotify legs rightmouseup
/delay 90
/exchange "Miragul's Greaves of Risen Souls" Legs
/return
Sub khf
/if (${Me.Buff["Koadic's Heightened Focus"].Duration}<60) {
/keypress forward
/declare CurrentChest string local
/varset CurrentChest ${Me.Inventory["Chest"]}
/if (!${String[${Me.Inventory["Chest"]}].Find["Koadic"]}) /exchange "Koadic's Robe of Heightened Focus" chest
/delay 2
/itemnotify chest rightmouseup
/if (!${String[${CurrentChest}].Find["Koadic"]}) {
/delay 70
/exchange "${CurrentChest}" chest
}
}
/return
Sub lich
/if (${Me.Buff["Seduction of Saryrn"].Duration}<60) /cast "Seduction of Saryrn"
/return
Sub shielding
/if (${Me.Buff["Shield of Maelin"].Duration}<60) /cast "Shield of Maelin"
/return
Sub MakePet
/echo Making a pet, don't move
/declare spell5 string local
/declare spell6 string local
/declare i int local
/varset spell5 ${Me.Gem[5]}
/varset spell6 ${Me.Gem[6]}
/sit
/memspell 5 "Tiny Companion"
/delay 5
:TinyLoop
/if (${String[${Me.Gem["Tiny Companion"]}].Find["Null"]}) /goto :TinyLoop
/memspell 6 "Child of Bertoxxulous"
/delay 5
:CoBLoop
/if (${String[${Me.Gem["Child of Bertoxxulous"]}].Find["Null"]}) /goto :CoBLoop
/stand
/delay 2
/keypress esc
/if (!${String[${Me.Inventory[Hands]}].Find["Gloves of Dark Summoning"]}) /exchange "Gloves of Dark Summoning" Hands
/delay 2
:WaitForCoB
/if (!${Me.SpellReady["Child of Bertoxxulous"]}) /goto :WaitForCoB
:2
/if (${Me.Moving}) /goto :2
/stand
/cast "Child of Bertoxxulous"
/delay 5
:22
/delay 5
/if (!${Me.SpellReady["Tiny Companion"]}) /goto :22
/if (!${String[${Me.Inventory[Hands]}].Find["Miragul's Gloves of Risen Souls"]}) /exchange "Miragul's Gloves of Risen Souls" Hands
/delay 2
/keypress esc
/pet back off
/pet hold
/for i 1 to 2
:3
/if (${Me.Moving}) /goto :3
/if (!${Me.SpellReady["Tiny Companion"]}) /goto :3
/stand
/cast "Tiny Companion"
/delay 5
/next i
:ready3
/if (!${Me.SpellReady["Tiny Companion"]}) /goto :ready3
/sit
/memspell 5 "${spell5}"
/delay 35
/memspell 6 "${spell6}"
/delay 35
/stand
/call PetHaste
/echo Pet Made...hopefully
/return
Sub DMFSomeone
/echo DMFing Someone
/declare PersonToDMF string local
/varset PersonToDMF ${MacroQuest.LastTell}
:ReTarget
/target ${PersonToDMF}
/delay 2
/if (${Target.Type.Equal["NPC"]}) /goto :ReTarget
/if (${Target.Distance}>190) {
/delay 2s
/tell ${PersonToDMF} OOR
/return
}
/if (${Me.SpellReady["Dead Man Floating"]}) {
/cast "Dead Man Floating"
/delay 3
/cast "Dead Man Floating"
/delay 3
/cast "Dead Man Floating"
/delay 4s
/tell ${PersonToDMF} inc DMF
/delay 2s
} else /if (${Me.SpellReady["Dead Men Floating"]}) {
/cast "Dead Men Floating"
/delay 3
/cast "Dead Men Floating"
/delay 3
/cast "Dead Men Floating"
/delay 4s
/tell ${PersonToDMF} inc DMF
/delay 2s
} else {
/declare spell7 string local
/varset spell7 ${Me.Gem[7]}
/memspell 7 "Dead Man Floating"
/delay 10s
:WaitForDMFToPop
/delay 2
/if (!${Me.SpellReady["Dead Man Floating"]}) /goto :WaitForDMFToPop
/cast "Dead Man Floating"
/delay 3
/cast "Dead Man Floating"
/delay 3
/cast "Dead Man Floating"
/delay 4s
/tell ${PersonToDMF} inc DMF
/delay 2s
/memspell 7 "${spell7}"
/delay 35
}
/return
This is the parts of my all inclusive giant include file that I use in my macros. These are just the parts that you need(hopefully):
Code: Select all
|============================
sub LootMob(Loot)
| Note: the number 4.3 in the /varset MoveDelay was empirically
| set for IRS5 ( Speed = 150 )
/declare MoveDelay int local
/declare LootSlot int local 1
/keypress ESC
/keypress ESC
/keypress ESC
/keypress ESC
/timed 150 /stand
/timed 155 /notify LootWnd DoneButton leftmouseup
:Top
/target corpse
/delay 4
/if (!${Target.ID}) /goto :Top
/if (${Target.Distance}<15) {
/face fast
} else /if (${Target.Distance}>=15 && ${Target.Distance}<120) {
/face fast
/keypress forward hold
/varset MoveDelay ${Math.Calc[(${Target.Distance})/4.3]}
/keypress forward hold
/delay ${MoveDelay}
/keypress forward
/goto :Top
} else {
/echo Corpse is too far away
/keypress ESC
/return
}
/echo Looking for "${Loot}"
/loot
/delay 2
/loot
/delay 2
/loot
/delay 3
/if (!${Window[LootWnd].Open}) /goto :Top
:lootloop
/if (${Me.State.Equal["STAND"]}) /goto :doneloot
/if (${Corpse.Items}==0) {
/goto :doneloot
}
/if (${LootSlot}>=32) /goto :doneloot
:Loot
/itemnotify Loot${LootSlot} leftmouseup
/delay 1s
/if (${Window[ConfirmationDialogBox].Open}) {
/notify ConfirmationDialogBox Yes_Button leftmouseup
/delay 1s
}
/if (${String[${Cursor.Name}].Find[${Loot}]}) {
/echo YOU WIN: ${Cursor.Name}
/autoinv
/delay 2
|/call FindWand
} else {
/if (${Cursor.Value}>5000 || ${Cursor.Tribute}>500) {
/echo ${Cursor.Name} is worth more than 5pp or tribute is greater than 500
/autoinv
/delay 5
} else {
/echo Destroying ${Cursor}
/destroy
/delay 5
}
}
/varcalc LootSlot ${LootSlot}+1
/goto :lootloop
:doneloot
/notify LootWnd DoneButton leftmouseup
/varset LootSlot 0
/return|=================================================
Sub GMCheck
/if (${Spawn[gm].ID}) {
/keypress forward
/keypress back
:FD
/delay 5
/cast "Death Peace"
/if (!${Me.SpellReady["Death Peace"]}) /goto :FD
/if (!${Me.State.Equal[FEIGN]}) /goto :FD
/afk Be back later, leave a message
/echo GM in the zone
/endmacro
}
/return
|=======================================================
Sub FindWand
/call MoveToLoc -248.04 2268.98
/beep
/keypress forward
/keypress back
:FD
/delay 5
/cast "Death Peace"
/if (!${Me.SpellReady["Death Peace"]}) /goto :FD
/if (!${Me.State.Equal[FEIGN]}) /goto :FD
/afk Be back later, leave a message
/echo You found your loot!
/beep
/delay 5
/beep
/delay 5
/beep
/delay 5
/beep
/delay 5
/beep
/delay 5
/beep
/delay 5
/beep
/delay 5
/quit
/endmacro
/return
|===========================================================
Just for moving you back to the gray #1 when you kill a mob:
Code: Select all
|
| move.inc
|
|Advanced moving and object-avoidance routines
|
|Originally by beatnik007 (Who credits Mckorr)
|
|Revised and converted to MQ2Data by Terramantian
|
|Signifagant and on-going Improvments by EQBot_Man 8.9.04
| Added /call MoveToSpawnName
| This will take a partial name and a distance and reliably target and move
| to the nearest spawn of that name
| Added code to get you to stop a lot closer than 10 units. You should stop almost
| right at the location you want when using MoveToLoc
| Sometimes you would get stuck at a door and if you were macroing unattended
| you would continue to strafe for hours making it obvious you were
| macroing. Added code that if the strafe function is called more
| than 10 times in 60 sec to /quit you out
| Have added lots of little checks including NULL targets and corpse checks and a lot
| of little things that I can't remember now but I needed to add due to rare
| circumstances of the subroutines failing to do what they were desigend to do.
|
| Subroutines:
| Sub MoveToLoc
| Moves you to a specified xy loc
| Sub MoveToSpawn
| Moved you to a specified ID number(pretty pointless)
| Sub MoveToSpawnName
| Moves you to the nearest spawn given a partial or full name
|
|===================================================|
| Sub MoveToLoc |
|---------------------------------------------------|
|This simply moves the player to within 1 unit of |
|the requested location, while avoiding obstacles |
| |
|This is beatnik007's original sub, with a few minor|
|changes and rewritten in MQ2Data format |
| |
|SYNTAX: /call MoveToLoc Y X |
Sub MoveToLoc(MoveToY, MoveToX)
/echo Moving to Location: ${MoveToY}, ${MoveToX}.
/echo Distance: ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/declare FailureTimer timer local 0
/declare StrafeFailure int local
/declare running int local
/declare MaxSpeed int local
/declare StopDistance int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/varset running 0
/declare distanceTimer timer 15
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/varset MaxSpeed 0
:moveToLocation
/if (${Me.Speed}>=${MaxSpeed}) /varset MaxSpeed ${Me.Speed}
/if (${MaxSpeed}<=166) {
/varset StopDistance 3
} else {
/varset StopDistance 10
}
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/if (${FailureTimer}==0) {
/varset StrafeFailure 0
/varset FailureTimer 600
}
/if (${FailureTimer}>0) {
/varset StrafeFailure ${Math.Calc[${StrafeFailure} + 1]}
}
/if (${StrafeFailure}>=10 && ${FailureTimer}>0) {
/keypress forward
/keypress back hold
/delay 5
/keypress back
/afk Be back later, leave a message
/echo Your movement failed more than 10 times in 30 seconds and most likely looked macroed. Ending macro. . .
/endmacro
/quit
}
/call strafePastObstacle ${StrafeFailure}
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>${StopDistance}) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<${StopDistance}) {
/varset running 0
/keypress forward
}
}
/goto :moveToLocation
/return
| Sub MoveToSpawn |
|---------------------------------------------------|
|This moves the player to within a provided distance|
|of the provided spawn, while avoiding obstacles |
| |
|I "wrote" this, but as you can see, it's the same |
|as MoveToLoc with a few variable replacements. |
| |
|The second parameter, Distance, allows for the |
|player to stop short of the target by a certain |
|amount, to provide for different aggro radii, etc. |
| |
|SYNTAX: /call MoveToSpawn ID Distance |
Sub MoveToSpawn(MoveToID, StopDistance)
/if (!(${Defined[MoveToID]})||(${Spawn[MoveToID].ID})) {
/echo Spawn ID not found or no ID provided. Aborting...
/return
}
/if (!(${Defined[StopDistance]})) {
/echo Stopping point not defined, using default distance of 70
/declare StopDistance int local
/varset StopDistance 70
}
/echo Moving to Spawn: ${MoveToID} (${Spawn[${MoveToID}].CleanName}).
/echo Current Location: ${Spawn[${MoveToID}].Y}, ${Spawn[${MoveToID}].X}
/echo Current Distance: ${Spawn[${MoveToID}].Distance}
/declare FailureTimer timer local 0
/declare StrafeFailure int local
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/varset running 0
/declare distanceTimer timer 15
/varset distanceBefore ${Spawn[${MoveToID}].Distance}
/varset distanceModifier 1
:moveToSpawn
/squelch /face fast nolook id ${MoveToID}
/if (${Spawn[${MoveToID}].Distance}<${StopDistance}) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Spawn[${MoveToID}].Distance}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/if (${FailureTimer}==0) {
/varset StrafeFailure 0
/varset FailureTimer 600
}
/if (${FailureTimer}>0) {
/varset StrafeFailure ${Math.Calc[${StrafeFailure} + 1]}
}
/if (${StrafeFailure}>=10 && ${FailureTimer}>0) {
/keypress forward
/keypress back hold
/delay 5
/keypress back
/sit
/afk Be back later, leave a message
/echo Your movement failed more than 10 times in 30 seconds and most likely looked macroed. Ending macro. . .
/endmacro
/quit
}
/call strafePastObstacle ${StrafeFailure}
}
/varset distanceBefore ${Spawn[${MoveToID}].Distance}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Spawn[${MoveToID}].Distance}>=${StopDistance}) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Spawn[${MoveToID}].Distance}<${StopDistance}) {
/varset running 0
/keypress forward
}
}
/goto :moveToSpawn
/return
| Sub MoveToSpawnName |
|---------------------------------------------------|
|This moves the player to within a provided distance|
|of the provided spawn, while avoiding obstacles |
| |
|I "wrote" this, but as you can see, it's the same |
|as MoveToLoc with a few variable replacements. |
| |
|The second parameter, Distance, allows for the |
|player to stop short of the target by a certain |
|amount, to provide for different aggro radii, or to|
|attack. |
| |
|SYNTAX: /call MoveToSpawnName Name Distance |
| Does take partial names: |
| /call MoveToSpawnName skel 9 |
| to move you to the nearest skeleton |
| |
| I use this for farming bone chips and silks |
Sub MoveToSpawnName(Name, StopDistance)
/keypress esc
/target ${Name} npc
/delay 2
/if (${String[${Target}].Find["NULL"]}) /return
/if (${String[${Target}].Find["corpse"]}) /return
/if (!${Target.ID}) {
/echo Name not found or no name provided. Aborting...
/return
}
/if (!(${Defined[StopDistance]})) {
/echo Stopping point not defined, using default distance of 70
/declare StopDistance int local
/varset StopDistance 70
}
/echo Moving to Spawn: ${Target.CleanName}.
/declare FailureTimer timer local 0
/declare StrafeFailure int local
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/varset running 0
/declare distanceTimer timer 15
/varset distanceBefore ${Target.Distance}
/varset distanceModifier 1
:moveToSpawn
/if (${String[${Target}].Find["NULL"]}) /return
/face fast predict
/if (${Target.Distance}<${StopDistance}) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Target.Distance}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/if (${FailureTimer}==0) {
/varset StrafeFailure 0
/varset FailureTimer 600
}
/if (${FailureTimer}>0) {
/varset StrafeFailure ${Math.Calc[${StrafeFailure} + 1]}
}
/if (${StrafeFailure}>=10 && ${FailureTimer}>0) {
/keypress forward
/keypress back hold
/delay 5
/keypress back
/sit
/afk Be back later, leave a message
/echo Your movement failed more than 10 times in 30 seconds and most likely looked macroed. Ending macro. . .
/endmacro
/quit
}
/call strafePastObstacle ${StrafeFailure}
}
/varset distanceBefore ${Target.Distance}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Target.Distance}>=${StopDistance}) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Target.Distance}<${StopDistance}) {
/varset running 0
/keypress forward
}
}
/goto :moveToSpawn
/return
| Only to be used by the previous functions - It's obvious what it does. |
sub strafePastObstacle(Number)
/keypress forward
/keypress back hold
/delay ${Math.Calc[${Number}*3/2+4]}
/keypress back
/if (!${Me.State.Equal["STAND"]}) /stand
/if (${Math.Rand[99]}>50) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay ${Math.Calc[${Number}*4+5]}
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return
Sub Turn(THeadingY,THeadingX)
/declare PHeading outer 0
/declare THeading outer 0
/declare Bearing outer 0
/declare IsTurning outer 0
/declare TurnKey outer NULL
:TurnLoop
/delay 0
/if (${Me.Sitting}) /sit off
/varset PHeading ${Me.Heading.Degrees}
/if (${Defined[THeadingX]}) {
/varset THeading ${Heading[${THeadingY},${THeadingX}].Degrees}
} else {
/varset THeading ${Target.HeadingTo.Degrees}
}
/varset Bearing ${Math.Calc[(${PHeading}-${THeading}+540)%360-180]}
/if (${Bearing}>=-7 && ${Bearing}<=7) {
/if (${String[${TurnKey}].NotEqual[NULL]}) /keypress ${TurnKey}
/face heading ${Heading[${THeading}].Degrees} nolook
/return
} else /if (${Bearing}>=-180 && ${Bearing}>=7) {
/if (${String[${TurnKey}].NotEqual[LEFT]}) /varset TurnKey LEFT
} else /if (${Bearing}<=180 && ${Bearing}<=7) {
/if (${String[${TurnKey}].NotEqual[RIGHT]}) /varset TurnKey RIGHT
}
/if (!${IsTurning}) {
/keypress ${TurnKey} hold
/varset IsTurning 1
}
/goto :TurnLoop
/return



