Many moons ago, someone posted a macro called handin.mac to do this job, I've used it and tweaked it, and now it's about perfect. Here's my current version:
Code: Select all
| handin.mac
|
| Author(s):
| - Kagonis
| - Corrections and suggestions by various people..
| SukMage
| DKAA
| Wassup
| WaBBiT
| Grumpy
|
| Description:
| - Used to make handins to NPCs, nifty for those who
| doesn't feel like getting carpal tunnel syndrome to
| complete a quest that requires a lot of hand ins.
|
| Added:
| Wait time - this allows on the fly adjustment to how long the macro waits between handin sets - allows for use around other players
|
| Usage:
| - /macro handin.mac <pp|gp|sp|cp|"Item Name"> <amount> <wait time> ["destroy"]
| The you must type "destroy" for the macro to destroy items returned.
|
| Example:
| - /macro handin.mac "Batwing" 4 0 "destroy"
| Will hand in 4 Batwing's and destroy the item(s) returned from the NPC. Will do handins without waiting between.
|
| - for items, it will handle partial names of exact matches, for a partial name match, do:
| - /macro handin.mac "Batwin" 4 80
| Will hand in 4 items containing the string "batwin", keep the resulting items, and wait 8 seconds between sets of handins.
|
| - for exact match, do:
| /mac handin "=bone chips" 4
| will hand in 4 bone chips at a time until you run out of bone chips, and will ignore warbone chips, barbed bone chips, etc.
Sub Main(string TheItem, int TheAmount, int ForceDelay, string DoDestroy)
/declare Loopcount int local
/declare Timeout timer local
/declare Itemtype string local
/declare Itemsleft int local
:GiveItem
/if (!${Defined[TheItem]} || !${Defined[TheAmount]}) /call Syntax
/for Loopcount 1 to ${TheAmount}
/if (${TheItem.Equal[pp]}) {
/nomodkey /ctrl /notify InventoryWindow IW_Money0 leftmouseup
/varset Itemtype coin
} else /if (${TheItem.Equal[gp]}) {
/nomodkey /ctrl /notify InventoryWindow IW_Money1 leftmouseup
/varset Itemtype coin
} else /if (${TheItem.Equal[sp]}) {
/nomodkey /ctrl /notify InventoryWindow IW_Money2 leftmouseup
/varset Itemtype coin
} else /if (${TheItem.Equal[cp]}) {
/nomodkey /ctrl /notify InventoryWindow IW_Money3 leftmouseup
/varset Itemtype coin
} else {
/nomodkey /ctrl /itemnotify ${FindItem[${TheItem}].InvSlot} leftmouseup
/varset Itemtype item
}
/delay 50 ${Cursor.ID}
/if (!${Cursor.ID}) {
/goto :Done
}
/if (${Loopcount} == 1 || ${Itemtype.Equal[coin]}) {
/delay 3
/click left Target
/delay 30 !${Cursor.ID}
} else {
/if (${Itemtype.Equal[item]}) {
/notify GiveWnd GVW_MyItemSlot${Int[${Math.Calc[${Loopcount} - 1]}]} leftmouseup
/delay 30 !${Cursor.ID}
}
}
/delay 50 !${Cursor.ID}
/if (${Cursor.ID}) {
/goto :Done
}
/next Loopcount
/notify GiveWnd GVW_Give_Button leftmouseup
/delay 5
:ClearCursor
/if (${Cursor.ID}) {
/if (${Defined[DoDestroy]} && ${DoDestroy.Equal[destroy]}) {
/destroy
} else {
/autoinv
}
/delay 1
/goto :ClearCursor
}
/delay ${ForceDelay}
/varset Itemsleft ${FindItemCount[${TheItem}]}
/if (${Itemsleft} < ${TheAmount} && ${Itemtype.Equal[Item]}) {
/goto :Done
}
/goto :GiveItem
:Done
/endmacro
/return
Sub Syntax
/echo Syntax: /macro handin <pp|gp|sp|cp|"Item Name"> <#> <#> [destroy]
/echo ..
/echo Example: /macro handin gp 2 destroy
/echo Will hand in 2 pieces of gold to the targeted NPC and then click give, and will destroy anything you get back on your cursor.
/echo ..
/echo Example: /macro handin "Batwing" 4
/echo Will hand in 4 batwings to the targeted NPC and then click give, and will keep anything you get back on your cursor.
/echo
/echo Example: /macro handin "Batwing" 3 80
/echo Will hand in 3 batwings at a time, and wait 8 seconds between handins
/endmacro
/return
This version has performed flawlessly for months now (since they made it impossible to hand in stacks of items). Without a delay, it's very fast, so beware of spamming nearby PCs at impossible (without MQ2) speed. Range on voice is 100.00, so slow it down if any PCs are within that range.