-
-
Notifications
You must be signed in to change notification settings - Fork 13
ComputerCraft Integration
The following peripherals become available to CC:Tweaked when Numismatics is installed:
Method | Description |
---|---|
setCoinAmount(String coinName, int amount) |
Sets the price with the coinName provided and amount |
setTotalPrice(int spurAmount) |
Sets the total price |
getTotalPrice() |
Get the total price |
getPrice(String coinName) |
Get the price with the coinName provided |
Set's the price for the attached block, you can control what amount is set for each coin by using the coin names.
Set's the total price for the attached block in spurs.
Get the total price of the attached block in spurs.
Returns
-
number
The total price in spurs
Get the price of the attached block in the coinName provided.
Returns
-
number
The total price in the provided coinName
Inherits all methods from Vendors/Depositors
Method | Description |
---|---|
getSaleObject() |
Gets the object for sale |
getTransaction() |
Gets the current active transaction |
startTransaction(String accountID, String authorizationID, int count) |
Starts a new transaction |
cancelTransaction() |
Cancels the current transaction, if any |
Gets the object for sale.
Throws an error if the salepoint is not initialized.
Returns
-
table
The sale object -
Example:
{ "type": "ITEM", "filter": ... }
Gets the current active transaction.
Throws an error if there is not an active transaction.
Returns
-
table
The transaction object -
Example:
{ "object": ..., -- equivalent to getSaleObject() "unitPrice": 42, -- the total price, in spurs, per unit "targetCount": 20, -- how many units the transaction will eventually sell "currentCount": 12 -- how many units the transaction has already sold }
Starts a new transaction, which will attempt to sell count
units to the Sub Account specified by accountID
and authorizationID
.
Throws an error if the account is not found, the Sub Account isn't authorized, the salepoint is not configured, or the salepoint is already processing a transaction
Cancels the current transaction, if any.
Method | Description |
---|---|
getBalance(String accountID) |
Gets the balance (in spurs) of the specified account |
getMaxAvailableWithdrawal(String accountID, String authorizationID) |
Gets the maximum number of spurs that can be withdrawn from the specified account |
transfer(String fromAccountID, String fromAuthorizationID, String toAccountID, int amount) |
Transfer amount spurs between the specified accounts |
getAccounts() |
Gets a list of UUIDs for all accounts |
getAccountLabel(String accountID) |
Gets the label of the specified account |
getSubAccountLabel(String accountID, String authorizationID) |
Gets the label of the specified Sub Account inside of the specified account |
isPlayerOwned(String accountID) |
Check whether a player or a Blaze Banker owns the specified account |
Get the balance of the specified account.
Throws an error if the account is not found.
Returns
-
number
The balance of the account in spurs
Get the maximum number of spurs that can be withdrawn from the specified account.
The Sub Account specified by authorizationID
must be set to Authorization Type Anybody
, otherwise the amount will be 0.
Throws an error if the account is not found or if the Sub Account isn't authorized
Returns
-
number
The maximum number of spurs that can be withdrawn from the account (the minimum of the account balance and remaining spend limit, if applicable)
Transfer amount
spurs between the specified accounts.
The Sub Account specified by fromAuthorizationID
must be set to Authorization Type Anybody
.
Throws an error if accounts are not found, if the Sub Account isn't authorized, or if there is insufficient balance.
Gets a list of UUIDs for all accounts.
Returns
-
list
of UUIDs for all accounts.
Get the label of the specified account.
Throws an error if the account is not found.
Returns
-
string
the name of the specified account
Get the label of the specified Sub Account inside of the specified account.
Authorization type must be set to Anybody
, otherwise will throw an error.
Returns
-
string
the name of the specified Sub Account
Check whether a player or a Blaze Banker owns the specified account.
Returns
-
bool
true if account is player-owned, false if account is Blaze Banker-owned.