Improved Pull Macro

DemonH2

Lifetimer
Joined
May 14, 2007
Messages
1,886
Reaction score
2
Points
38
All of the Pull macros are very old, and I couldn't get them to work worth a flip for me. So I built an entirely new one from the ground up that is working perfectly.

The ONLY thing this macro does, is targets the closest NPC, runs to it, attacks until it has aggro, runs back to camp, kills, and refreshes. No looting will be added to this Macro. Buffs and whatnot can easily be added, if you can't figure out how hit me up. Let me know how it works for you, its working 100% perfect for me.

Must have MQ2MoveUtils loaded. Must Have Extended Targeting.

To use the macro you go: /macro macroname numberofPCsingroup. Lets say you do /mac demonpull 2, if more than 2 people enter your defined radius(easily adjusted in the mac), it will halt until they leave.

Code:
|
|
|  DemonH2's redeisgned puller Macro
|
|  Usage /mac macroname number of PCs in your group

#turbo 60
|-----------------------------------
Sub Main
|-----------------------------------
/declare XLOC int outer 0
/declare YLOC int outer 0
/declare CZone string outer ${Zone.ShortName}
/declare XLOC2 int outer ${Me.X}
/declare YLOC2 int outer ${Me.Y}

/declare obcount int outer 0

/declare PCNumb int outer ${Param0}
|						Max Radius
|					           |
|						   V
/declare MaxRadius int outer                      360


|						Max ZRadius
|					           |
|						   V
/declare MaxZRadius int outer                     200

|						PC Check Radius
|					           |
|						   V
/declare PCCheck int outer                        500
/call Main2
/return

|-----------------------------------
Sub Main2
|-----------------------------------
                     

:mainloop
	/call checkshit
	/if (!${Target.ID}) /call gettarget
	/if (${Target.Type.Equal[NPC]} && ${Target.Distance} < 50) /call attack
	/if (${Target.Type.Equal[NPC]} && ${Target.Distance} < ${MaxRadius}) /call Movetotarget
	/call Pull
	/call ReturnHome
	/call Waitformob
	/call Attack
/goto :mainloop

/return

|-----------------------------------
Sub Checkshit
|-----------------------------------
|PC Check:
	/if (${SpawnCount[pc radius ${PCCheck}]} > ${PCNumb}) {
   	   /keypress back
   	   /stick off
    	   /attack off
		:loop
		/if (${SpawnCount[pc radius ${PCCheck}]} > ${PCNumb}) /goto :loop
 							      }
|GM Check:
	/if (${SpawnCount[gm]} > 0) {
   	   /keypress back
   	   /stick off
    	   /attack off
           /beep
	   /beep
           /end
 							      }

|Target Type Check:
	/if (${Target.Type.NotEqual[NPC]}) /target clear

|Target Distance Check:
	/if (${Target.Distance} > ${MaxRadius}) {
		/target clear
		/attack off
		/stick off
		/keypress back
	/return
						}
|Starter Zone Check:

	/if (${Zone.ShortName.NotEqual[${CZone}]} ) {
		/keypress back
		/sit
		/end
						     }

/return

|-----------------------------------
Sub gettarget
|-----------------------------------
/call checkshit
/echo Getting Target
:targetloop
	/target npc radius ${MaxRadius} zradius ${MaxZRadius}
	/if (${Target.Type.NotEqual[npc]}) /target clear
	/if (!${Target.ID}) /goto :targetloop
/if (${Target.ID}) /return

/return

|-----------------------------------
Sub Movetotarget
|-----------------------------------
/call checkshit
	/if (${Target.ID}) {
		/moveto ID
		/echo Going to the mob
	:loop
/call checkshit
		/call obcount
		/call obcheck
		/if (${Target.Distance} > ${MaxRadius}) {
			/target clear
			/attack off
			/stick off
			/keypress back
			/return
							}
		/moveto ID
		/if (${Target.Distance} > 15) /goto :loop
			/call reset
		           }

/return

|-----------------------------------
Sub Pull
|-----------------------------------
/call checkshit
	/if (${Target.ID} && ${Target.Distance} < 30) {
		/stick 10
		/attack on
		/echo Pissing him off.
 			:ploop
   				/if (!${Me.XTarget[1].ID}) /goto :ploop
					/delay 1
					/attack off
					/stick off
					/delay 1
					/attack off
					/stick off
						     }
/return

|-----------------------------------
Sub ReturnHome
|-----------------------------------
/call checkshit
		/moveto loc ${YLOC2} ${XLOC2}
		/echo Coming Home
			:hloop
				/call obcount
				/call obcheck
				/moveto loc ${YLOC2} ${XLOC2}
			/if (${Math.Distance[${Me.Y},${Me.X}:${YLOC2},${XLOC2}]} > 10) /goto :hloop
/call reset

/return

|-----------------------------------
Sub Waitformob
|-----------------------------------
/call checkshit
	/if (${Target.ID}) {
		/echo Waiting for him!
		/delay 30s (${Target.Distance}) <50
		/if (${Target.Distance} > 50) {
		/clear target
		/attack off
		/stick off
		/call main2
					      }
			   }
/return


|----------------------------------
Sub Attack
|----------------------------------
	/if (${Target.Distance} < 51) {
		/echo Lets Keeeel Him
		/face fast
		/attack on
		/stick 15
	:cloop
	/if (${Target.Type.Equal[NPC]}) /goto :cloop

/attack off
/clear target
/stick off
}
/return


|====================================================
Sub obcount
|====================================================

    /varset XLOC ${Me.X}
    /varset YLOC ${Me.Y}
    /delay 5
    /call obcheck
/return

|====================================================
Sub obcheck
|====================================================

/if (${Int[${Me.X}]} == ${XLOC} && ${Int[${Me.Y}]} == ${YLOC}) /varcalc obcount ${obcount}+1
/if (${obcount} > 20) /call stuck
 
/return

|----------------------------------------------------
Sub Reset
|----------------------------------------------------
/varset obcount 0
/return

|---------------------------------------------------
Sub stuck
|---------------------------------------------------
/echo I'm Stuck!
	/call reset
	/call checkshit
	/keypress back
	/keypress back hold
	/delay 1s

			/keypress strafe_right hold
                        /delay 2s

/keypress back
/call reset
/return
 
Last edited:
tested this mac and it works well for outdoors, but tried it in POJ and it couldn't figure out about doors and got stuck in the wall. Other than that worked well. would be nice to auto loot so that would not loose too much in pp from merc healer.
The one thing I did need to mention is that merc's count so if you have 2 in group and 2 merc's you need to do /mac pull 4

-Tled
 
Last edited:
I like this mac its great how it attacks mobs in camp as well.

The one problem im having is when it brings mobs back to camp, every once in awhile it freaked out and runs back and forth and strafes. Any ideas?
 
I like this mac its great how it attacks mobs in camp as well.

The one problem im having is when it brings mobs back to camp, every once in awhile it freaked out and runs back and forth and strafes. Any ideas?

I honestly have no idea without looking at it, I can't say I've seen it do it to me. Ill run this exact version and see if I can get the same results.
 
Ok figured it out! I dont know the fix for it but. . . it keeps saying its stuck but its not so it trys to do the stuck function.
 
Try the update I just put at the top, all I did was set the threshold a little higher as to when it calls for stuck, probably will fix it.
 
Demon, same problem still, I removed the stuck option and it runs semi fun doesnt loop any longer but now it gets stuck on mobs, not sure why. runs better as a de than halfling though lol