Auto Puller Macro

Fry

Fry Guy
Joined
Jan 31, 2005
Messages
11,867
Reaction score
589
Points
113
Location
Australia
Website
www.mmobugs.com
This bot will search for targets specifyed by you, run towards the target, attack the target, then bring it back to start point. Attack it then loot. Then start again.

pull.mac

Code:
| Pull Macro 
| Pull.mac 
| Author      : robdawg :Ripped by Jdelpheki :Ripped Again By hakcenter 
| Version     : v3 2004-12-16 5:50pm PST 
| Useage      : /macro pull 
| Description : This macro will run your character around Pulling any mobs. 
|      This is definitely a work in progress and I am sure 
|      someone can think of plenty of upgrades for this. 
| : Ripped section Jdelpheki 
|      Modified for pull to area where Macro is started.  I have been using this 
|      2 level 45's Cleric Running genbot and Warrior running Pull2.  Ran for 4 hours 
|      Max with one cleric death. Needs Throwing weapon or arch support too 
|      Needs Genbot to announce its getting hit or get a new cleric script 
| : Ripped section hakcenter 
|      Pulls Any Mobs within radius (regardless of level) 
|      No Mob Array Required 
|      Looting Added 
|      *Looting -stuck on corpse bug fixed- 
|      Loot Table Array Support 
|      *Puller runs to pull spot after mob looting is finished 
|      *Removed Target Fail Counters 
|      *Checks for mobs every 30seconds, 1second 50radius checks 
|      *Reformated 
|      *On zoning(death whatever), quits everquest 
|      *Added more checks 
| 
|      2004-12-11 
| 
|      Added some squelching, always looking for mobs within range, 5 distance intervals 
|      Jacked Item Coding from Rogue Helper 
|      Fixed UI locking up 
|      Fixed Long Buff Casts 
|      Added Disarm to the Special Combat abilities 
| 
|      2004-12-16 
|      Revamped Close mob checking to 0.1second 100radius squelched 
|      Revamped Item casting to check for local mobs during.. and interupt if mob is near 100radius 
|      Removed mass escaping.. cause its retarded 
|      Fixed cool errors when accidently pushing esc while on a mob 
|      Fixed cool errors when accidently pushing esc while pulling a mob 
|      Added 1second before first item cast, incase item is worn... you get interupted cause its too fast 
| 
|------------------------------------------------------------------------------------ 

#turbo 10 
#Event Slain "#*# slain#*#" 
#Event Zoned "LOADING, PLEASE WAIT..." 
#Event ItemSet "[MQ2] ItemSet#*#" 
#Event ItemBounce "[MQ2] ItemBounce#*#" 
#Event ItemCast "[MQ2] ItemCast#*#" 

Sub Main 

   |------------------------------------------------------------ 
   |How far would you like to target a mob? 
   |------------------------------------------------------------ 
   /declare RV_MaxRadius        int outer  450 
   |------------------------------------------------------------ 
   |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  7 
   |------------------------------------------------------------ 
   |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 
   |------------------------------------------------------------ 
   |Loot Array Information. 
   |------------------------------------------------------------ 
   /call ReadINI PullLoot.ini "${Zone.Name}" Loot 
   /if (!${Defined[RV_LootArray]}) { 
      /echo No Loot Array Created... 
   } 
   |------------------------------------------------------------ 
   |Variables that you don't need to worry about. 
   |------------------------------------------------------------ 
   /declare RV_MyTargetID       int outer  0 
   /declare RV_MyTargetName     string outer 
   /declare RV_MyTargetDead     int outer  0 
   /declare RV_InvalidTargetID  int outer  0 
   /declare RV_HasTarget        int outer  0 
   /declare RV_RandomWait       int outer  0 
   /declare RV_LootSlot         int outer  0 
   /declare RV_CheckLook        int outer  0 
   /declare RV_Fighting         int outer  0 
   /declare RV_TargetDead       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 CheckBuffs int outer 0 
   /declare i int outer 
   /declare ialias string outer None 
   /declare doIclick bool outer FALSE 
   /declare bouncenum int outer 1 
   /declare ibounce string outer None 
   /declare itemspellname string outer None 
   /declare clicktimer timer outer 0 
   /squelch /alias /iset /echo ItemSet 
   /squelch /alias /ibounce /echo ItemBounce 
   /squelch /alias /iclick /echo ItemCast 
    
   /varset CheckBuffs 1 

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

