17,101
edits
(Bump version to 1.1.2 & add standard navigation) |
(Document additional currency function & consolidate all currencies into their own section) |
||
Line 6: | Line 6: | ||
<div class="warningbox">You are playing around with the code of the game, as such if you make mistakes it is possible that could corrupt your game. It is highly recommended to '''BACKUP YOUR SAVE''' before running any in-game functions.</div> | <div class="warningbox">You are playing around with the code of the game, as such if you make mistakes it is possible that could corrupt your game. It is highly recommended to '''BACKUP YOUR SAVE''' before running any in-game functions.</div> | ||
==Using In-game Functions On Steam== | ==Using In-game Functions On Steam, Android, or iOS== | ||
Players can use the [https://mod.io/g/melvoridle/m/devconsole dev.Console mod] to execute these commands within the Steam | Players can use the [https://mod.io/g/melvoridle/m/devconsole dev.Console mod] to execute these commands within the Steam, Android, and iOS versions of Melvor Idle. | ||
== Add Item to Bank == | == Add Item to Bank == | ||
Line 53: | Line 53: | ||
The above code will result in 10 {{ItemIcon|Oak Logs}} being removed from the bank. | The above code will result in 10 {{ItemIcon|Oak Logs}} being removed from the bank. | ||
== Add | == Adjust Currencies (GP, Slayer Coins, and Raid Coins) == | ||
The | All [[Currency]] within the game, being {{GP}} [[GP]], {{SC}} [[Slayer Coins]] (SC), and {{RC}} [[Raid Coins]] (RC) can be adjusted using the same set of functions: | ||
<syntaxhighlight lang="js">game. | * To adjust GP, use <syntaxhighlight lang="js" inline>game.gp</syntaxhighlight> | ||
=== Attributes === | * To adjust SC, use <syntaxhighlight lang="js" inline>game.sc</syntaxhighlight> | ||
* To adjust RC, use <syntaxhighlight lang="js" inline>game.rc</syntaxhighlight> | |||
=== Add Currency === | |||
The game.''currency''.add function can be used to add to the player's current balance of that currency. | |||
<syntaxhighlight lang="js">game.<currency>.add(amount)</syntaxhighlight> | |||
==== Attributes ==== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Attribute !! Type !! Optional? !! Default Value !! Description | ! Attribute !! Type !! Optional? !! Default Value !! Description | ||
|- | |- | ||
| amount|| int || No || || The | | amount || int || No || || The amount to increase the specified currency's balance by | ||
|} | |} | ||
=== Examples === | |||
==== Examples ==== | |||
<nowiki>game.gp.add(1);</nowiki> | <nowiki>game.gp.add(1);</nowiki> | ||
The above code will add 1 [[Currency#Gold Pieces|GP]] to the player. | The above code will add 1 [[Currency#Gold Pieces|GP]] to the player. | ||
== Remove | === Remove Currency === | ||
The | The game.''currency''.remove function can be used to subtract from the player's current balance of that currency. If the amount specified is greater than the amount the player currently has, then the currency's balance will become negative. | ||
<syntaxhighlight lang="js">game. | <syntaxhighlight lang="js">game.<currency>.remove(amount)</syntaxhighlight> | ||
=== Attributes === | |||
==== Attributes ==== | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Attribute !! Type !! Optional? !! Default Value !! Description | ! Attribute !! Type !! Optional? !! Default Value !! Description | ||
|- | |- | ||
| amount|| int || No || || The quantity | | amount || int || No || || The quantity to decrease the specified currency's balance by | ||
|} | |} | ||
== | ==== Examples ==== | ||
<syntaxhighlight lang="js">game.rc.remove(1);</syntaxhighlight> | |||
The above code will remove 1 [[Raid Coins|Raid Coin]] from the player. | |||
<syntaxhighlight lang="js">game. | |||
The above code will | |||
== | === Set Currency === | ||
The | The game.''currency''.set function can be used to set the player's balance of that currency to the specified amount. This function may be of particular use to players who have inadvertently found their GP or SC balance is set to an invalid value such as <code>NaN</code>. | ||
<syntaxhighlight lang="js">game.<currency>.set(amount)</syntaxhighlight> | |||
<syntaxhighlight lang="js">game. | |||
== | ==== Attributes ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Attribute !! Type !! Optional? !! Default Value !! Description | ! Attribute !! Type !! Optional? !! Default Value !! Description | ||
|- | |- | ||
| amount || int || | | amount || int || No || || The amount to set the specified currency's balance to | ||
|} | |} | ||
== | ==== Examples ==== | ||
<syntaxhighlight lang="js">game.sc.set(999);</syntaxhighlight> | |||
The above code will set the player's [[Raid Coins|Raid Coin]] balance to 999, regardless of what the previous balance of raid coins owned was. | |||
= | |||
<syntaxhighlight lang="js">game. | |||
The above will | |||
== Add Prayer Points == | == Add Prayer Points == |