This is the documentation page for Module:Experience

This is a documentation subpage for Module:Experience.
It contains usage information, categories, and other content that is not part of the original module page.
Module:Experience's function between is invoked by Template:XP/Between.
Module:Experience's function level_at is invoked by Template:XP/Level for.
Module:Experience's function to_next is invoked by Template:XP/To next.
Module:Experience's function total_xp is invoked by Template:XP/Total.
Module:Experience requires strict.
Module:Experience loads data from Module:Experience/data.
Module:Experience is required by Module:Skill calc.

This module is a helper module to be used by other modules; it may not designed to be invoked directly. See Brighter Shores:Lua/Helper modules for a full list and more information.

FunctionTypeUse
_total_xp(level)numberReturns the total experience needed to reach a level (from 0).
_between(level_low, level_high)number, numberGiven a level_low and a level_high, return how much experience is needed, starting at level_low, to reach level_high. This is assuming you start at exactly level_low and end as soon as you reach level_high, with no extra experience.
_to_next(level)numberGiven a level, return the experience needed to get to the next level. Returns nil for level 500
_level_at(xp)numberReturns the level you would be at if you had xp experience. When the result is < 500, _total_xp(result) <= xp and xp < _total_xp(result+1)