|-------------------------------------------------------------------------------- 
|SUB: Reading from an INI File 
|-------------------------------------------------------------------------------- 
Sub ReadINI(FileName,Loot,ArrayType) 
   /echo Attempting to Read Information from ${FileName}... 
   /declare nValues     int local  1 
   /declare nArray      int local  0 
   /declare KeySet      string local  ${Ini[${FileName}]} 
   /if (${Ini[${FileName},Loot,-1,NO].Equal[NO]}) { 
      /echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro... 
      /delay 1s 
      /return 
   } 
   :CounterLoop 
      /if (${String[${Ini[${FileName},Loot,${ArrayType}${nValues}]}].Equal[null]}) { 
         /varcalc nValues ${nValues}-1 
         /goto :MakeArray 
      } 
      /varcalc nValues ${nValues}+1 
      /goto :CounterLoop 
   :MakeArray 
      /if (!${nValues}) /return 
      /if (${FileName.Equal["PullLoot.ini"]}&&${nValues}>0) { 
         /echo Declaring Loot Array... 
         /declare RV_LootArray[${nValues}]  string outer 
         /declare RV_LootStats[${nValues}]  string outer 
      } 
      /for nArray 1 to ${nValues} 
      /if (${FileName.Equal["PullLoot.ini"]}) { 
         /varset RV_LootArray[${nArray}] ${Ini[${FileName},Loot,${ArrayType}${nArray}]} 
         /varset RV_LootStats[${nArray}] 0 
      } 
      /next nArray 
      /echo Information Read Successfully from ${FileName}... 
      /delay 1s 
/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} 
      /varset RV_MyTargetDead 0 
      /if (${Target.ID}) { 
         /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 
      } 
      /if (${CheckBuffs}>0) { 
         /echo Checking Buffs 
         /call ItemCast 
         /varset CheckBuffs 0 
         /echo Aquiring Long Range Mobs 
      } 
      /next RV_CurrentRadius 
      /goto :Acquire 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Pull 
|-------------------------------------------------------------------------------- 
Sub Pull 
   /doevents 
   /echo Pulling Mob 
   /declare TargDist float local 
   :PullLoop 
      /doevents 
      /if (!${Me.Combat}) /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}) /keypress forward hold 
      /if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) /keypress forward 
      /if (${Int[${Target.Distance}]}<${RV_RangeMin}) /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 
   /varset RV_TargetDead 0 
   /echo Attacking Mob NOW! 
   :CombatLoop 
      /if (!${Me.Combat}) /attack on 
      /if (!${Target.ID}) /return 
      /call MoveToMob 
      /call SpecialIT 
      /if (!${RV_TargetDead}) /goto :CombatLoop 
      /doevents  
/return 

|-------------------------------------------------------------------------------- 
|SUB: Special Combat 
|-------------------------------------------------------------------------------- 
Sub SpecialIt 
   /doevents 
   /declare TempID    int inner  0 
   /if (${Target.Distance}<=17 && ${Me.AbilityReady[Backstab]}) { 
      /doability "Backstab" 
   } 
   /if (${Target.Distance}<=17 && ${Me.AbilityReady[Disarm]}) { 
      /doability "Disarm" 
   } 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Item Buffs 
