17,101
edits
(Updated the functions to the new game object format.) |
|||
Line 16: | Line 16: | ||
== Add Item to Bank == | == Add Item to Bank == | ||
The addItemByID function can be used to add any item in the game to the bank. | The addItemByID function can be used to add any item in the game to the bank. | ||
<nowiki>game.bank.addItemByID(itemID, quantity, found, | <nowiki>game.bank.addItemByID(itemID, quantity, logLost, found, ignoreSpace)</nowiki> | ||
=== Attributes === | === Attributes === | ||
Line 27: | Line 27: | ||
| quantity || int || No || || Quantity of item to add. Will remove items from the bank if a negative value is specified | | quantity || int || No || || Quantity of item to add. Will remove items from the bank if a negative value is specified | ||
|- | |- | ||
| | | logLost || boolean || Yes || false || If <code>true</code>, items that did not fit into the bank will be logged as lost | ||
|- | |- | ||
| | | found || boolean || Yes || false || Determines if it will show in item completion log | ||
|- | |- | ||
| | | ignoreSpace || boolean || Yes || false || If <code>true</code>, the item will be added to the bank even if the bank is already full | ||
|} | |} | ||
=== Examples === | === Examples === | ||
<nowiki>game.bank.addItemByID("melvorD:Oak_Logs", 10, false);</nowiki> | <nowiki>game.bank.addItemByID("melvorD:Oak_Logs", 10, true, true, false);</nowiki> | ||
The above code will result in 10 | The above code will result in attempting to add 10 Oak Logs to the Bank. If they do not fit, 10 will be added to the # of Oak Logs lost on the item's stats. Additionally, Oak Logs will be marked as discovered in the Completion Log. | ||
== Remove Item from Bank == | == Remove Item from Bank == | ||
The removeItemQuantity function can be used to remove any item from the bank | The removeItemQuantity function can be used to remove any item from the bank | ||
<nowiki>game.bank. | <nowiki>game.bank.removeItemQuantityByID(itemID, quantity, removeItemCharges)</nowiki> | ||
=== Attributes === | === Attributes === | ||
Line 47: | Line 47: | ||
! Attribute !! Type !! Optional? !! Default Value !! Description | ! Attribute !! Type !! Optional? !! Default Value !! Description | ||
|- | |- | ||
| itemID || string || No || || The ID of the item.<br />For a complete list of items and their IDs, see: [[Table of Items]] | | itemID || string || No || || The ID of the item.<br />For a complete list of items and their IDs, see: [[Table of Items]]*Not currently updated | ||
|- | |- | ||
| quantity || int || No || || The number of items to remove. | | quantity || int || No || || The number of items to remove. | ||
Line 55: | Line 55: | ||
=== Examples === | === Examples === | ||
<nowiki>game.bank. | <nowiki>game.bank.removeItemQuantityByID("melvorD:Oak_Logs", 10);</nowiki> | ||
The above code will result in 10 of item ID "melvorD:Oak_Logs" being removed from the bank. | The above code will result in 10 of item ID "melvorD:Oak_Logs" being removed from the bank. | ||
Line 221: | Line 221: | ||
The above code will result in the unlocking of {{PetIcon|Cool Rock}}. | The above code will result in the unlocking of {{PetIcon|Cool Rock}}. | ||
== | == Discover Mark == | ||
The discoverMark function is used to discover [[Summoning#Summoning Marks|Summoning Marks]]. Once discovered, there is no supported method to allow a mark to become undiscovered again. | The discoverMark function is used to discover [[Summoning#Summoning Marks|Summoning Marks]]. Once discovered, there is no supported method to allow a mark to become undiscovered again. | ||
<nowiki>game.summoning.discoverMark(mark)</nowiki> | <nowiki>game.summoning.discoverMark(mark)</nowiki> |