I know there's a lot of buy item macros out there, but i wanted to make one by myself to see if i really understand all this scripting stuff. In other words.. to learn how to do it.
If anyone of you guys could point me out where i made mistake, it would be appreciated. Thanks
Problem i have at the moment is with the "/varset howmany" command. It won't set the var and return me an error.
Code: Select all
| Buyitem.mac
| By Clone39 (this is my first one)
|
| Usage: /macro buyitem "how many to buy" "thing you want to buy"
| 12/08/03
#event FullInventory "There was no place to put that"
/declare howmany local
/declare buycount local
/varset howmany 0
/varset buycount 0
Sub Main
/varset howmany $int(@Param1)
/if n @howmany>@buycount {
:Buy
/selectitem "@Param2" merchant
/buyitem "@Param1"
/varadd buycount 1
/doevents
/goto :Buy
} else {
/endmacro
}
/return
Sub Event_FullInventory
/echo Your inventory is full, ending macro.
/endmacro
/return
Clone39



donations for this month's patches.