|-------------------------------------------------------------------------------- 
Sub ItemCast 
   /doevents 
   /declare ItemDelay int inner 0 
   /varset ItemDelay 1 
   /varset i 1 
   :ItemCheckLoop 
      /doevents 
      /varset ialias ${Ini[PullItems.ini].Arg[${i},|]} 
      /if (${ialias.NotEqual[NULL]}) { 
         /if (${Ini[PullItems.ini,${ialias},KeepUp].Equal[FALSE]}) /goto :NextItem 
         /varset bouncenum 1 
         /varset doIclick TRUE 
         :BounceCheckLoop 
            /varset ibounce ${Ini[PullItems.ini,${ialias},BounceOff${bouncenum}]} 
               /if (${ibounce.NotEqual[NULL]}) { 
                  /if (${ibounce.Equal[${Me.Buff[${ibounce}]}]}) /varset doIclick FALSE 
               } else /goto :DoneBounceChecks 
            /varcalc bouncenum ${bouncenum}+1 
            /goto :BounceCheckLoop 
         :DoneBounceChecks 
            /varset itemspellname ${FindItem[${Ini[PullItems.ini,${ialias},FullName]}].Spell} 
            /if (${itemspellname.Equal[${Me.Buff[${itemspellname}]}]}) /varset doIclick FALSE 
            /squelch /target myself 
            /if (${doIclick}) { 
               /if (${ItemDelay}==1) { 
                  /delay 1s 
                  /varset ItemDelay 0 
               } 
            } 
            /if (${doIclick}) /docommand /iclick ${ialias} 
            /if (${clicktimer}) /goto :DoneItemChecks 
         :NextItem 
            /varcalc i ${i}+1 
      } else /goto :DoneItemChecks 
      /goto :ItemCheckLoop 
      :DoneItemChecks 
         /doevents 
         /squelch /target clear 
/return 

Sub Event_ItemSet(string Line) 
   /varset lastevent Event_ItemSet 
   /if (!${Line.Arg[5].Length} || ${Line.Arg[6].Length}) { 
      /if (${verbosity}>=0) /${channel} ** Improper use of /iset 
      /if (${verbosity}>=0) /${channel} -- /iset <itemalias> keepup|nokeepup <"Item Name"> 
      /if (${verbosity}>=0) /${channel} -- For example: 
      /if (${verbosity}>=0) /${channel} -- /iset gobby keepup "Shrunken Goblin Skull Earring" 
      /return 
   } 
   /ini "PullItems.ini" "${Line.Arg[3]}" "FullName" "${Line.Arg[5]}"  
   /ini "PullItems.ini" "${Line.Arg[3]}" "KeepUp" "${If[${Line.Arg[4].Equal[keepup]},TRUE,FALSE]}" 
   /if (${verbosity}>=0) /${channel} ** ${Line.Arg[5]} (KeepUp=${If[${Line.Arg[4].Equal[keepup]},TRUE,FALSE]}) updated in INI! 
/return 

Sub Event_ItemBounce(string Line) 
   /varset lastevent Event_ItemBounce 
   /if (!${Line.Arg[4].Length}) { 
      /if (${verbosity}>=0) /${channel} ** Improper use of /ibounce 
      /if (${verbosity}>=0) /${channel} -- /ibounce <itemalias> "Some Spell Name" 
      /if (${verbosity}>=0) /${channel} -- For example: 
      /if (${verbosity}>=0) /${channel} -- /ibounce gobby "Strength of Tunare" 
      /return 
   } 
   /if (!${Ini[PullItems.ini,${Line.Arg[3]}].Length}) { 
      /if (${verbosity}>=0) /${channel} ** [${Line.Arg[3]}] not in INI file! 
      /return 
   } 
   /declare bindex int local 1 
   :CheckNextKey 
      /if (${Ini[PullItems.ini,${Line.Arg[3]},BounceOff${bindex}].Length}) { 
         /varcalc bindex ${bindex}+1 
         /goto :CheckNextKey 
      } else { 
      /ini "PullItems.ini" "${Line.Arg[3]}" "BounceOff${bindex}" "${Line.Arg[4]}"  
      /if (${verbosity}>=0) /${channel} ** Added "${Line.Arg[4]}" to [${Line.Arg[3]}]'s bounce list 
      } 
