autopuller question

boocher13

Lifetimer
Joined
Jan 18, 2007
Messages
69
Reaction score
0
Points
0
I'm using a version of autopull.mac i got from the forums and the problem I'm having is no matter how big I set the initial pull radius,after a few pulls and the near mobs are cleared my puller wont continue to pull the farther away mobs.If I manually move the toon closer it acquires the target and will autopull from there.Also could someone help me with where I would add a line to the macro to use bellow instead of running all the way to the mob .Here is the veresion I'm using .
Code:
| AuoPull Macro 
| autopull.mac 
| Author      : robdawg :Ripped by liaohowie
| Version     : 1.0 2009-10-11
| Useage      : /mac autopull 120 

|------------------------------------------------------------------------------------ 

#turbo 10 
#Event Zoned "LOADING, PLEASE WAIT..." 

Sub Main 

   |------------------------------------------------------------ 
   |How far would you like to target a mob? 
   |------------------------------------------------------------ 
   /declare RV_MaxRadius        int outer  ${Param0}
   |------------------------------------------------------------ 
   |How far is the fast movement range? 
   |------------------------------------------------------------ 
   /declare RV_FastRange        int outer  10
   |------------------------------------------------------------ 
   |How far is the maximum combat range? 
   |------------------------------------------------------------ 
   /declare RV_RangeMax         int outer  5
   |------------------------------------------------------------ 
   |How far is the minimum combat range? 
   |------------------------------------------------------------ 
   /declare RV_RangeMin         int outer  8
   |------------------------------------------------------------ 
   |What is the minimum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MinZRange        int outer  -1000
   |------------------------------------------------------------ 
   |What is the maximum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MaxZRange        int outer  450 
   |------------------------------------------------------------ 
   |Variables that you don't need to worry about. 
   |------------------------------------------------------------ 
   /declare RV_MyTargetID       int outer  0 
   /declare RV_MyTargetName     string outer 
   /declare RV_InvalidTargetID  int outer  0 
   /declare RV_HasTarget        int outer  0 
   /declare RV_RandomWait       int outer  0 
   /declare RV_CheckLook        int outer  0 
   /declare RV_Fighting         int outer  0 
   /declare RV_MyXLOC           int outer  0 
   /declare RV_MyYLOC           int outer  0 
   /declare RV_ObstacleCount    int outer  0 
   /declare RV_hitcount         int outer  0 
   /declare RV_healcheck        int outer  0 
   /declare RT_MyXLOC           int outer  ${Me.X} 
   /declare RT_MyyLOC           int outer  ${Me.Y} 

   /declare lastevent string outer None 
   /declare i int outer 
   /declare ialias string outer None 
   /declare bouncenum int outer 1 

/echo -------------------------------------------
/echo  AutoPull v1.0-by Liaohowie
/echo -------------------------------------------
/echo  AutoPull Range = ${RV_MaxRadius}
/echo -------------------------------------------


   :Start 
      /doevents 
      /call GMCheck 
      /if (!${RV_HasTarget}) /call GetTarget 
      /if (${RV_HasTarget}) /call Pull 
      /if (${RV_HasTarget}) /call CombatSub 
      /call ResetSub 
      /call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
      /hidecorpse all
      /goto :Start 
/return 


|-------------------------------------------------------------------------------- 
|SUB: GM Check 
|-------------------------------------------------------------------------------- 
Sub GMCheck 
   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      /echo GM has entered the zone! 
      /echo FUCK HIM but ending the macro... 
      /keypress forward 
      /keypress back 
      /quit 
      /endmacro 
   } 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Aquire Target 
|-------------------------------------------------------------------------------- 
Sub GetTarget 
   /doevents 
   /declare SpawnTimer         int local 
   /declare RV_CurrentRadius   int local 
   /declare RV_TargetSub       int local 
   /echo Looking for Close Range Mobs 
   :Acquire 
      /doevents 
      /for RV_CurrentRadius 100 to ${RV_MaxRadius} step 5 
      /squelch /target radius ${RV_CurrentRadius} npc
      /varset RV_MyTargetID ${Target.ID} 
      /if (${Target.ID}) {
         /if (!${Target.Type.Equal[NPC]} || ${Target.Type.Equal[Corpse]} || ${Target.Distance} > ${RV_MaxRadius}) { 
            /echo Target is not a NPC or too far, picking another... 
            /squelch /target clear
            /goto :Acquire 
         }  
         /if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
            /echo Mob is BELOW Min Z Range, picking another... 
            /varset RV_InvalidTargetID ${Target.ID} 
            /call ResetSub 
            /goto :Acquire 
         } 
         /if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
            /echo Mob is ABOVE Max Z Range, picking another... 
            /varset RV_InvalidTargetID ${Target.ID} 
            /call ResetSub 
            /goto :Acquire 
         } 
         /varset RV_HasTarget 1 
         /varset RV_MyTargetName ${Target.Name} 
         /echo Acquired ${Target.Name} at range ${Int[${Target.Distance}]} 
         /return 
      } 
      /next RV_CurrentRadius 
      /goto :Acquire 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Pull 
