- qty is the number to purchase
- it is the item to purchase
- price is the (optional) maximum price to spend per item
- master is the coinmaster to purchase from
Attempts to purchase qty amount of item it. (Will not buy using meat from storage; use buy_using_storage() instead.) If qty is less than 1, the function will return true without purchasing anything. If the optional maximum price is specified, it returns the integer amount of items purchased; otherwise it returns true if the purchase succeeded and false if it did not. If a price less than 1 is passed, the function will always buy qty, regardless of price. Without the optional price parameter, first preference is given to NPC stores when attempting purchases, after which it will attempt to use the mall.
The versions that return a boolean value determine success depending on whether your inventory of the desired item went up by the amount you tried to buy.
If a coinmaster is listed, it will attempt to purchase from the coinmaster using the correct alternate currency. Otherwise it will be purchased from an NPC store or mall using meat.
Buy a broken skull.
This expands upon purchasing from a coinmaster to show many related functions.
The CLI commands "buy" and "acquire" work similarly.