/return 

Sub Event_ItemCast(string Line) 
   /varset lastevent Event_ItemCast 
   /if (!${Line.Arg[3].Length}) { 
      /if (${verbosity}>=0) /${channel} ** Improper use of /icast 
      /if (${verbosity}>=0) /${channel} -- /icast <itemalias> 
      /if (${verbosity}>=0) /${channel} -- For example: 
      /if (${verbosity}>=0) /${channel} -- /icast gobby 
      /return 
   } 
   /if (!${Ini[PullItems.ini,${Line.Arg[3]}].Length}) { 
      /if (${verbosity}>=0) /${channel} ** [${Line.Arg[3]}] not in INI file! 
      /return 
   } 
   /declare fullname string local ${Ini[PullItems.ini,${Line.Arg[3]},FullName]} 
   /if (${verbosity}>=1) /${channel} ** Attempting to use: ${fullname} 
   /if (${FindItem[${fullname}].InvSlot.Pack}) { 
      :OpenPack 
         /if (!${Window[${FindItem[${fullname}].InvSlot.Pack.Name}].Open}) { 
            /itemnotify ${FindItem[${fullname}].InvSlot.Pack.Name} rightmouseup 
            /delay 2 
            /goto :OpenPack 
         } 
         /declare camefrom ${FindItem[${fullname}].InvSlot} 
      :GrabItem 
         /if (!${Cursor.ID}) { 
            /itemnotify ${InvSlot[${camefrom}]} leftmouseup 
            /delay 2 
            /goto :GrabItem 
         } 
         /declare clickyID int local ${Cursor.ID} 
         /declare wornat int local ${Cursor.WornSlot[1]} 
      :SwapFirst 
         /if (${Cursor.ID}==${clickyID}) { 
            /itemnotify ${InvSlot[${wornat}]} leftmouseup 
            /delay 2 
            /goto :SwapFirst 
         } 
         /delay 2 
         /if (${verbosity}>=1) /${channel} ** Clicking: ${fullname} 
         /declare previousID ${Cursor.ID} 
         /itemnotify ${InvSlot[${wornat}]} rightmouseup 
      :SwapAgain 
         /if (${Cursor.ID}==${previousID}) { 
            /itemnotify ${InvSlot[${wornat}]} leftmouseup 
            /delay 2 
            /goto :SwapAgain 
         } 
      :PutItBack 
         /if (${Cursor.ID}==${clickyID}) { 
            /itemnotify ${InvSlot[${camefrom}]} leftmouseup 
            /delay 2 
            /goto :PutItBack 
         } 
      :SummonedCheck 
         /if (${Cursor.ID}) { 
            /autoinv 
            /delay 2 
            /goto :SummonedCheck 
         }    
      :ClosePack 
         /if (${Window[${InvSlot[${camefrom}].Pack.Name}].Open}) { 
            /itemnotify ${InvSlot[${camefrom}].Pack.Name} rightmouseup 
         /delay 2 
         /goto :ClosePack 
         } 
   } else { 
   /if (${FindItem[${fullname}].InvSlot}) { 
      /if (${verbosity}>=1) /${channel} ** Clicking: ${fullname} 
      /itemnotify ${FindItem[${fullname}].InvSlot} rightmouseup 
      /delay 2 
   } else { 
   /if (${verbosity}>=0) /${channel} ** "${fullname}" not found! 
      } 
   } 
   :CastLoop 
      /delay 1 
      /squelch /target radius 100 npc 
      /if (${Target.ID}) { 
         /if (${Target.CleanName.Equal[${Me.Name}]}) { 
            /squelch /target clear 
            /goto :CloseMobCheck 
         } 
         /keypress duck 
         /delay 1 
         /keypress duck 
         /delay 1 
         /return 
      } 
   :CloseMobCheck 
      /if (${Me.Casting.ID}) /goto :CastLoop 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Slain 
