Page 1 of 1
forage.mac
Posted: Thu Apr 29, 2004 12:51 pm
by Mckorr
A simple script that does nothing but forage, placing anything picked up into inventory.
Code: Select all
sub Main
/sit off
:MainLoop
/if (${Cursor.ID}) /autoinv
/if (${Cursor.ID}) /goto :CursorLoop
/if (${Me.AbilityReady["Forage"]}) /doability "Forage"
:CursorLoop
/if (${Cursor.ID}) /autoinv
/if (${Cursor.ID}) /goto :CursorLoop
/goto :MainLoop
/endmacro
Re: forage.mac
Posted: Thu Apr 29, 2004 12:59 pm
by iluvseq
And here it is without the redundancy:
Code: Select all
sub Main
/sit off
:MainLoop
/if (${Cursor.ID}) /autoinv
/if (${Cursor.ID}) /goto :MainLoop
/if (${Me.AbilityReady["Forage"]}) /doability "Forage"
/goto :MainLoop
/endmacro
Posted: Thu Apr 29, 2004 1:52 pm
by Mckorr
Nope, the redundancy is there on purpose. It's to make sure the cursor is clear before you try to forage (like, you had your weapon there for some unknown reason). Keeps you from hitting the forage button before the cursor is cleared.
A cleaner way would be
Code: Select all
sub Main
/sit off
:MainLoop
/if (${Cursor.ID}) /autoinv
/if (!${Cursor.ID}&&${Me.AbilityReady["Forage"]}) /doability "Forage"
/goto :MainLoop
/endmacro
That way you have to have a clean cursor before you forage, and if not you autoinv whatever is on it.
Posted: Thu Apr 29, 2004 10:08 pm
by iluvseq
Not to be pedantic, but my post cleans the cursor just as well as your first post did... read it closely.
There is no reason to have a seperate "CursorLoop" repeating the first two lines of "MainLoop' ...
Just call "MainLoop" halfway through if the cursor isn't clean.
However, your second version does get rid of the redundant loop, so I guess you got it, without realizing it :)