So I found an itemtarget macro around google and I want it to target a generic (sm), in the zone only one generic sm and one generic lg spawn. I tried /itemtarget but it ALWAYS targetted the lg and never the sm, even when I was closer to the sm. So now I have it /itemtarget "Generic (sm)" but when the macro cant target it, it errors and ends. How do I prevent it from ending?
I also ran over and picked up the lg item, and now theres no items in the zone so /itemtarget causes error and ends. I want it to keep looping until the sm spawns and grab it, but if the lg is up I want it to ignore.
/shrug
I also ran over and picked up the lg item, and now theres no items in the zone so /itemtarget causes error and ends. I want it to keep looping until the sm spawns and grab it, but if the lg is up I want it to ignore.
/shrug
Code:
Sub main
:loop
/itemtarget "Generic (sm)"
/delay 1s
/call GetItem
/delay 1s ${Cursor.ID}
/delay 2s
/if (${Cursor.ID}) /autoinv
}
/delay 2s
/goto :loop
/return
Sub GetItem
/declare lookangle int
/click left center
/if (!${MacroQuest.LClickedObject} || ${Target.ID}) {
/look -128
:loop
/click left center
/if (${Target.ID}) /target clear
/if (!${MacroQuest.LClickedObject} && ${Me.Look}<0) {
/varcalc lookangle ${Me.Look}+2
/look ${lookangle}
/goto :loop
}
}
/return