The problem is that the simple act of determining an appropriate target, deciding to attack, waiting for the mob to be killed, etc., can in itself be a complex task. So I strongly suggest you become a member of the VIP forums because there are hundreds of macros you can use and an amazing wealth of information you can learn from.
In the mean time, I literally threw this together to show you some basic concepts. I could have made the sample macro shorter, but I wanted to use some concepts like checking to see if the target is in water, target is in line of site, using a target ID variable (to reduce the number of TLO calls), using a /while loop, conditional delays, etc. However, I have not tested this so I can't vouch for its correctness.
Code: Select all
Sub Main
/declare TargetID int
:MainLoop
/varset TargetID ${NearestSpawn[npc radius 100 zradius 50 los].ID}
/if ( !${TargetID} || ${Spawn[${TargetID}].FeetWet} ) /goto :MainLoop
/target id ${TargetID}
/delay 10 ${Target.ID} == ${TargetID}
/pet attack
/while ( ${Spawn[${TargetID}].Type.NotEqual[corpse]} ) {
/delay 1
}
/varset TargetID 0
/squelch /target clear
/delay 10 !${Target.ID}
/goto :MainLoop
/return