baseLevel
returns int
baseLevel(skill: int) -> intbaseLevel(skill: string) -> int
The level with nothing affecting it - what the experience has earned.
The level with nothing affecting it, by name. Differs from level() exactly when a potion or a drain is in effect.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if baseLevel(14) >= 60 { stop }
if baseLevel("mining") >= 60 { stop }
boost
returns int
boost(skill: int) -> intboost(skill: string) -> int
How far the skill is boosted or drained: positive when boosted, negative when drained, zero when neither.
How far the skill is boosted or drained, by name.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if boost(2) <= 0 { stop }
if boost("strength") <= 0 { stop }
health
returns int
health() -> int
Your hits as they stand - your current health.
Example
if health() < 15 { stop }
healthPercent
needs skillsAvailable()
returns int
healthPercent() -> int
Health as a percentage of maximum, 0 to 100. Answers 100 when the skill hooks are absent, deliberately: a script that flees below 30 must not flee because a hook has not loaded.
Example
if skillsAvailable() and healthPercent() < 30 { stop }
level
returns int
level(skill: int) -> intlevel(skill: string) -> int
The level as it stands, including any boost or drain. What decides whether you can do a thing right now.
The level as it stands, by name. Case and spacing are ignored, and the usual shorthands work: hp, wc, herblore.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if level(14) < 30 { stop }
if level("mining") < 30 { stop }
levelAtXp
returns int
levelAtXp(experience: int) -> int
The level a given amount of experience earns, capped at 99. Arithmetic on the table; it reads nothing from the game.
| Parameter | Type | What it does |
| experiencerequired |
int |
an amount of experience |
Example
let reached = levelAtXp(13034431)
levelFromXp
returns int
levelFromXp(skill: int) -> intlevelFromXp(skill: string) -> int
The level the skill's experience says you are. Normally the same as baseLevel; the two disagreeing means a hook is stale.
The level the skill's experience says you are, by name.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if levelFromXp(14) != baseLevel(14) { stop }
if levelFromXp("mining") != baseLevel("mining") { stop }
maxHealth
returns int
maxHealth() -> int
Your hits with nothing affecting them - your maximum health.
Example
if health() < maxHealth() / 2 { stop }
maxLevel
returns int
maxLevel() -> int
The highest level this game goes to. Ninety-nine - not 120, that is a later game.
Example
if baseLevel("mining") == maxLevel() { stop }
percentToLevel
returns int
percentToLevel(skill: int) -> intpercentToLevel(skill: string) -> int
How far through the current level you are, 0 to 100.
How far through the current level you are, by name.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if percentToLevel(14) > 90 { stop }
if percentToLevel("mining") > 90 { stop }
skillCount
returns int
skillCount() -> int
How many skills there are. Eighteen.
Example
let howMany = skillCount()
skillIndex
returns int
skillIndex(name: string) -> int
The index of a named skill, or -1 when nothing matches. The one command here that answers -1 rather than stopping, because asking whether a name is a skill is a fair question.
| Parameter | Type | What it does |
| namerequired |
string |
the skill name |
Example
if skillIndex("mining") < 0 { stop }
skillName
returns string
skillName(skill: int) -> string
The client's name for a skill index, or an empty string when it is not a skill.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
let named = skillName(14)
skillsAvailable
returns bool
skillsAvailable() -> bool
Whether the three skill arrays are published and populated. Every level here reads 0 when they are not, which is a level nobody has.
Example
if not skillsAvailable() { stop }
totalLevel
returns int
totalLevel() -> int
Every base level added up. All eighteen - none quietly left out.
Example
if totalLevel() > 500 { stop }
totalXp
returns int
totalXp() -> int
Every skill's experience added up. Held as a 64-bit number here because the total overflows a 32-bit one, and a total that silently went negative is a bug nobody thinks to look for.
Example
let all = totalXp()
xp
returns int
xp(skill: int) -> intxp(skill: string) -> int
Total experience in the skill.
Total experience in the skill, by name.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
let earned = xp(14)
let earned = xp("mining")
xpForLevel
returns int
xpForLevel(level: int) -> int
The experience a level begins at. Level 1 begins at nothing.
| Parameter | Type | What it does |
| levelrequired |
int |
a level, 1 to 99 |
Example
let needed = xpForLevel(60) - xp("mining")
xpToLevel
returns int
xpToLevel(skill: int) -> intxpToLevel(skill: string) -> int
Experience still needed for the next level, or 0 at 99.
Experience still needed for the next level, by name.
| Parameter | Type | What it does |
| skillrequired |
int |
the skill index, 0 to 17 |
Example
if xpToLevel(14) < 100 { stop }
if xpToLevel("mining") < 100 { stop }
No command on this page matches that. The search box looks across every page.