|-------------------------------------------------------------------------------- 

Sub Event_Slain 
   /varset RV_TargetDead 1 
   /varset RV_Fighting 0 
   /attack off 
   /target clear 
   /keypress forward 
   /keypress back 
   /squelch /target radius 30 corpse 
   /face fast 
   /if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob 
/return 

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

|-------------------------------------------------------------------------------- 
|SUB: Looting 
|-------------------------------------------------------------------------------- 
Sub LootMob 
   /doevents 
   /declare LootSlot    int inner  0 
   /declare LootCheck   int inner  0 
   /declare LootTotal   int inner  0 
   /keypress forward 
   /keypress back 
   /fastdrop on 
   /lootn never 
   /Echo Looting 
   /loot 
   /varset CheckBuffs 1 
   /delay 1s 
   /if (!${Corpse.Items}) { 
      /echo NO LOOT! Cheap Bastard! 
      /notify LootWnd DoneButton leftmouseup 
      /return 
   } else { 
      /varset LootTotal ${Corpse.Items} 
      /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} leftmouseup 
      /delay 1s 
      /if (${RV_LootAllItems}) { 
         /echo Keeping a ${Cursor.Name}... WOOT! 
         /autoinventory 
         /delay 1s 
      } else { 
         /for LootCheck 1 to ${RV_LootArray.Size} 
            /if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) { 
               /echo Keeping a ${Cursor.Name}... WOOT! 
               /varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1 
               /autoinventory 
               /delay 1s 
            } 
         /next LootCheck 
      } 
      /if (${Cursor.ID}) { 
         /echo Destroying a ${Cursor.Name}... 
         /destroy 
         /delay 1s 
      } 
   /next LootSlot 
   /notify LootWnd DoneButton leftmouseup 
   } 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Reset 
|-------------------------------------------------------------------------------- 
Sub ResetSub 
   /doevents 
   /varset RV_HasTarget 0 
   /varset RV_TargetDead 0 
   /varset RV_Fighting 0 
/return

PullLoot.ini

Code:
[Loot] 
Loot1=High Quality 
Loot2=Stone

PullItems.ini



Code:
[ds] 
FullName=Velium Coldain Insignia Ring 
KeepUp=TRUE 
[atk] 
FullName=Shrunken Goblin Skull Earring 
KeepUp=TRUE 
BounceOff1=Spiritual Vigor 
[haste] 
FullName=Stanos' Wicked Gauntlets 
KeepUp=TRUE 
[str] 
FullName=Mrylokar's Vambraces 
KeepUp=TRUE 
[arcane] 
FullName=Stanos' Wicked Breastplate 
KeepUp=TRUE
 
Last edited:
Hi fry

Any chance to get this macro to work with a defined range item aka a bow, or even a spell. this would be a very cool add for this macro

/maxine2
 
Pretty Cool macro Fry, anyway to make it an item to pull with? Also, anyway to define possible aggro spells and what not, if I have my groups tank pull?
 
Talk about a great bump.

Posted: February 4th, 2005. It's just a modified hunter.mac.

To change how you pull you'd have to play with these parts.

Code:
Sub Pull 
   /doevents 
   /echo Pulling Mob 
   /declare TargDist float local 
   :PullLoop 
      /doevents 
      /if (!${Me.Combat}) /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

Code:
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}) /keypress forward hold 
      /if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) /keypress forward 
      /if (${Int[${Target.Distance}]}<${RV_RangeMin}) /keypress back 
      /if (${RV_ObstacleCount}>=15) { 
         /call CheckObstacle 
         /goto :Movementloop 
      } 
      /if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop 
/return

Try changing
Code:
/if (!${Me.Combat}) /attack on

To a ranged attack or an item attack.
 
what about..

...pulling with pet. go out send pet /pet hold back to group and have pet re-engage
 
Awesome macro, I've modified it for some of my own purposes and it works great.


