Usage1: /macro turn-in name
Usage2: /macro turn-in "three word name"
It turns in items whose partial name matches (partially or totally) the first parameter, one by one and as fast as possible, to the NPC at your target, while avoiding turn-in errors.
The macro has been tested on private servers with the SoD client. If anyone finds anything that can be improved, I'll be glad to read their comments.
Code: Select all
|------------------------------------------------------------------------|
| Bernat's Simple Turn-in Macro |
| |
| Author : Bernat |
| File name : turn-in.mac |
| Version : v1.0 2011-01-12 20:47 GMT+1 |
| Usage : /macro turn-in itemname |
| Example: /macro turn-in bone |
| Example: /macro turn-in "bone chips" |
| Description : This macro will turn in, as fast as possible and one |
| by one, items whose partial name is given by |
| parameter itemname, until running out. Bags |
| containing the items must be open, and they must be |
| placed in the first available bags (if bags 1 and 2 |
| contain items but bag 1 is closed, macro will stop). |
| For names with multiple words, use of quotes is |
| required. |
| Be careful of client usage while the macro is running, |
| as this may result in macro stopping or wrong item |
| being turned in. |
|------------------------------------------------------------------------|
Sub Main(itemname)
/echo Turning in items by the name of ${itemname}...
/if (${Cursor.ID}) {
/echo ERROR: Unexpected item at cursor.
/endmacro
}
:Loop
/if (!${FindItem[${itemname}].ID}) {
/echo INFO: Ran out of items to turn in.
/endmacro
}
/ctrl /itemnotify ${FindItem[${itemname}].InvSlot} leftmouseup
/delay 1m ${Cursor.ID}
/if (!${Cursor.ID}) {
/echo ERROR: Timeout trying to place an item at cursor.
/endmacro
}
/click left target
/delay 1m ${Window[GiveWnd].Open}
/if (!${Window[GiveWnd].Open}) {
/echo ERROR: Timeout trying to open GiveWnd.
/endmacro
}
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 1m !${Window[GiveWnd].Open}
/if (${Window[GiveWnd].Open}) {
/echo ERROR: Timeout trying to close GiveWnd.
/endmacro
}
/if (${Cursor.ID}) {
/echo ERROR: Unexpected item at cursor.
/endmacro
}
/goto :Loop
/return
