so i made an auto target macro years ago that used monkbug and targeted nearest npc, /warp /mb on and in this way i was able to clear 500 yellow mobs in under 5 minutes.....moving forward this is no longer a viable option i want to kill and move. so i took and modified this same code to target nearest npc and using mq2melee it would stick to the target and kill it with merc healing. then i got the bright idea to try and loot the corpses as i killed. The resulting code is what I have and the macro worked great till i added the loot sub. please gimmie a hand as i'm not sure why but it seems like there is no wait between calls for getting kill target and looting target. i added echos in each sub to try and see where the issue is and instead just get spam lol
Code:
Sub Main
/echo NextTarget created by jesse.bevil@us.army.mil
/echo Usage: to set unkillable NPC on do not target list type /alert add 1 $ {Target.ID}
/declare MaxPC int outer
/echo Sets MaxPC as Param0, usage is /mac AutoTarget #, where # = MaxPC IE: /mac Autotarget 1, This will say only one PC is allowed in the zone,
/echo if more than ${Param0} AutoTarget turns off
/varset MaxPC ${Param0}
/Echo ${MaxPC} PC allowed in zone with you
/hidecorpse looted
:mainloop
/echo main loop
/call PCcheck
/call Loot
/call TrgtNPC
/goto :mainloop
|This is the code used to target the NPC nearest you that is not on the alert list. make a hotkey
|/alert add 1 id ${Target.ID}
|Target the NPC you want to add to the do not target list IE: Quest NPC, NPC's you can't attack etc and click your hotkey
Sub TrgtNPC
/echo trgtnpc
/stand
/if (${Target.Type.Equal[corpse]}) /keypress esc
/if (${Target.Type.Equal[NPC]}) /call Wait
/squelch /target npc noalert 1
/if (!${Me.Combat}) /attack on
/return
Sub Wait
/echo wait
/delay 1s
/return
/return
Sub Loot
/echo Looting
/target corpse
:loot
/if (${Target.Type.Equal[Corpse]} && ${Target.Distance}<100) {/stick 5
/if (${Target.Distance}<8) {/advloot
/return
}
/delay 1s
/goto loot
/return
Sub PCcheck
/echo pc gm check
/if (${Spawn[gm].ID}) {
/echo GM in zone! Macro Paused for 5 minutes, setting afk.
/afk On the phone!
/delay 5m
}
/if (${SpawnCount[pc]}>${MaxPC}1) {
/echo PC nearby!
/echo AutoTarget has been disabled!
/echo To Many PC's in the Zone, There is now ${SpawnCount[pc]} PC's in the zone with you!
/delay 2m
}
/return
/end
Last edited: