From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search

RuneScript is a scripting language that Jagex uses to create content for RuneScape. The game engine is not written in RuneScript, instead using Java, while both the desktop and mobile clients are written in C++. RuneScript was developed to allow Jagex staff with little or no programming experience to create and edit content for the game. The game engine can read RuneScript files and execute them accordingly.

We write in a scripting language called RuneScript, which our Game Engine team has created specifically for making RuneScape content. The Java-based game engine then reads this RuneScript code and makes it all work. RuneScript is constantly being changed and expanded as we add new features to it to allow it to do new things."
Mod John A New Dwarf Quest: Coding and Writing[1]
RuneScript sample from the Biohazard quest
Hmm, syntax wise it's similar to any C-style language, except variable names are prefixed with their type (eg. %varname is an integer). We also lack full array support. Other than that, it'd do pretty much anything you could do in C or Java.
Mod Chris E Game Engine Q&A[2]

Effects on the game[edit | edit source]

Like all programming languages, Runescript has a number of limitations, some of which are inherited from Java.

Maximum values[edit | edit source]

Items[edit | edit source]

The maximum number of items that may be carried in one stack

RuneScape stores the amount of items in a stack using a signed 32-bit integer, which has a maximum value of 231-1, which is equal to 2,147,483,647. Consequently, this is the maximum amount that can be stored as one stack (most often seen with coins). If a player attempts to withdraw or pick-up an item while carrying the maximum amount, it is stated that there is not enough inventory space. This limtation applies separately to every single inventory, such as the backpack, bank, trade offer, Grand Exchange slot, duel stake, reward interfaces, etc.

Weights[edit | edit source]

Weight is stored as a signed 16-bit integer, in grams. The maximum possible weight of a single item is thus 32.767 kg (equal to 215-1).

Counters[edit | edit source]

Killcount in the Beasts tab is stored in a signed 32-bit integer. Two killcounts are stored in a single integer by bit-shifting the values.[3] The maximum killcount that can be tracked in-game is capped at 60,000.

Skills[edit | edit source]

Skill experience is stored as a signed 32-bit integer. Since experience is tracked to the tenths place, the maximum value is reduced by a factor of ten, giving experience a maximum of 214,748,364.7. However, this value is capped; thus, the maximum amount of experience that can be obtained in-game is 200 million.

Skill levels are sent as an unsigned 8-bit integer, meaning their maximum value is 255. This can be seen when touching the Stone of Jas during While Guthix Sleeps quest.

Combat[edit | edit source]

The damage for a hit is stored as a signed 16-bit integer, meaning the maximum that could be dealt in one hit is 32,767 (equal to 215-1). This applies to all hitsplats.

References[edit | edit source]

  1. ^ Mod John A. "Coding and Writing." 28 May 2009. Developers' Blogs.
  2. ^ Mod Chris E. "Game Engine Answers!." 13 April 2012. RuneScape Forums.
  3. ^ Mod Ana. "Why do slayer monsters cap at 60 thousand?". Reddit. 2 March 2015. (Archived from the original on 20 August 2021.)