Buy Macro
Posted: Wed Jun 02, 2004 6:14 pm
Having problems with this selling macro. I am not sure what code is required to get the events to accept tells from npcs. But here it is.
Code: Select all
|
| buyitem.mac
| usage: /macro buyitem 8
| This will buy 8 or 8 stacks of the currently selected item
| NOTE: Select which item to purchase before running macro
| 5/25/04
#turbo 10
#chat tell
#event Full "#*#Your inventory appears full#*#"
#event Broke "#*#You cannot afford#*#"
#event Brokemore "#*#but you can't afford#*#"
Sub Main
/declare quantity int outer
/declare amount int outer
/if (${Defined[Param0]}) {
/varset quantity ${Param0}
} else {
/varset quantity -1
}
/if (${quantity}==-1) {
:fill
/if (${Me.FreeInventory}==0) /endmacro
/shift /notify MerchantWnd MW_Buy_Button leftmouseup
/doevents
/goto :fill
} else {
/for amount 1 to ${quantity}
/shift /notify MerchantWnd MW_Buy_Button leftmouseup
/doevents
/next amount
/endmacro
}
/return
Sub Event_Full
/echo Full Inventory
/endmacro
/return
Sub Event_Broke
/echo No Money
/endmacro
/return