In-game Functions: Difference between revisions

m
→‎addMasteryXpToPool: Amend case on section heading & example
m (→‎addMasteryXpToPool: Correct function name)
m (→‎addMasteryXpToPool: Amend case on section heading & example)
Line 187: Line 187:
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.
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.


== addMasteryXpToPool ==
== addMasteryXPToPool ==
The addMasteryXpToPool function can be used to add mastery pool experience to a skill
The addMasteryXpToPool function can be used to add mastery pool experience to a skill
  <nowiki>addMasteryXPToPool(skillID, xp, offline, token)</nowiki>
  <nowiki>addMasteryXPToPool(skillID, xp, offline, token)</nowiki>
Line 204: Line 204:
|}
|}
=== Examples ===
=== Examples ===
  <nowiki>addMasteryXpToPool(11, 600);</nowiki>
  <nowiki>addMasteryXPToPool(11, 600);</nowiki>
The above code will result in 150 Mastery Pool XP being added to the skill with ID 11 (Farming) if the player is under 99 in farming. Or 300 Mastery Pool XP being added if the player is over 99
The above code will result in 150 Mastery Pool XP being added to the skill with ID 11 (Farming) if the player is under 99 in farming. Or 300 Mastery Pool XP being added if the player is over 99