In-game Functions: Difference between revisions

From Melvor Idle
(Created page with "In-game functions are responsible for most things in the game. It is possible to interact directly with them through the console. This can be used to add items, levels, GP and...")
 
Line 19: Line 19:
| found || bolean || Yes || Determinates if it will show in item completion log. Default: true
| found || bolean || Yes || Determinates if it will show in item completion log. Default: true
|-
|-
| found || bolean || Yes || Determinates if it will show notification. Default: true
| showNotification || bolean || Yes || Determinates if it will show notification. Default: true
|}
|}
=== Example ===
=== Example ===
  <nowiki>addItemToBank(1, 10, false);</nowiki>
  <nowiki>addItemToBank(1, 10, false);</nowiki>

Revision as of 11:16, 24 August 2020

In-game functions are responsible for most things in the game. It is possible to interact directly with them through the console. This can be used to add items, levels, GP and more. These functions can be executed though the console. To access the console open Developer Tools (usually by pressing F12) in your browser and navigate to the console. Then, simply paste the code in the input field and press enter. Most functions will require you to fill out variables in the code before executing them. Note that all code is case sensitive.

Disclaimer: Blindly adding items will most likely take away game enjoyment. It is highly encourage only to use this to either test things or recoup lost items/progress due to lost saves.

Disclaimer: You are playing around with the code of the game 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.

addItemToBank

The addItemToBank function can be used to add any item in the game to the bank

addItemToBank(itemID, quantity, found = true, showNotification = true)

Attributes

Attribute Type Optional? Description
itemID int No The ID of the item
quantity int No Quantity of item to add
found bolean Yes Determinates if it will show in item completion log. Default: true
showNotification bolean Yes Determinates if it will show notification. Default: true

Example

addItemToBank(1, 10, false);

The above code will result in 10 items with item ID 1 (Oak Logs) being added to the Bank without them appearing in the item completion log, but with notification.

addXP

The addXP function can be used to add XP to any skill. Note that the game will not visually show the updated XP until after refresh or 1 new action.

addXP(skill, xp)

Attributes

Attribute Type Optional? Description
skill int No The ID of the skill
xp int No Amount of XP to add

Example

addXP(10, 1000);

The above code will result in 1000 XP being added to the skill with ID 10 (Thieving).

addMasteryXP

The addMasteryXP function can be used to add XP to any specific Mastery in a skill. Note that the game will not visually show the updated Masterry XP until after refresh or 1 new action.

addMasteryXP(skill, masteryID, qty = 1)

Attributes

Attribute Type Optional? Description
skill int No The ID of the skill
masteryID int No The skill specific Mastery ID
qty int Yes Quantity of XP to add. Default value: 1

Example

addMasteryXP(11, 13, 300);

The above code will result in 300 Mastery XP being added to the skill with ID 11 (Farming) for Mastery ID 13 (Carrot Seeds).