But I'm having a problem. Every once in a while I'll get hung up during MoveToLoc.....or MoveToMob. And I'll just loop endlessly. I have tried to set up some math to have it count to like ten attempts to move around something and then give up. But it has not worked well as of yet. It seems to automatically default to giving up each time. This is my first attempt at trying to figure out declares and math and whatnot in these macros and I can't quite make it work. I rewrote roughly what I did (I'm at work atm)and put the bits that I can't make work correctly in yellow.

At the moment, if I include those bits it the sub will default to the skip....instead of counting to ten and giving up.


I was trying to use some thing like:
Code:
Sub Main
   |------------------------------------------------------------ 
   |How far would you like to target a mob? 
   |------------------------------------------------------------ 
   /declare RV_MaxRadius        int outer  450 
   |------------------------------------------------------------ 
   |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  7 
   |------------------------------------------------------------ 
   |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 
   |------------------------------------------------------------ 
   |Loot Array Information. 
   |------------------------------------------------------------ 
   /call ReadINI PullLoot.ini "${Zone.Name}" Loot 
   /if (!${Defined[RV_LootArray]}) { 
      /echo No Loot Array Created... 
   } 
   |------------------------------------------------------------ 
   |Variables that you don't need to worry about. 
   |------------------------------------------------------------ 
   /declare RV_MyTargetID       int outer  0 
   /declare RV_MyTargetName     string outer 
   /declare RV_MyTargetDead     int outer  0 
   /declare RV_InvalidTargetID  int outer  0 
   /declare RV_HasTarget        int outer  0 
   /declare RV_RandomWait       int outer  0 
   /declare RV_LootSlot         int outer  0 
   /declare RV_CheckLook        int outer  0 
   /declare RV_Fighting         int outer  0 
   /declare RV_TargetDead       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} 
[COLOR="Yellow"]  /declare avoids int outer 0
  /declare attempts int outer 0[/COLOR]

[COLOR="Yellow"]:loop
/varset avoids 0
/varset attempts 0
/call MoveToMob
/call MoveToLoc
/delay 5s
/goto :loop[/COLOR]



|-------------------------------------------------------------------------------- 
|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
[COLOR="Yellow"]      /varcalc attempts ${attempts}+1
      /if (${attempts}>10) {
              /echo gave up
              /return[/COLOR]
              }
      /face fast 
      /varcalc RV_ObstacleCount ${RV_ObstacleCount}+1 
      /if (${Int[${Target.Distance}]}>${RV_FastRange}) /keypress forward hold 
      /if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) /keypress forward 
      /if (${Int[${Target.Distance}]}<${RV_RangeMin}) /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 
[COLOR="Yellow"]      /varcalc avoids ${avoids}+1
      /if (${avoids}>10) {
              /echo gave up
              /return[/COLOR]
              }
      /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
 
Was trying to run this in the Ruins of Illsalin last night. We were camping the Arena area (SW portion of the zone), and After it pulled a couple mobs it kept on targetting a grey mob that does not technically exist. They are on the map as a blank, and the macro reported back saying that it Aquired target NULL.

I tried a few attempts to make it so it would not target them by adding additional parameters into your targeting sub. Things such as:

---Checking to make sure target is an NPC --- this did not stop the macro from targeting them.
---Making sure the target was > lvl 65 --- (the untargetable things were displayed as grey dots on the map, so I figured if i made it exclude targets below a threshold it would work).

Only other idea I'm sitting on right now is to hardcode a level parameter such as /tar npc 70-80 radius 300.

Any ideas on how to make it not target these invisible markers? I'm not sure if they are flavor text or event trackers or what.
 
To Wellspring have you tried just adding a 70-80 parameter to the GetTarget Sub?

