macro line help

eqitchy

Lifetimer
Joined
Nov 8, 2009
Messages
451
Reaction score
8
Points
18
Age
51
Hi all,

I need an "or" command for my macro line, as in loot this or this else detroy. is there any better way for this?

Code:
:loot
	/delay 1s
	/tar corpse
	/delay 1
	/stick 5
	/delay 1s
	/loot
	/delay 1s
	/itemnotify loot1 leftmouseup
	/delay 1s
	/if (!${Cursor.Name.Find[Item1]} || !${Cursor.Name.Find[Item2]}) /destroy
	/delay 5
	/autoinv
	/itemnotify loot2 leftmouseup
	/delay 5
	/if (!${Cursor.Name.Find[Item1]} || !${Cursor.Name.Find[Item2]}) /destroy
	/delay 5
	/autoinv
	/itemnotify loot3 leftmouseup
	/delay 5
	/if (!${Cursor.Name.Find[Item1]} || !${Cursor.Name.Find[Item2]}) /destroy
	/delay 5
	/autoinv
	/itemnotify loot4 leftmouseup
	/delay 5
	/if (!${Cursor.Name.Find[Item1]} || !${Cursor.Name.Find[Item2]}) /destroy
	/delay 5
	/autoinv
	/itemnotify loot5 leftmouseup
	/delay 5
	/if (!${Cursor.Name.Find[Item1]} || !${Cursor.Name.Find[Item2]}) /destroy
 
Look into using Ninjadvloot.inc, you can just call it's loot routine, which is ini driven for keeping or destroying. No point in reinventing the wheel when someone already did the work.
 
Look into using Ninjadvloot.inc, you can just call it's loot routine, which is ini driven for keeping or destroying. No point in reinventing the wheel when someone already did the work.

Hey thanks good point :) was trying to mod a simple macro and finally got or with Fry's help but I should look into it.
 
yes, loot.inc or ninjaloot.inc or any of those you can just use. but to answer your original question, a more concise way to repeat a function over and over is to use a /for loop. it is part of macro "flow control." you can read about it on the main wiki.

Main link: Macro Reference - MacroQuest Wiki

flow control: Flow Control - MacroQuest Wiki

it would look like:

Code:
blah blah
/loot
/delay whatever
/declare i int local
/for i 1 to 5
    /itemnotify loot${i} leftmouseup
    /delay 1s
    /if (!${Cursor.Name.Find[Item1]} && !${Cursor.Name.Find[Item2]}) /destroy
    /delay 5
    /autoinv
/next i