API:BuyAuction
From RoR Wiki
UI Lua API · Auction functions
Version: WAR 1.4.8
Asks the server to buy an auction listing.
BuyAuction(auctionIdHigh, auctionIdLow, revision, price)
Arguments
- auctionIdHigh
number– High part of the auction id (auctionIDHigherNumin the stock search results).- auctionIdLow
number– Low part of the auction id (auctionIDLowerNum).- revision
number– Revision number of the listing (revision).- price
number– Price offered, in brass. The stock UI passes the listing'sbuyOutPrice.
Returns
Nothing.
Details
- Sends a bid request to the server. It is the same request that CancelAuction sends, with the cancel marker cleared and the price filled in.
- The client does not check the player's money. The stock UI compares
Player.GetMoney()with the price first. - The function needs at least four arguments and only reads the last four.
Errors
None besides the generic Invalid Parameters message when an argument is not a number.
Example
From default/ea_auctionhousewindow/source/auctionwindow.lua:
if( Player.GetMoney() < auctionData.buyOutPrice )
then
...
return
end
BuyAuction( auctionData.auctionIDHigherNum, auctionData.auctionIDLowerNum, auctionData.revision, auctionData.buyOutPrice )