Code:
|-------------------------------------------------------------------------------- 
|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 [COLOR="Yellow"]/target npc 65-83 radius ${RV_CurrentRadius}[/COLOR]
      /varset RV_MyTargetID ${Target.ID} 
      /varset RV_MyTargetDead 0 
      /if (${Target.ID}) { 
         /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 
      } 
      /if (${CheckBuffs}>0) { 
         /echo Checking Buffs 
         /call ItemCast 
         /varset CheckBuffs 0 
         /echo Aquiring Long Range Mobs 
      } 
      /next RV_CurrentRadius 
      /goto :Acquire 
/return

Or if most of the mobs are a have some iterations on a name you can do that....like if all the mobs have "a" in the name you could just search for mobs that have a in it...which should exclude a null
 
Try figuring out what the type or race of the invis mobs are, and exclude them. That would be Target.Type or Target.Race.
 
Aye, have MQ tell you what it is in the window.

/echo ${Target.Type}

or /echo ${Target.Race}
 
|1 Coral Warrior| <NPC> loc blahblahblah *UNTARGETABLE*

how can I ignore an npc that doesnt have a name, or how can I specify /tar level range.

/target npc 65-80 only does 80, what is the syntax to specify a range?
 
|1 Coral Warrior| <NPC> loc blahblahblah *UNTARGETABLE*

how can I ignore an npc that doesnt have a name, or how can I specify /tar level range.

/target npc 65-80 only does 80, what is the syntax to specify a range?

/target npc range 65 80

You can also check out the wiki in reference to alert lists.
 
Well...it should be pretty easy to try and target mobs by type, as implied above. Do a quick check by targetting the mob. and typing:
/if (${Target.Race.Equal[Coral] /echo True

If you get a true off of that then just go through and target each of the different races of mobs in your area and add them to the target list in the puller macro. Get the race of each by typing:
/echo ${Target.Race}


I'm guessing that one of the races is drachnid. Another may be gargoyle or something like that.
in the Sub GetTarget change :
/squelch /target radius ${RV_CurrentRadius} npc
to
/squelch /target drachnid radius ${RV_CurrentRadius} npc
if that doesn't work (I'm writing this far away from my gaming computer) try this:
/squelch /target ${Race.Equal[drachnid]} radius ${RV_CurrentRadius} npc

add a additional lines in the same area to target additional races, though things may get messy that way, I would suggest staying in an area where it all either that coral or the mob type you're looking for.

Not sure how much easier I can make that, but if you want to send me a pm go ahead.
 
Anyone ever get this working fluently? After X amount of time they just kinda stand there. Works great for a while tho, I think it's after there are no mobs within X radius it freezes.
 
mobs in rng

They will stop once mobs near you are dead, but soon as they start to spawn again picks it right back up, you can also change that range so they pull more if you like.
 
What would you have it do?

Anyone ever get this working fluently? After X amount of time they just kinda stand there. Works great for a while tho, I think it's after there are no mobs within X radius it freezes.

Works great. What exactly do you want it to do once you run out of mobs inside your set radius? You are standing there because the macro is looking for mobs in the level and distance range to kill.
Want it to start looking further? or me personally I have it echo whenever something funky happens. If mobs in your lvl distance range <1 /echo No more mobs ( not at my gaming pc but that what the line does) I have the macro twisted for a very specific use though.
Post up what you want it to do. It can end and camp desktop, etc.
 
It does perfectly fine till after a few rounds of respawns. It happens after an hour or so I think. Sometimes it will start strafing left, right then backwards. over and over. There are no obstacles in the room. Just a big round area, probably 500ft or so. Pull radius is set from the center of the room to the outer edge at about 245ft. It does awesome on roamers and regular spawn mobs. Just on occasion it likes to fall asleep or something. It does fine on looting also.
 
I added a advpath route for him to run, hopefully that fixes it. We'll see in a few hours.

I removed the part that caused my ranger to Strafe back and forth over and over. Seems to be working good now.
 
if i were going to make this repeatedly cast a spell on the mob after the

/if (!${Me.Combat}) /attack on

line in the mac i would just add /cast "name of spell" and each time it cycles through to see if im still in combat it should cast the selected spell/spells correct?