Also need to make sure that there is enough pauses in this..
And as for as the anchor is concerned.. I want the anchor to be set when the macro is started.. after that the anchor does not change.. just he goes get the mob and comes back to anchor.. faces the mob and killes it..
here is current code
Code: Select all
| Rangerautopull.mac
| Writen by Omper
#chat tell
#include spellcast.inc
#event GotHIT "Hit You For"
/declare AnchorX float outer
/declare AnchorY float outer
/declare startpoint int outer //Is this your start of an anchor? If so not needed
Sub Main
/echo Rangerautopull.mac
/varset AnchorX ${Me.X}
/varset AnchorY ${Me.Y}
/cleanup
/doevents
/call Tarnpc
/pause 10 // hope this is 10 seconds.. not sure
/return
Sub Tarnpc //were is this called from??
/target npc radius 150
/call Cast "ensnare
/return
Sub Event_GOTHIT
/attack on
: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 fXLoc ${Me.X}
/varset fYLoc ${Me.Y}
/varset iCount 0
/echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}.
:AnchorMoveLoop
/delay 1
/doevents
/face nolook loc ${AnchorY},${AnchorX}
/if (${Math.Distance[${AnchorY},${AnchorX}]}>12) {
/keypress forward hold
} else {
/keypress forward
/return
}
/if (${iCount}>2) {
/call Detectobst
/face nolook loc ${AnchorY},${AnchorX}
/varset iCount 0
}
/varcalc iCount ${iCount}+1
/goto :AnchorMoveLoop
/return
Sub Detectobst
/delay 2
/if (${fXLoc}==${Me.X}) /if (${fYLoc}==${Me.Y}) /call Hitobst
/varset fXLoc ${Me.X}
/varset fYLoc ${Me.Y}
/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
/returnOmper

