In-game Functions: Difference between revisions

(→‎Add Mastery XP to Pool: Updated for v1.3)
Line 186: Line 186:
== Add Mastery XP to Pool==
== Add Mastery XP to Pool==
The addMasteryPoolXP function can be used to add [[Mastery#The_Mastery_Pool|Mastery Pool]] experience to a skill
The addMasteryPoolXP function can be used to add [[Mastery#The_Mastery_Pool|Mastery Pool]] experience to a skill
  <syntaxhighlight lang="js">game.skill.addMasteryPoolXP(xp)</syntaxhighlight>
  <syntaxhighlight lang="js">game.<skill>.addMasteryPoolXP(realm, xp)</syntaxhighlight>
where <code>skill</code> is the lowercase name of the skill you are adding mastery experience to.
where <code><skill></code> is the lowercase name of the skill you are adding mastery experience to.
=== Attributes ===
=== Attributes ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Attribute !! Type !! Optional? !! Default Value !! Description
! Attribute !! Type !! Optional? !! Default Value !! Description
|-
| realm || object || No || || The realm to add the Mastery Pool XP to. Obtained with <code>game.realms.getObjectByID(id)</code> where the id is the ID of the realm.
A list of action IDs can be obtained by entering the following into the console: <code>console.log(game.realms.allObjects.map((a) => a.id + ' - ' + a.name).join('\n'))</code>.
|-
|-
| xp || int || Yes || 0 || Amount of experience to add.
| xp || int || Yes || 0 || Amount of experience to add.