|-------------------------------------------------------------------------------- 
Sub Pull 
   /doevents 
   /echo Pulling Mob 
   /declare TargDist float local 
   :PullLoop 
      /doevents 
      /if (!${Me.Combat} && ${Target.LineOfSight}) /attack on
      /call MoveToMob 
      /if (!${Target.ID}) /return 
      /face fast 
      /if (${Target.PctHPs}==100) /goto :PullLoop 
      /if (${Target.PctHPs}<21) /return 
      /call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC} 
      /if (!${Target.ID}) /return 
      /face fast 
   :Engage 
      /varset TargDist ${Math.Distance[${Target.Y},${Target.X},0:${Me.Y},${Me.X},0]} 
      /if ( ${TargDist}<30 ) /return 
      /delay 1s 
      /goto :Engage 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Move to Mob 
|-------------------------------------------------------------------------------- 
Sub MoveToMob 
   /doevents 
   /varset RV_MyXLOC ${Int[${Me.X}]} 
   /varset RV_MyYLOC ${Int[${Me.Y}]} 
   /varset RV_ObstacleCount 0    
   :MovementLoop 
      /doevents 
      /if (!${Target.ID}) /return 
      /face fast 
      /varcalc RV_ObstacleCount ${RV_ObstacleCount}+1 
      /if (${Int[${Target.Distance}]}>${RV_FastRange} && ${Me.CombatState.Equal[COMBAT]}) /keypress forward hold 
      /if (${Int[${Target.Distance}]}<${RV_FastRange} && ${Int[${Target.Distance}]}>${RV_RangeMax} && !${Me.CombatState.Equal[COMBAT]}) /keypress forward 
      /if (${Int[${Target.Distance}]}<${RV_RangeMin} || ${Me.CombatState.Equal[COMBAT]}) /keypress back 
      /if (${RV_ObstacleCount}>=15) { 
         /call CheckObstacle 
         /goto :Movementloop 
      } 
      /if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Move To Location 
|-------------------------------------------------------------------------------- 
Sub MoveToLoc(MoveToY, MoveToX) 
   /doevents 
   /declare running int local 
   /declare distanceNow float local 
   /declare distanceBefore float local 
   /declare distanceModifier int local 
   /declare distanceTimer timer 15 
   /varset running 0 
   /varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]} 
   /varset distanceModifier 1 
   /echo Moving to Location: ${MoveToY}, ${MoveToX}. 
   /echo Distance: ${distanceBefore} 
   :moveToLocation 
      /doevents 
      /face fast nolook loc ${MoveToY},${MoveToX} 
      /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) { 
         /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}]}) { 
         /call HitObstacle 
         } 
         /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}]}>10) { 
               /varset running 1 
               /keypress forward hold 
            } 
      } else { 
         /if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) { 
            /varset running 0 
            /keypress forward 
         } 
      } 
      /goto :moveToLocation 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Obstacle Check 
|-------------------------------------------------------------------------------- 
Sub CheckObstacle 
   /doevents 
   /if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle 
   /varset RV_MyXLOC ${Int[${Me.X}]} 
   /varset RV_MyYLOC ${Int[${Me.Y}]} 
   /varset RV_ObstacleCount 0 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Obstacle Avoidance 
|-------------------------------------------------------------------------------- 
Sub HitObstacle 
   /echo Obstacle hit, moving around it... 
   /keypress forward 
   /keypress back hold 
   /delay 3 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
   } else { 
      /keypress strafe_left hold 
   } 
   /delay 5 
   /keypress strafe_right 
   /keypress strafe_left 
   /keypress forward hold 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Combat 
|-------------------------------------------------------------------------------- 
Sub CombatSub 
   /doevents 
   /varset RV_Fighting 1 
   /echo Attacking Mob NOW! 
   :CombatLoop
      /if (${Target.Type.Equal[Corpse]} || ${Target.Type.Equal[PC]}) { 
            /echo Target is not a NPC, picking another... 
            /squelch /target clear
      }
      /if (!${Me.Combat} || ${Target.ID} && !${Target.Type.Equal[Corpse]}) /attack on 
      /if (!${Target.ID} || !${Me.CombatState.Equal[COMBAT]} && ${Target.Type.Equal[Corpse]}) /return
      /call MoveToMob 
      /if (${Target.ID} || ${Me.CombatState.Equal[COMBAT]} && !${Target.Type.Equal[Corpse]}) /goto :CombatLoop 
      /doevents  
/return 

|-------------------------------------------------------------------------------- 
|SUB: Zoned 
|-------------------------------------------------------------------------------- 
Sub Event_Zoned 
  /echo Zoned 
  /delay 60s 
  /quit 
  /endmacro 

|-------------------------------------------------------------------------------- 
|SUB: Reset 
|-------------------------------------------------------------------------------- 
Sub ResetSub 
   /doevents 
   /varset RV_HasTarget 0 
   /varset RV_Fighting 0 
/return
 
Last edited by a moderator: