User:Silber: Difference between revisions

From Melvor Idle
No edit summary
No edit summary
Line 1: Line 1:
{{V|0.20}}
{{V|1.0}}
{{Otheruses|training the Thieving skill|the skill itself|Herblore}}
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.


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


This page goes through the general method and tips of training the [[Herblore]] skill.
'''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.


== Equipment ==
==Using In-game Functions On Steam==
Players should refer to the [[Scripting and Extensions Instructions#Steam Console and Scripts|Scirpting and Extensions Instructions]] page for a step-by-step guide on using these functions with the Steam version of Melvor Idle.


There is no requirement to start [[Herblore]].
== addItemToBank ==
The addItemToBank function can be used to add any item in the game to the bank.
<nowiki>addItemToBank(itemID, quantity, found, showNotification, ignoreBankSpace)</nowiki>


== Training ==
=== Attributes ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! style="width:180px" | Level
! Attribute !! Type !! Optional? !! Default Value !! Description
!Potion
|-
|-
| 1-20 || {{ItemIcon|Bird Nest Potion I|Bird Nest Potion}}
| itemID || int || No || || The ID of the item.<br />For a complete list of items and their IDs, see: [[Table of Items]]
|-
|-
| 20-32 || {{ItemIcon|Controlled Heat Potion I|Controlled Heat Potion}}
| quantity || int || No || || Quantity of item to add. Will remove items from the bank if a negative value is specified
|-
|-
| 32-40 || {{ItemIcon|Generous Cook Potion I|Generous Cook Potion}}
| found || boolean || Yes || true || Determines if it will show in item completion log
|-
|-
| 40-42 || {{ItemIcon|Fishermans Potion I|Fishermans Potion}}
| showNotification || boolean || Yes || true || Determines if it will show notification
|-
|-
| 42-49 || {{ItemIcon|Skilled Fletching Potion I|Skilled Fletching Potion}}
| ignoreBankSpace || boolean || Yes || false || If <code>true</code>, the item will be added to the bank even if the bank is already full
|}
 
=== Examples ===
<nowiki>addItemToBank(1, 10, false);</nowiki>
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.
 
== removeItemFromBank ==
The removeItemFromBank function can be used to remove any item from the bank
<nowiki>removeItemFromBank(itemID, deactiveGloves)</nowiki>
 
=== Attributes ===
{| class="wikitable"
|-
|-
| 49-53 || {{ItemIcon|Crafting Potion I|Crafting Potion}}
! Attribute !! Type !! Optional? !! Default Value !! Description
|-
|-
| 53-62 || {{ItemIcon|Perfect Swing Potion I|Perfect Swing Potion}}
| itemID || int || No || || The ID of the item.<br />For a complete list of items and their IDs, see: [[Table of Items]]
|-
|-
| 62-71 || {{ItemIcon|Performance Enhancing  Potion I|Performance Enhancing Potion}}
| deactiveGloves || boolean || Yes || true || If <code>true</code>, the count of glove charges will be set to 0 if the itemID is for a gloves with charges.
|}
 
=== Examples ===
<nowiki>removeItemFromBank(1);</nowiki>
The above code will result in item ID 1 (Oak Logs) to be removed from the bank.
 
== addXP ==
The addXP function can be used to add experience to any skill. Note that the game will not visually show the updated XP until after refresh or 1 new action.
<nowiki>addXP(skillID, xp, forceSkill, dropRares)</nowiki>
=== Attributes ===
{| class="wikitable"
|-
! Attribute !! Type !! Optional? !! Default Value !! Description
|-
| skillID || int || No || || The ID of the skill, see: [[#Skill ID|Skill ID]]
|-
|-
| 71-74 || {{ItemIcon|Herblore Potion I|Herblore Potion}}
| xp || int || No || || Amount of experience to add. Note that this is the amount of experience added before bonuses such as that from the {{ItemIcon|Firemaking Skillcape}} or {{PetIcon|Pyro}}
|-
|-
| 74-99 || {{ItemIcon|Generous Harvest Potion I|Generous Harvest Potion}}
| forceSkill || boolean || Yes || false || Determines whether experience boosts normally conditional on the skill (such as that granted by the {{ItemIcon|Ancient Ring of Skills}}) are applied regardless of the skill experience is being added to
|-
| dropRares || boolean || Yes || true || Determines if rolls for items that have a chance of dropping when the player earns experience are performed (currently includes [[Mastery Tokens]], {{ItemIcon|Crown of Rhaelyx}} parts, and {{ItemIcon|Mysterious Stone|Mysterious Stones}})
|}
|}
=== Examples ===
<nowiki>addXP(10, 1000);</nowiki>
The above code will result in 1000 experience being added to the skill with ID 10 (Thieving).


== Boosters ==
== addMasteryXP ==
The addMasteryXP function can be used to add experience to any specific Mastery in a skill. Note that the game will not visually show the updated Masterry experience until after refresh or 1 new action.
<nowiki>addMasteryXP(skillID, masteryID, timePerAction, spendingXP, xp, addToPool, offline)</nowiki>
=== Attributes ===
{| class="wikitable"
|-
! Attribute !! Type !! Optional? !! Default Value !! Description
|-
| skillID || int || No || || The ID of the skill, see: [[#Skill ID|Skill ID]]
|-
| masteryID || int || No || || The skill specific Mastery ID. See [[#Mastery IDs|below]] for information on how to identify Mastery ID values
|-
| timePerAction || int || No || || The interval (in milliseconds) of the action granting mastery experience. Has no effect on the result if <code>spendingXP</code> is <code>true</code>
|-
| spendingXP || boolean || Yes || false || <code>true</code>: The amount of experience specified with <code>xp</code> is added, <code>timePerAction</code> is ignored<br /><code>false</code>: The amount of experience added is determined by the [[Mastery#Earning Mastery XP|Mastery experience per action calculation]], <code>xp</code> is ignored
|-
| xp || int || Yes || 0 || Amount of experience to add. Has no effect on the result if <code>spendingXP</code> is <code>false</code>
|-
| addToPool || boolean || Yes || true || Determines whether a portion of the specified experience amount is added to the mastery pool for the relevant skill or not
|-
| offline || boolean || Yes || false || Determines if various UI elements are immediately updated to reflect the experience gain. Should usually be left as the default value
|}
=== Mastery IDs ===
Below is a reference of how the various mastery ID values may be identified.
{| class="wikitable"
|-
! Skill !! Mastery ID
|-
| {{Skill|Woodcutting}} || Index of the required tree within the constant <code>trees</code>
|-
| {{Skill|Thieving}} || Index of the required NPC within the constant <code>thievingNPC</code>
|-
| {{Skill|Farming}} || <code>items[itemID].masteryID[1]</code> replacing <code>itemID</code> with the ID of the planted seed
|-
| {{Skill|Fishing}} || rowspan="9" | <code>items[itemID].masteryID[1]</code>, replacing <code>itemID</code> with the ID of the item produced by the action
|-
| {{Skill|Firemaking}}
|-
| {{Skill|Cooking}}
|-
| {{Skill|Mining}}
|-
| {{Skill|Smithing}}
|-
| {{Skill|Fletching}}
|-
| {{Skill|Crafting}}
|-
| {{Skill|Runecrafting}}
|-
| {{Skill|Herblore}}
|}


The following things can be used to increase the amount of Thieving XP received: <br>
=== Examples ===
{{ModifierTable|increasedGlobalSkillXP,increasedSkillXP|XP Boost|false|skill=Herblore}}
<nowiki>addMasteryXP(11, 13, 0, true, 300);</nowiki>
The above code will result in 300 Mastery XP being added to the skill with ID 11 (Farming) for Mastery ID 13 (Carrot Seeds).


<nowiki>addMasteryXP(2, 3, 3000);</nowiki>
The above code will result in the calculation & addition of the amount of Mastery XP from an action in skill with ID 2 (Firemaking) for item with Mastery ID 3 (Teak Logs), supposing the action took 3,000 milliseconds.


{{Menu}}
== Reference Tables ==
[[Category:Guides]]
=== Skill ID ===
[[Category:Skill Training]]
{| class="wikitable sortable"
|-
! ID !! Skill
|-
| 0 || {{Skill|Woodcutting}}
|-
| 1 || {{Skill|Fishing}}
|-
| 2 || {{Skill|Firemaking}}
|-
| 3 || {{Skill|Cooking}}
|-
| 4 || {{Skill|Mining}}
|-
| 5 || {{Skill|Smithing}}
|-
| 6 || {{Skill|Attack}}
|-
| 7 || {{Skill|Strength}}
|-
| 8 || {{Skill|Defence}}
|-
| 9 || {{Skill|Hitpoints}}
|-
| 10 || {{Skill|Thieving}}
|-
| 11 || {{Skill|Farming}}
|-
| 12 || {{Skill|Ranged}}
|-
| 13 || {{Skill|Fletching}}
|-
| 14 || {{Skill|Crafting}}
|-
| 15 || {{Skill|Runecrafting}}
|-
| 16 || {{Skill|Magic}}
|-
| 17 || {{Skill|Prayer}}
|-
| 18 || {{Skill|Slayer}}
|-
| 19 || {{Skill|Herblore}}
|-
| 20 || {{Skill|Agility}}
|-
| 21 || {{Skill|Summoning}}
|}

Revision as of 21:02, 21 November 2021

This page was last updated for (v1.0).

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 and experience will most likely take away game enjoyment. It is highly encouraged 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.

Using In-game Functions On Steam

Players should refer to the Scirpting and Extensions Instructions page for a step-by-step guide on using these functions with the Steam version of Melvor Idle.

addItemToBank

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

addItemToBank(itemID, quantity, found, showNotification, ignoreBankSpace)

Attributes

Attribute Type Optional? Default Value Description
itemID int No The ID of the item.
For a complete list of items and their IDs, see: Table of Items
quantity int No Quantity of item to add. Will remove items from the bank if a negative value is specified
found boolean Yes true Determines if it will show in item completion log
showNotification boolean Yes true Determines if it will show notification
ignoreBankSpace boolean Yes false If true, the item will be added to the bank even if the bank is already full

Examples

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.

removeItemFromBank

The removeItemFromBank function can be used to remove any item from the bank

removeItemFromBank(itemID, deactiveGloves)

Attributes

Attribute Type Optional? Default Value Description
itemID int No The ID of the item.
For a complete list of items and their IDs, see: Table of Items
deactiveGloves boolean Yes true If true, the count of glove charges will be set to 0 if the itemID is for a gloves with charges.

Examples

removeItemFromBank(1);

The above code will result in item ID 1 (Oak Logs) to be removed from the bank.

addXP

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

addXP(skillID, xp, forceSkill, dropRares)

Attributes

Attribute Type Optional? Default Value Description
skillID int No The ID of the skill, see: Skill ID
xp int No Amount of experience to add. Note that this is the amount of experience added before bonuses such as that from the Firemaking Skillcape or Pyro
forceSkill boolean Yes false Determines whether experience boosts normally conditional on the skill (such as that granted by the Ancient Ring of Skills) are applied regardless of the skill experience is being added to
dropRares boolean Yes true Determines if rolls for items that have a chance of dropping when the player earns experience are performed (currently includes Mastery Tokens, Crown of Rhaelyx parts, and Mysterious Stones)

Examples

addXP(10, 1000);

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

addMasteryXP

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

addMasteryXP(skillID, masteryID, timePerAction, spendingXP, xp, addToPool, offline)

Attributes

Attribute Type Optional? Default Value Description
skillID int No The ID of the skill, see: Skill ID
masteryID int No The skill specific Mastery ID. See below for information on how to identify Mastery ID values
timePerAction int No The interval (in milliseconds) of the action granting mastery experience. Has no effect on the result if spendingXP is true
spendingXP boolean Yes false true: The amount of experience specified with xp is added, timePerAction is ignored
false: The amount of experience added is determined by the Mastery experience per action calculation, xp is ignored
xp int Yes 0 Amount of experience to add. Has no effect on the result if spendingXP is false
addToPool boolean Yes true Determines whether a portion of the specified experience amount is added to the mastery pool for the relevant skill or not
offline boolean Yes false Determines if various UI elements are immediately updated to reflect the experience gain. Should usually be left as the default value

Mastery IDs

Below is a reference of how the various mastery ID values may be identified.

Skill Mastery ID
Error creating thumbnail: File missing
Woodcutting
Index of the required tree within the constant trees
Error creating thumbnail: File missing
Thieving
Index of the required NPC within the constant thievingNPC
Error creating thumbnail: File missing
Farming
items[itemID].masteryID[1] replacing itemID with the ID of the planted seed
Error creating thumbnail: File missing
Fishing
items[itemID].masteryID[1], replacing itemID with the ID of the item produced by the action
Error creating thumbnail: File missing
Firemaking
Error creating thumbnail: File missing
Cooking
Error creating thumbnail: File missing
Mining
Error creating thumbnail: File missing
Smithing
Error creating thumbnail: File missing
Fletching
Error creating thumbnail: File missing
Crafting
Error creating thumbnail: File missing
Runecrafting
Error creating thumbnail: File missing
Herblore

Examples

addMasteryXP(11, 13, 0, true, 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).

addMasteryXP(2, 3, 3000);

The above code will result in the calculation & addition of the amount of Mastery XP from an action in skill with ID 2 (Firemaking) for item with Mastery ID 3 (Teak Logs), supposing the action took 3,000 milliseconds.

Reference Tables

Skill ID

ID Skill
0
Error creating thumbnail: File missing
Woodcutting
1
Error creating thumbnail: File missing
Fishing
2
Error creating thumbnail: File missing
Firemaking
3
Error creating thumbnail: File missing
Cooking
4
Error creating thumbnail: File missing
Mining
5
Error creating thumbnail: File missing
Smithing
6
Error creating thumbnail: File missing
Attack
7
Error creating thumbnail: File missing
Strength
8
Error creating thumbnail: File missing
Defence
9
Error creating thumbnail: File missing
Hitpoints
10
Error creating thumbnail: File missing
Thieving
11
Error creating thumbnail: File missing
Farming
12
Error creating thumbnail: File missing
Ranged
13
Error creating thumbnail: File missing
Fletching
14
Error creating thumbnail: File missing
Crafting
15
Error creating thumbnail: File missing
Runecrafting
16
Error creating thumbnail: File missing
Magic
17
Error creating thumbnail: File missing
Prayer
18
Error creating thumbnail: File missing
Slayer
19
Error creating thumbnail: File missing
Herblore
20
Error creating thumbnail: File missing
Agility
21
Error creating thumbnail: File missing
Summoning