Credits go out to:
Omper as I used his code and fixed it to work for the pulling section
Loadingpleasewait and Kasodo For The Autoarcher section
and the makers of Genbot whom I nabbed a few lines of code from to combine the two and streamline the code a bit.
Big props go out To My Ranger And Tank Buddies Who, at risk of Life and limb and Exp, Tested it Out for Me!
****Disclaimer**** This is my first attempt at something Complicated like this so it may still be a lil buggy. Lemme know how it works for you.
now Onto the good stuff the CODE!
Code: Select all
| Rangerautopull.mac v1.0
|Uses Files Spellcast.inc, and Arch.inc
|Usage: /mac rangerautopull Park Ranger behind The tank, Start Macro And Enjoy! Tank has 7 Seconds To Get Aggro
|Once You Get back To Your anchor point! Otherwise You Will Assist On Yourself And Send it into an Endloess
|Loop of "You cannot assist on Yourself!"
|Originally Writen by Omper, fixed and modded by nbjeter3
#chat tell
#include spellcast.inc
#include Arch.inc
#event GotHIT "Hit You For"
Sub Main
/declare AnchorLoc string outer 0
/declare FLoc string outer 0
/declare GoToLoc string outer 0
/declare startpoint int outer
/echo Rangerautopull.mac
/varset AnchorLoc ${Me.Y},${Me.X}
/cleanup
/doevents
/call MoveToAnchor
/delay 10
/call Tarnpc
/return
Sub Tarnpc
/target npc radius 500
/face
/call MoveToTarget
/call Cast "Ensnare"
/call MoveToanchor
/delay 100
/assist
/delay 20
/call Archer Snare Autoassist
/call Main
/return
Sub Event_GOTHIT
/call MoveToAnchor
:Loop
/if (${Target.Distance}>20) {
/keypress forward
}
/if (${Target.Distance}<10) {
/keypress back hold
/timed 1 /keypress back
}
/face nolook fast
/delay 0
/if (!${Target.ID}) {
/goto :End
} else {
/goto :Loop
}
:End
/call MoveToAnchor
/return
Sub MoveToAnchor
/declare iCount int local
/varset FLoc ${Me.Y},${Me.X}
/varset iCount 0
/echo Moving to Anchor at Loc: ${AnchorLoc}.
:AnchorMoveLoop
/delay 1
/doevents
/face nolook loc ${AnchorLoc}
/if (${Math.Distance[${AnchorLoc}]}>12) {
/keypress forward hold
} else {
/keypress forward
/return
}
/if (${iCount}>2) {
/call Detectobst
/face nolook loc ${AnchorLoc}
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :AnchorMoveLoop
/return
Sub MoveToTarget
/declare iCount int local
| /varset GoToLoc ${Me.Y},${Me.X}
| /varset iCount 0
/echo Moving to mob, Hope I Don't Die.
:TargetMoveLoop
/delay 1
/doevents
/face
/if (${Target.Distance}>175) {
/keypress forward hold
} else {
/keypress forward
/return
}
/if (${iCount}>2) {
/call Detectobst
/face
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :TargetMoveLoop
/return
Sub Detectobst
/delay 2
| /if (${FLoc}==${Me.Y},${Me.X}) /call Hitobst
| /varset FLoc ${Me.Y},${Me.X}
/return
Sub Hitobst
/keypress forward
/keypress back hold
/if (${Math.Rand[2]}) {
/delay 2s
/keypress back
/keypress right hold
/delay 8
/keypress right
/delay 2s
/keypress back
/keypress left hold
/delay 8
/keypress left
}
/delay 10
/keypress forward hold
/return

