Code: Select all
/target npc radius 150
/if (!${Target.ID}) /goto :loopgainexp
/face nolook fast
/call Cast "ensnare"
/delay 2s
/attack onOmper
Moderator: MacroQuest Developers
Code: Select all
/target npc radius 150
/if (!${Target.ID}) /goto :loopgainexp
/face nolook fast
/call Cast "ensnare"
/delay 2s
/attack onCode: Select all
/if (!${Target.ID} || !{Target.LineOfSight}) /goto :loopgainexp
Code: Select all
/if (${Spawn[searchcriteria].LineOfSight]}) {
...
}
Code: Select all
Sub GetTarget
/declare s int local
/declare i int local 1
/for i 1 to 4
/varset s ${NearestSpawn[${i},npc radius 200].ID}
/if (${Spawn[${s}].Type.Equal["Corpse"]} || !${Spawn[${s}].LineOfSight}) /next i
/delay 1
/squelch /target id ${s}
/return
}
/next i
/return

Code: Select all
/if (${s}) /squelch /target id ${s}
or:
/if (${s} != ${Me.ID}) /squelch /target id ${s}
DM: Are you missing a { in there?DigitalMocking wrote:/target is pretty buggy for cycling through targets, here's the code I use to check for mobs and adds, works very well:
Code: Select all
Sub GetTarget /declare s int local /declare i int local 1 /for i 1 to 4 /varset s ${NearestSpawn[${i},npc radius 200].ID} /if (${Spawn[${s}].Type.Equal["Corpse"]} || !${Spawn[${s}].LineOfSight}) /next i /delay 1 /squelch /target id ${s} /return } /next i /return