|08/02/06 by Rusty
#include Ninjadvloot.inc
Sub Main
/declare spawnname string outer "unknown"
/if (${Defined[Param0]}) {
/varset spawnname ${Param0}
} else {
/echo No spawn selected! /macro farmer spawnname
/endmac
}
/Echo =============================
/Echo AFK Farmer "${spawnname}" V1.4
/Echo =============================
/call SetupAdvLootVars
:loop
/if (${Me.Sitting}) /stand
/if (${Spawn[gm].ID}) /call Gm
/if (${SpawnCount[pc]}!=1) /call Pc
/if (${Me.PctHPs}<=20) /call Fade
/call Kill
/goto :loop
Sub Kill
/target id ${NearestSpawn[npc ${spawnname}].ID}
/delay 1s
/If (!${Target.ID}) /call Wait
/If (${Target.ID}) /call Warp
/If (${Target.ID}) /call Combat
/return
Sub Warp
/warp target
/delay 1s
/return
Sub Combat
/if (${Me.PctHPs}<=20) /return
/stick 10
:Kill
/if (${Target.Distance} < ${Target.MaxRangeTo} && !${Me.Combat}) /attack on
/if (${Target.ID}) /goto :Kill
/squelch /stick off
/delay 1s
/call CheckAdds
/delay 1s
/call LootMobs
/return
Sub Gm
/camp
/endmac
/return
Sub Wait
/echo no ${spawnname} waiting two min
/delay 2m
/return
Sub Pc
:pc
/if (${SpawnCount[pc]}==1) /return
/echo another player in zone waiting till they leave
/delay 5m
/goto :pc
/return
Sub Fade
/echo Succoring and waiting due to low hp
/warp succor
/fade
/delay 1m
/sit
:Wait
/if (${Me.PctHPs}<=90) /goto :Wait
/return
Sub CheckAdds
/declare s int local
/declare i int local
/for i 1 to 3
/varset s ${NearestSpawn[${i},npc].ID}
/if (${Spawn[${s}].Type.Equal["Corpse"]} || !${Spawn[${s}].LineOfSight}) /next i
/if (${Spawn[${s}].Distance} < 50 && ${Spawn[${s}].LineOfSight}) {
/squelch /target id ${s}
/goto :Got_Add
}
/next i
/return
:Got_Add
/call Combat
/delay 1s
/return