Skip to content

Global functions and variables

875 implemented, 523 reserved. Entries are sorted by name.

$camera::movementspeed: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Tiles per second the camera moves toward a new focus; 0 moves it at once.

// $camera::movementspeed = 10;

Specification: client-rendering.md§5.2.

$pref::audio::mastervolume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of everything, in percent.

$pref::audio::mastervolume = 50;

Specification: client-rendering.md§11.1.

$pref::audio::midivolume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of MIDI music in percent; kept for scripts, Borne does not play MIDI.

$pref::audio::midivolume = 50;

Specification: client-rendering.md§11.1.

$pref::audio::mp3volume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of music, in percent.

$pref::audio::mp3volume = 50;

Specification: client-rendering.md§11.1.

$pref::audio::radiovolume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of radio streams in percent; kept for scripts, Borne has no radio.

$pref::audio::radiovolume = 50;

Specification: client-rendering.md§11.1.

$pref::audio::reversestereo: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

1 swaps the left and right channels of positioned sounds.

$pref::audio::reversestereo = 1;

Specification: client-rendering.md§11.1.

$pref::audio::soundvolume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of sound effects, in percent.

$pref::audio::soundvolume = 50;

Specification: client-rendering.md§11.1.

$pref::audio::uivolume: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The volume of interface sounds and of sounds that are not positioned, in percent.

$pref::audio::uivolume = 50;

Specification: client-rendering.md§11.1.

$pref::borne::automapping: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether the map follows the player on its own; stored only.

$pref::borne::automapping = 1;

Specification: client-rendering.md§11.1.

$pref::borne::defaultfontname: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The name of the installed font family used for text; empty for the built-in font. The fonts load again when it changes.

$pref::borne::defaultfontname = "value";

Specification: client-rendering.md§11.1.

$pref::borne::defaultfontsize: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The size of the text over heads, in points at scale 1.

$pref::borne::defaultfontsize = 1;

Specification: client-rendering.md§11.1.

$pref::borne::displaytrayicon: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether the client shows a tray icon; stored only.

$pref::borne::displaytrayicon = 1;

Specification: client-rendering.md§11.1.

$pref::borne::dontsavepasswords: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

1 keeps the account on the login screen but never saves the password.

$pref::borne::dontsavepasswords = 1;

Specification: client-rendering.md§11.1.

$pref::borne::filescan: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether downloaded files are scanned; stored only.

$pref::borne::filescan = 1;

Specification: client-rendering.md§11.1.

$pref::borne::language: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The interface language. Scripts hear onPlayerLanguageChanges when it changes.

$pref::borne::language = "value";

Specification: client-rendering.md§11.1.

$pref::borne::limitnicknames: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

1 cuts a nickname set with setnick to the length in nicknamelimit.

$pref::borne::limitnicknames = 1;

Specification: client-rendering.md§11.1.

$pref::borne::loadbuddylistfromserver: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether the buddy list comes from the server; stored only.

$pref::borne::loadbuddylistfromserver = 1;

Specification: client-rendering.md§11.1.

$pref::borne::localsockets: number

Runs on: client only. Origin: engine extension. Since: M14. Playground: no.

Turns script sockets on this machine on (default off). Only the player can set it, in the preferences file; scripts cannot write it. With it on, TSocket may connect to and listen on the loopback only.

echo($pref::borne::localsockets);

Specification: web-and-files.md§8.10.

$pref::borne::nicknamelimit: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The most characters a nickname may have while limitnicknames is on.

$pref::borne::nicknamelimit = 1;

Specification: client-rendering.md§11.1.

$pref::borne::showyourselfonbuddylists: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether the player shows on the buddy lists of others; stored only.

$pref::borne::showyourselfonbuddylists = 1;

Specification: client-rendering.md§11.1.

$pref::borne::utf8fontfile: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

A font file in the assets folder used for text; empty for the installed or built-in font. The fonts load again when it changes.

$pref::borne::utf8fontfile = "value";

Specification: client-rendering.md§11.1.

$pref::capture::allowbyscript: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no. read-only.

Whether scripts may start a capture; read-only and 0 because Borne has no recorder.

echo($pref::capture::allowbyscript);

Specification: client-rendering.md§11.1.

$pref::capture::area: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The part of the screen the capture options name; stored only.

$pref::capture::area = "value";

Specification: client-rendering.md§11.1.

$pref::capture::audiobitrate: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The audio bit rate of the capture options; stored only.

$pref::capture::audiobitrate = 1;

Specification: client-rendering.md§11.1.

$pref::capture::disabledaynight: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The capture option to leave out the day and night tint; stored only.

$pref::capture::disabledaynight = 1;

Specification: client-rendering.md§11.1.

$pref::capture::format: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The file format of the capture options; stored only.

$pref::capture::format = "value";

Specification: client-rendering.md§11.1.

$pref::capture::fps: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The frames per second of the capture options, 1 to 20; stored only.

$pref::capture::fps = 1;

Specification: client-rendering.md§11.1.

$pref::capture::hideinterface: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The capture option to hide the interface; stored only.

$pref::capture::hideinterface = 1;

Specification: client-rendering.md§11.1.

$pref::capture::recordaudio: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The capture option to record sound; stored only.

$pref::capture::recordaudio = 1;

Specification: client-rendering.md§11.1.

$pref::capture::showmouse: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The capture option to show the pointer; stored only.

$pref::capture::showmouse = 1;

Specification: client-rendering.md§11.1.

$pref::capture::size: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The picture size of the capture options; stored only.

$pref::capture::size = "value";

Specification: client-rendering.md§11.1.

$pref::capture::videobitrate: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The video bit rate of the capture options; stored only.

$pref::capture::videobitrate = 1;

Specification: client-rendering.md§11.1.

$pref::display::mode: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The window mode: windowed, borderless or fullscreen.

$pref::display::mode = "value";

Specification: client-rendering.md§11.1.

$pref::display::scale: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The display scale: a number from 0.5 to 4 with up to two decimals (1 by default).

$pref::display::scale = "value";

Specification: client-rendering.md§11.1.

$pref::display::vsync: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

1 waits for the screen refresh before showing a frame.

$pref::display::vsync = 1;

Specification: client-rendering.md§11.1.

$pref::options::reduceparticles: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

1 makes emitters create half of their particles.

$pref::options::reduceparticles = 1;

Specification: client-rendering.md§11.1.

$pref::video::defaultguistyle: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The name of the style for GUI windows; stored only.

$pref::video::defaultguistyle = "value";

Specification: client-rendering.md§11.1.

$pref::video::externalguistyle: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The name of the style for windows outside the game window; stored only.

$pref::video::externalguistyle = "value";

Specification: client-rendering.md§11.1.

$pref::video::fullscreenmode: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The screen size of the exclusive fullscreen mode as “WxH”; empty or an unknown size gives borderless fullscreen.

$pref::video::fullscreenmode = "value";

Specification: client-rendering.md§11.1.

$pref::video::resolution: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The color depth of the display; stored only.

$pref::video::resolution = 1;

Specification: client-rendering.md§11.1.

$pref::video::screenshotformat: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The format of screenshot files: png, jpg or bmp.

$pref::video::screenshotformat = "jpg"; // JPEG files from now on

Specification: client-rendering.md§11.1.

$pref::video::useopengl: number

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Whether the client prefers OpenGL; stored only.

$pref::video::useopengl = 1;

Specification: client-rendering.md§11.1.

$pref::video::windowmode: string

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

The window size as “WxH” while windowed. Changing it resizes the window, and so does dragging the window edge.

$pref::video::windowmode = "value";

Specification: client-rendering.md§11.1.

_(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M8. Playground: yes.

Returns the text unchanged: there is no translation table, as on the legacy server without one.

echo(_("Hello"));

Specification: standard-library.md§3.

abs(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the number without its sign.

echo(abs(-3)); // 3

Specification: standard-library.md§3.

addControl(control: object)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Adds a GUI control to the screen.

addControl(temp.panel);

Specification: client-rendering.md§4.11.

addgmap(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Loads the gmap with the name, like loadmap, so warps into it work. Returns 1 when the map exists and 0 otherwise. The legacy server also adds the map to its options; here loadgmaps.txt is the startup list and a script never rewrites it.

echo(addgmap("world"));

Specification: world-and-objects.md§3.5a.

addstring(list: any, value: any) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Appends a value to the list held in the variable given as first argument and stores the list back into that variable, turning an unset variable or a list string into an array.

addstring(temp.names, "Ann");

Specification: standard-library.md§5.2.

addtiledef(image: string, levelPrefix: string, type: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Uses the image as the tileset of every level whose name starts with the prefix, with tile type table 0 or 1. A later definition for the same prefix replaces the earlier one.

addtiledef("tiles.png", "town", 0);

Specification: world-and-objects.md§2.4.

addtiledef2(image: string, levelPrefix: string, x: number, y: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Draws the image over the tileset at the pixel position for the levels whose name starts with the prefix.

addtiledef2("extra.png", "town", 0, 0);

Specification: world-and-objects.md§2.4.

addweapon(name: string) -> number

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Adds the weapon to the list of the player in scope, or of the player it is called on. Returns 1 when added and 0 when the player had it. A weapon that does not exist reports R-NO-SUCH-WEAPON.

addweapon("Bow");

Specification: world-and-objects.md§7.1.

adventure_getControlBinding(action: number, slot: number) -> controlbinding

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The binding in a slot of a game action, or nothing when the slot holds no key.

temp.b = adventure_getControlBinding(0, 0);
if (temp.b) echo(temp.b.keytext);

Specification: client-rendering.md§4.12.

adventure_setControlBinding(action: number, slot: number, code: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Binds a slot of a game action to a key code. A key another action uses changes places with the key of this slot; a negative code clears the slot.

adventure_setControlBinding(0, 1, Key.space);

Specification: client-rendering.md§4.12.

aes_decrypt(key: string, iv: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Decrypts AES in CBC mode with the same key and start vector as aes_encrypt; padding null bytes stay at the end.

temp.p = aes_decrypt(temp.key16, temp.iv16, temp.c);

Specification: standard-library.md§17.1.3.

aes_encrypt(key: string, iv: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Encrypts with AES in CBC mode. The key has 16, 24 or 32 bytes and the start vector 16; the data is padded with null bytes to a multiple of 16. Any other key or vector length gives an empty text.

temp.c = aes_encrypt(temp.key16, temp.iv16, "secret");

Specification: standard-library.md§17.1.3.

aindexof(value: number, array: array) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the first index of the array whose element equals the number, or -1.

echo(aindexof(3, {1, 2, 3})); // 2

Specification: standard-library.md§17.3.5.

allfeatures: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

Every feature bit, for enablefeatures.

enablefeatures(allfeatures);

Specification: client-rendering.md§4.5.

allowedImageAnimations: string

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

The images that may animate: “all” or a comma separated list. Stored; images never animate on Borne.

allowedimageanimations = "all";

Specification: client-rendering.md§7.5.

allplayers: player[]

Runs on: server only. Origin: compatibility. Since: M8. Playground: no. read-only.

Every online player, ordered by id.

for (temp.pl: allplayers) echo(temp.pl.account);

Specification: world-and-objects.md§10.

allplayerscount: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The number of players in the player list.

echo(allplayerscount);

Specification: player-api.md§5.2.

allrenderobjecttypes: number

Runs on: client only. Origin: compatibility. Since: M10. Playground: no. read-only.

The number of kinds of render object scripts can create.

echo(allrenderobjecttypes);

Specification: standard-library.md§17.5.6.

arccos(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the angle in radians whose cosine is x; a value outside -1 to 1 gives 0.

echo(arccos(1)); // 0

Specification: standard-library.md§3.

arcsin(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the angle in radians whose sine is x; a value outside -1 to 1 gives 0.

echo(arcsin(1));

Specification: standard-library.md§3.

arctan(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the angle in radians whose tangent is x.

echo(arctan(1));

Specification: standard-library.md§3.

arraylen(list: any) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Function form of size: returns how many elements the array or list string holds, or 0 for anything else.

echo(arraylen(temp.items));

Specification: standard-library.md§5.2.

attachplayertoobj(player: number, npc: any) -> boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Makes the local player ride along with an NPC, given as an object or an id, keeping the offset it has now. The first argument is the player index; only 0, the local player, can be attached. Returns true when it worked. On the server it acts on the player the call is made on (player.attachplayertoobj()) or the player in scope, and that player’s client does it.

attachplayertoobj(0, findnpc("Lift"));

Specification: player-api.md§5.4.

base64decode(s: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Decodes standard Base64 text. Spaces and line breaks are skipped; invalid input gives an empty string.

echo(base64decode("SGVsbG8=")); // Hello

Specification: standard-library.md§2.1.

base64encode(s: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Encodes the bytes of the text with the standard Base64 alphabet and pads the result with equals signs.

echo(base64encode("Hello")); // SGVsbG8=

Specification: standard-library.md§2.1.

bintohex(data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns two lower-case hexadecimal characters per byte of the text.

echo(bintohex("ab")); // 6162

Specification: standard-library.md§17.6.2.

blockagain() -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Makes the NPC block again.

this.blockagain();

Specification: world-and-objects.md§11.2.

blockagainlocal()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Makes this NPC block again on this client only.

this.blockagainlocal();

Specification: world-and-objects.md§20.8.

board: array

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

The 4096 tiles of layer 0 of the level of the script, row by row (a read only copy).

echo(board[0]);

Specification: standard-library.md§17.6.

bodyCachePerPlayer: number

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

How many coloured bodies are cached per player, 1 to 16 (4 by default). Stored; Borne keeps its own cache.

bodycacheperplayer = 8;

Specification: client-rendering.md§7.5.

bodyexists(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

1 when the image is in bodies/ of the data root, else 0.

echo(bodyexists("zz.png"));

Specification: standard-library.md§17.6.7.

boxcontains(outer: any, inner: any) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when the second box lies entirely inside the first.

echo(boxcontains("0,0,0,4,4,4", "1,1,1,2,2,2")); // 1

Specification: standard-library.md§17.2.5.

boxcontainsvector(box: any, point: any) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when the point is inside the box; the minimum is inside, the maximum is outside.

echo(boxcontainsvector("0,0,0,2,2,2", "1,1,1")); // 1

Specification: standard-library.md§17.2.5.

boxintersect(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the smallest box holding both boxes, in spite of the name.

echo(boxintersect("0,0,0,1,1,1", "2,2,2,3,3,3"));

Specification: standard-library.md§17.2.5.

boxoverlaps(a: any, b: any) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when two boxes share space; touching boxes overlap.

echo(boxoverlaps("0,0,0,2,2,2", "2,2,2,3,3,3")); // 1

Specification: standard-library.md§17.2.5.

boxscale(box: any, scale: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Multiplies the corners of a box by a vector.

echo(boxscale("0,0,0,1,1,1", "2,2,2"));

Specification: standard-library.md§17.2.5.

callnpc(id: number, name: string, ...params?: any) -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Raises on with the given arguments on the NPC with the id. The event runs after the calling script ends. An unknown id reports R-NO-SUCH-NPC.

callnpc(this.id, "Tick", 1);

Specification: world-and-objects.md§10.

callweapon(index: number, call: array)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raises an event on the weapon at a position of the weapons array. The array holds the event name and then its arguments. It runs after the calling script ends.

callweapon(0, {"onHello", 1, "two"});

Specification: player-api.md§2.7.

camerabounds: array

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The rectangle the camera stays in, as x, y, width, and height in tiles. Assign an array to change it and an empty value to go back to the level or gmap.

camerabounds = {0, 0, 64, 64};

Specification: client-rendering.md§5.2.

cameraposition: array

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The top-left corner of the visible area as an array of x and y in tiles.

echo(cameraposition[0]);

Specification: client-rendering.md§5.2.

camerasize: array

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The size of the visible area as an array of width and height in tiles.

echo(camerasize[0]);

Specification: client-rendering.md§5.2.

canbecarried()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Marks this NPC as one a player can carry on this client.

this.canbecarried();

Specification: world-and-objects.md§20.8.

canbepulled()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Marks this NPC as one a player can pull on this client.

this.canbepulled();

Specification: world-and-objects.md§20.8.

canbepushed()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Marks this NPC as one a player can push on this client.

this.canbepushed();

Specification: world-and-objects.md§20.8.

cannotbecarried()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Clears the carry mark of this NPC on this client.

this.cannotbecarried();

Specification: world-and-objects.md§20.8.

cannotbepulled()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Clears the pull mark of this NPC on this client.

this.cannotbepulled();

Specification: world-and-objects.md§20.8.

cannotbepushed()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Clears the push mark of this NPC on this client.

this.cannotbepushed();

Specification: world-and-objects.md§20.8.

canspin: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True when the local player has a sword image.

echo(canspin);

Specification: player-api.md§5.2.

canwarp() -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Lets this NPC cross level links while it moves, into any level. Switches canwarp2 off. DB and local NPCs only; level NPCs never leave their level.

canwarp();

Specification: world-and-objects.md§11.5.

canwarp2() -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Lets this NPC cross level links while it moves, only into levels of its own gmap. Switches canwarp off.

canwarp2("x");

Specification: world-and-objects.md§11.5.

carriesblackstone: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriesblackstone);

Specification: player-api.md§2.10.

carriesbush: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriesbush);

Specification: player-api.md§2.10.

carriesnpc: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriesnpc);

Specification: player-api.md§2.10.

carriessign: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriessign);

Specification: player-api.md§2.10.

carriesstone: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriesstone);

Specification: player-api.md§2.10.

carriesvase: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(carriesvase);

Specification: player-api.md§2.10.

ceil(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Rounds up to the nearest whole number, on both client and server.

echo(ceil(2.1)); // 3

Specification: standard-library.md§3.

changeimgcolors(index: number, red: number, green: number, blue: number, alpha: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Sets the color and opacity of a show image; each value is from 0 to 1. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

changeimgcolors(300, 1, 0.5, 0.5, 1);

Specification: client-rendering.md§8.1.

changeimgmode(index: number, mode: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Sets the effect mode of a show image: 0 add, 1 alpha, 2 subtract, 3 multiply. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

changeimgmode(300, 0);

Specification: client-rendering.md§8.1.

changeimgpart(index: number, x: number, y: number, width: number, height: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Shows only a pixel rectangle of the image of a show image. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

changeimgpart(300, 0, 0, 16, 16);

Specification: client-rendering.md§8.1.

changeimgvis(index: number, layer: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Sets the layer of a show image. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

changeimgvis(300, 2);

Specification: client-rendering.md§8.1.

changeimgzoom(index: number, zoom: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Sets the zoom of a show image. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

changeimgzoom(300, 2);

Specification: client-rendering.md§8.1.

char(code: number) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns a one-byte string for a code from 0 to 255. Other codes give an empty string.

echo(char(65)); // A

Specification: standard-library.md§2.1.

checksum(s: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the CRC-32 checksum of the bytes of the text as an unsigned number.

echo(checksum("123456789")); // 3421780262

Specification: standard-library.md§2.1.

clearemptyglobalvars()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Does nothing: a script global set to an empty value is already freed.

clearemptyglobalvars();

Specification: standard-library.md§17.4.9.

contains(s: string, sub: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when one element of the list equals the value, ignoring capital letters, otherwise 0. It does not search inside text.

echo(contains("red,green", "Green")); // 1

Specification: standard-library.md§2.1.

convertlatintoutf8(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Turns Latin-1 text into UTF-8: every byte from 128 up becomes two bytes.

temp.u = convertlatintoutf8(temp.text);

Specification: standard-library.md§17.3.2.

convertstringtotime(format: string, text: string) -> number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Parses text with a strptime pattern into Unix time in the server time zone; -2147483647 when it does not match.

echo(convertstringtotime("%Y-%m-%d", "2020-01-01"));

Specification: standard-library.md§17.6.5.

converttimetostring(time?: number) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Writes a Unix time as a UTC date and time in the form 2023-11-14 22:13:20; without an argument it uses the current time.

echo(converttimetostring(timevar2));

Specification: standard-library.md§17.

convertutf8tolatin(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Turns UTF-8 text into Latin-1; text that is not valid UTF-8 comes back unchanged.

temp.l = convertutf8tolatin(temp.text);

Specification: standard-library.md§17.3.2.

copylevel(source: string, destination: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

Copies a level file inside levels/ (both names relative to it); 1 on success. Goes through the script file sandbox.

copylevel("template.nw", "instances/a.nw");

Specification: standard-library.md§12.2.

copyStrings(first: string, second: string)

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Kept for older scripts: in the legacy client it looks up the two names and copies nothing, so it does nothing.

copystrings("this.a", "this.b");

Specification: client-rendering.md§7.5.

cos(radians: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the cosine of an angle given in radians.

echo(cos(0)); // 1

Specification: standard-library.md§3.

cursoroff()

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Turns the GUI cursor off: the control under the mouse is forgotten and the hint hides; the desktop pointer stays.

cursoroff();

Specification: gui-legacy.md§26.2.

cursoron()

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Turns the GUI cursor back on after cursoroff().

cursoron();

Specification: gui-legacy.md§26.2.

dbLastError() -> string

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

The error message of the last dbQuery or executeQuery call, or an empty string when it succeeded. Provisional behavior (OQ-STD-21).

executeQuery("SELEC 1"); echo(dbLastError());

Specification: standard-library.md§13.4.

dbQuery(sql: string) -> array

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Runs a statement on the default database and waits for its rows, as an array of row arrays. The wait is bounded by the remaining time budget of the script; a statement that takes longer is interrupted, the result is empty, and dbLastError() says why. Provisional behavior (OQ-STD-21); prefer requestsql.

temp.rows = dbQuery("SELECT name, qty FROM items"); echo(temp.rows.size());

Specification: standard-library.md§13.4.

decompressfile(zip: string, pattern: string, folder: string, flags: number) -> number

Runs on: server only. Origin: compatibility. Since: M14. Playground: no.

Unpacks a ZIP archive into a folder that scripts may write. The pattern (with * and ?) picks entries; flag 1 keeps the folders of the archive. Entries that would leave the folder are skipped. Returns 1 when everything was unpacked, otherwise 0.

echo(decompressfile("databases/pack.zip", "*.png", "logs/pack", 0));

Specification: web-and-files.md§6.1.

degtorad(degrees: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Converts degrees to radians.

echo(degtorad(180)); // 3.141592654

Specification: standard-library.md§3.

deletefile(path: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Deletes a file in a writable folder. Returns 1 when it was deleted.

deletefile("logs/old.txt");

Specification: standard-library.md§12.2.

deletefolder(path: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Removes an empty script folder; 1 on success, 0 when missing or not empty.

echo(deletefolder("scriptfiles/old"));

Specification: standard-library.md§17.6.7.

deletelevel(name: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

Deletes a file inside levels/; 1 on success. Goes through the script file sandbox.

deletelevel("instances/a.nw");

Specification: standard-library.md§12.2.

deletestring(list: any, value: any) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes the element at the given position of the list held in the variable. The variable is given by name as a string, as in legacy scripts, or directly.

deletestring("this.names", 0);

Specification: standard-library.md§5.2.

des_decrypt(key: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Decrypts what des_encrypt made with the same key.

temp.p = des_decrypt("8bytekey", temp.c);

Specification: standard-library.md§17.1.4.

des_encrypt(key: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Encrypts with DES in ECB mode using the first 8 bytes of the key; a last partial block stays as it is.

temp.c = des_encrypt("8bytekey", "12345678");

Specification: standard-library.md§17.1.4.

destroy() -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Destroys the object: runs onDestroy, cancels its suspended coroutines, removes its name, and frees it so every handle to it becomes empty.

destroy();

Specification: vm-and-coroutines.md§4.2.

detachplayer()

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Ends riding along with an NPC. On the server it acts on the player the call is made on (player.detachplayer()) or the player in scope, and that player’s client does it.

detachplayer();

Specification: player-api.md§5.4.

disabledefmovement()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Turns the default walking controller off, so a script can move the player itself.

disabledefmovement();

Specification: world-and-objects.md§11.5.

disabledsoundeffects: string

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The sound files that do not play, as an array or a comma separated list. Reading gives the comma separated list.

disabledsoundeffects = {"sword.wav"};

Specification: player-api.md§7.3.

disableinfowindow()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in game menu on F1 off; F1 then reaches the scripts (onKeyPressed, onOpenInfoWindow).

disableinfowindow();

Specification: client-rendering.md§4.9.

disablemap()

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Kept for older scripts: Borne has no built-in map, so it changes nothing that shows.

disablemap();

Specification: world-and-objects.md§13.6.

disableoptionswindow()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in options menu on F3 off; F3 then reaches the scripts (onKeyPressed, onOpenOptionsWindow).

disableoptionswindow();

Specification: client-rendering.md§4.9.

disablepause()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Stops the player from being paused and clears the paused flag.

disablepause();

Specification: player-api.md§2.4.

disableplayerlist()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in list of players online on F7 off; F7 then reaches the scripts (onKeyPressed, onOpenPlayerList).

disableplayerlist();

Specification: client-rendering.md§4.9.

dontblock() -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Makes the NPC stop blocking.

this.dontblock();

Specification: world-and-objects.md§11.2.

dontblocklocal()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Makes this NPC stop blocking on this client only.

this.dontblocklocal();

Specification: world-and-objects.md§20.8.

downloadfile: string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

The name of the file that downloads now, or an empty string.

echo(downloadfile);

Specification: web-and-files.md§3.5.

downloadpos: number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

Bytes received of the file that downloads now.

echo(downloadpos);

Specification: web-and-files.md§3.5.

downloadsize: number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

Size in bytes of the file that downloads now; 0 while unknown.

echo(downloadsize);

Specification: web-and-files.md§3.5.

drawallinsidenpcs: boolean

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

When true, NPCs inside the view are drawn even outside a world map. False by default.

drawallinsidenpcs = true;

Specification: world-and-objects.md§20.7.

drawaslight() -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Makes the NPC draw as a light.

this.drawaslight();

Specification: world-and-objects.md§11.1.

TDrawingPanel

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Older name of GuiDrawingPanel: an off-screen drawing surface. Created with new; the optional argument names the control. Drawing members and properties are the same as those of GuiDrawingPanel.

new TDrawingPanel("Canvas") { width = 64; height = 64; }

Specification: movieclip.md§11.

drawoverplayer()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Draws this NPC above the characters on this client.

this.drawoverplayer();

Specification: world-and-objects.md§20.8.

drawunderplayer() -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Makes the NPC draw below characters.

this.drawunderplayer();

Specification: world-and-objects.md§11.1.

echo(message: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Writes the text form of its argument as one line to the output of the running side: RC chat and the server log on the server, the F2 console on the client.

echo("Hello " @ 5);

Specification: standard-library.md§11.

echo2(text: string, tab: string) -> any

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

Writes a line to an RC tab opened with rc.addtab. Every RC session that has the tab open shows it, the server keeps the last 20 lines for sessions that open the tab later, and the line is written to the RC log. Reports R-RC-TAB for a bad tab name or more than 32 tabs.

echo2("jailed bob", "Borne Police");

Specification: rc-and-rights.md§10.7.

emoticonChar: string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The character that starts an emoticon in chat text; empty because Borne has no emoticons.

echo(emoticonChar);

Specification: client-rendering.md§4.11.

enabledefmovement()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Turns the default walking controller of the local player on.

enabledefmovement();

Specification: world-and-objects.md§11.5.

enablefeatures(flags: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Sets which built-in features are on, by bit. The call replaces the whole set.

enablefeatures(allfeatures);

Specification: client-rendering.md§4.5.

enableinfowindow()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in game menu on F1 back on.

enableinfowindow();

Specification: client-rendering.md§4.9.

enablemap()

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Kept for older scripts: undoes disablemap(). Borne has no built-in map.

enablemap();

Specification: world-and-objects.md§13.6.

enableoptionswindow()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in options menu on F3 back on.

enableoptionswindow();

Specification: client-rendering.md§4.9.

enablepause()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Lets scripts pause the player again after disablepause.

enablepause();

Specification: player-api.md§2.4.

enableplayerlist()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the built-in list of players online on F7 back on.

enableplayerlist();

Specification: client-rendering.md§4.9.

escapefilename(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M14. Playground: yes.

Turns any text into a file name that is safe on every file system: letters, digits and _ stay, every other byte becomes % and its decimal value with three digits.

echo(escapefilename("a b")); // a%032b

Specification: web-and-files.md§2.3.

escapestring(s: string) -> string

Runs on: server only. Origin: compatibility. Since: M1. Playground: yes.

Prepares text for a MySQL string literal: NUL, line feed, carriage return, and byte 26 become backslash sequences, and backslash, single quote, and double quote get a backslash in front.

echo(escapestring("it's")); // it\'s

Specification: standard-library.md§2.1.

escapestring2(s: string) -> string

Runs on: server only. Origin: compatibility. Since: M1. Playground: yes.

Prepares text for a SQLite string literal by doubling every single quote.

echo(escapestring2("it's")); // it''s

Specification: standard-library.md§2.1.

escapestringkeepnewline(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Puts a backslash before quotes and backslashes and drops control characters other than line feeds.

echo(escapestringkeepnewline("a\"b"));

Specification: standard-library.md§17.3.3.

executeQuery(sql: string) -> array

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Runs a statement on the default database and waits for its rows, as an array of row arrays. The wait is bounded by the remaining time budget of the script; a statement that takes longer is interrupted, the result is empty, and dbLastError() says why. Provisional behavior (OQ-STD-21); prefer requestsql.

temp.rows = executeQuery("SELECT name, qty FROM items"); echo(temp.rows.size());

Specification: standard-library.md§13.4.

exp(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns e raised to the power x.

echo(exp(1)); // 2.718281828

Specification: standard-library.md§17.6.6.

extractfilebase(path: string) -> string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The name without its extension. Both / and \ separate folders.

echo(extractfilebase("a/b.txt"));

Specification: standard-library.md§12.2.

extractfileext(path: string) -> string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The extension with its dot. Both / and \ separate folders.

echo(extractfileext("a/b.txt"));

Specification: standard-library.md§12.2.

extractfilename(path: string) -> string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The name with its extension. Both / and \ separate folders.

echo(extractfilename("a/b.txt"));

Specification: standard-library.md§12.2.

extractfilepath(path: string) -> string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The folder with a trailing separator. Both / and \ separate folders.

echo(extractfilepath("a/b.txt"));

Specification: standard-library.md§12.2.

fileexists(path: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns 1 when the file exists, otherwise 0. On the server the path must lie inside the allowed folders (a path outside them reports R-FILE-ACCESS); on the client it looks in the downloaded and server-listed files.

echo(fileexists("databases/save.txt"));

Specification: standard-library.md§12.2.

fileisfolder(path: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns 1 when the path is an existing folder inside the script file sandbox, otherwise 0.

echo(fileisfolder("databases"));

Specification: standard-library.md§12.2.

filesize(path: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the size of the file in bytes, or 0.

echo(filesize("logs/script.log"));

Specification: standard-library.md§12.2.

fileupdate(name: string) -> number

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

On a client: asks the server for a newer copy of a file and returns 1 when the client already has a file of that name. On the server: tells the clients that a served file changed on the disk and returns 1 when the file exists.

echo(fileupdate("sign.png"));

Specification: web-and-files.md§3.7.

fileupdateignore(name: string)

Runs on: server only. Origin: compatibility. Since: M14. Playground: no.

From now on the changes of a served file on the disk are not announced to clients until fileupdate is called for it.

fileupdateignore("big.png");

Specification: web-and-files.md§6.3.

findani(name: string) -> object

Runs on: client only. Origin: compatibility. Since: M4. Playground: no.

The object of a gani, loading its file, or null when there is no such file. Its fields are the gani’s flags (loop, continuous, singledirection, setbackto, movie, ganitype) and any variables a script stores on it.

temp.g = findani(player.ani);

Specification: world-and-objects.md§20.9.

findareanpcs(x: number, y: number, width: number, height: number) -> npc[]

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the NPCs of the current level whose position is inside the rectangle, ordered by id.

echo(findareanpcs(10, 10, 5, 5).size());

Specification: world-and-objects.md§10.

findareaplayers(x: number, y: number, width: number, height: number) -> player[]

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the players of the current level whose position is inside the rectangle, ordered by id.

echo(findareaplayers(0, 0, 64, 64).size());

Specification: world-and-objects.md§10.

findfiles(pattern: string) -> array

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Returns the paths below the data root that match a pattern with * in readable folders, sorted by bytes.

temp.list = findfiles("logs/*.log");

Specification: standard-library.md§12.2.

findimg(index: number) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Returns the show image of the calling object with the index, creating an empty one when there is none. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

with (findimg(300)) { alpha = 0.5; }

Specification: client-rendering.md§8.1.

findlevel(name: string) -> level

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the loaded level with the file name, or empty when it is not loaded.

echo(findlevel("start.nw").name);

Specification: world-and-objects.md§10.

findnearestplayer(x: number, y: number) -> player

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the player of the current level nearest to the point, or empty.

echo(findnearestplayer(this.x, this.y).account);

Specification: world-and-objects.md§10.

findnearestplayers(x: number, y: number) -> player[]

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the players of the current level sorted by distance from the point.

echo(findnearestplayers(this.x, this.y).size());

Specification: world-and-objects.md§10.

findnpc(name: string) -> npc

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the DB NPC with the name, or empty. Level NPCs have no name.

echo(findnpc("Shop").objecttype());

Specification: world-and-objects.md§10.

findnpcbyid(id: number) -> npc

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the NPC with the id, or empty.

echo(findnpcbyid(this.id).level);

Specification: world-and-objects.md§10.

findObject(name: string) -> object

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the first named object found: DB NPC, weapon, level, then player account.

echo(findobject("Shop").objecttype());

Specification: world-and-objects.md§10.

findpath(sx: number, sy: number, tx: number, ty: number, options?: object) -> array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Finds a path of tile nodes from the start to the target through the current level (and its gmap neighbors) with A*. Each node is an object with x and y. Returns an empty array when there is no path. Options: width, height, diagonal, tilecosts, ignorenpcs, maxnodes, smooth, partial.

temp.path = findpath(1, 1, 10, 10);

Specification: standard-library.md§9.2.

findpathasync(sx: number, sy: number, tx: number, ty: number, options?: object) -> object

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Starts a path search on a worker with a snapshot of the grid and returns a request object at once. It completes on a later tick: path holds the nodes (empty when there is none), error holds the reason or an empty string, and onPathFound is raised on the request. The default node limit is 200000. One object may have 64 pending requests.

temp.req = findpathasync(1, 1, 30, 30); waitfor(temp.req, "onPathFound", 5);

Specification: standard-library.md§9.2.

findpathinarray(grid: array, walkable: array, blocking: array, stop: array, nostop: array, startY: number, startX: number, maxLength: number) -> array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

The legacy grid search. Walkable and blocking list the cell values that can and cannot be entered. The search ends at the first reached cell whose value is in stop; nostop values can be crossed but never end the path. Returns nodes with y and x, start first, or an empty array.

temp.nostop = {}; temp.path = findpathinarray(grid, {0}, {1}, {9}, temp.nostop, 0, 0, 50);

Specification: standard-library.md§9.1.

findpathingrid(grid: array, costs: array, sx: number, sy: number, tx: number, ty: number, options?: object) -> array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Finds a path on a script grid grid[y][x]. costs[value] is the cost of entering a cell with that value; zero, negative, or missing blocks. Returns nodes with x and y, or an empty array.

temp.path = findpathingrid(grid, {0, 1}, 0, 0, 4, 4);

Specification: standard-library.md§9.2.

findplayer(account: string) -> player

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the player logged in with the account name, or empty. The name is not case-sensitive.

temp.p = findplayer("alice"); echo(temp.p.account);

Specification: world-and-objects.md§10.

findplayer2(name: string) -> player

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the player whose account name or community name matches, or empty.

echo(findplayer2("Alice").level);

Specification: world-and-objects.md§10.

findplayerbycommunityname(name: string) -> player

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the player with the community name, or empty.

echo(findplayerbycommunityname("alice").account);

Specification: world-and-objects.md§10.

findplayerbyid(id: number) -> player

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Returns the player with the session id, or empty.

echo(findplayerbyid(player.id).account);

Specification: world-and-objects.md§10.

findplayersbyguild(guild: string, allies: string) -> player[]

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the online players whose guild is the given guild or one of the comma separated allies.

echo(findplayersbyguild("Raven", "").size());

Specification: standard-library.md§17.6.

findrc(account: string) -> player

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

Returns the rc player of the staff member logged in to the RC with the account, or empty. The name is not case-sensitive. The rc player is the account’s player in memory: the online player when the account is also playing, otherwise a copy that is in no level, so findplayer does not find it.

temp.rc = findrc("ruan");
if (temp.rc != NULL) echo(temp.rc.account);

Specification: rc-and-rights.md§10.7.

findweapon(name: string) -> weapon

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Returns the weapon of the local player with the name, or empty.

echo(findweapon("Bow").name);

Specification: world-and-objects.md§10.

findweaponnpc(name: string) -> weapon

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Returns the server instance of the weapon with the name, or empty.

echo(findweaponnpc("Bow").objecttype());

Specification: world-and-objects.md§10.

fiximagetransparency(file: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Makes every pixel equal to the upper left pixel of an image file transparent and writes the file back; true when it worked.

echo(fiximagetransparency("uploads/sign.png"));

Specification: web-and-files.md§6.

float(x: any) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Converts a value to a number and keeps its fraction; a string with no numeric prefix gives -1.

echo(float("2.5") + 1); // 3.5

Specification: standard-library.md§3.

floor(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Rounds down to the nearest whole number, on both client and server.

echo(floor(2.9)); // 2

Specification: standard-library.md§3.

focusx: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The x the camera follows: the custom focus, or the middle of the player.

echo(focusx);

Specification: client-rendering.md§5.2.

focusy: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The y the camera follows: the custom focus, or the middle of the player.

echo(focusy);

Specification: client-rendering.md§5.2.

format(pattern: string, ...values?: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Builds text from a pattern with percent conversions (s, d, f, x, and a literal percent), consuming the extra arguments in order. A width pads on the left and a minus flag pads on the right; an unknown conversion is dropped.

echo(format("%5.2f|%-4d|", 3.14159, 7));

Specification: standard-library.md§2.3.

format2(pattern: string, values: array) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Works like format, but takes the values from an array or list text instead of further arguments.

echo(format2("%s-%s", {"a", "b"})); // a-b

Specification: standard-library.md§17.3.1.

formatfraction(number: number, format: array) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Splits a number into units such as seconds, minutes, and hours from a format array {unit, divisor, unit, divisor, …, lastUnit} and writes the largest unit first.

echo(formatfraction(3725, {"s", 60, "m", 60, "h"}));

Specification: standard-library.md§4.

formatprice(number: number, separator?: string) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Writes a number with a separator, a comma by default, between each group of three digits of its whole part.

echo(formatprice(1234567)); // 1,234,567

Specification: standard-library.md§4.

formattimestring(format: string, time?: number) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Formats a Unix time in UTC with strftime-style codes (%Y %m %d %H %M %S %y %b %B %a %A %j %e %p %I and %%).

echo(formattimestring("%d/%m/%Y", timevar2));

Specification: standard-library.md§17.

freeallresources()

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Lets the images kept by preloadimage age out again.

freeallresources();

Specification: standard-library.md§17.5.2.

freefileresources(name: string)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Drops what the client holds in memory for a file: the decoded image, sound, or gani. The file stays in the cache and loads again when used.

freefileresources("big.png");

Specification: web-and-files.md§3.9.

freezeplayer(seconds: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Freezes the local player for the given number of seconds: it cannot walk or use weapons. On the server it acts on the player the call is made on (player.freezeplayer()) or the player in scope, and that player’s client does it.

freezeplayer(2);

Specification: world-and-objects.md§11.5.

freezeplayer2()

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Freezes the local player until unfreezeplayer is called. On the server it acts on the player the call is made on (player.freezeplayer2()) or the player in scope, and that player’s client does it.

freezeplayer2();

Specification: world-and-objects.md§11.5.

gameControlHasFocus(alsochat?: boolean) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while the game receives the keys. With the argument true the chat line counts as the game too.

if (gameControlHasFocus()) echo("playing");

Specification: client-rendering.md§4.11.

gamehasfocus(chatBarCounts: boolean) -> boolean

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

True while the game has the keyboard: no GUI control other than the game view holds the focus. The argument says whether typing in the chat line counts as the game.

if (gamehasfocus(true)) {
echo("game has the keyboard");
}

Specification: gui-legacy.md§26.2.

generatezipstring(files: array) -> string

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Makes a ZIP archive in memory from {name, content, …} and returns it as a string.

temp.z = generatezipstring({"a.txt", "hello"});

Specification: web-and-files.md§6.4.

getangle(dx: number, dy: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the angle of an offset in radians from 0 up to two pi, growing counterclockwise on screen, so getangle(1, 0) is 0 and getangle(0, 1) is about 4.71.

echo(getangle(0, -1));

Specification: standard-library.md§3.

getareanpcs(x: number, y: number, width: number, height: number) -> npc[]

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Same as findareanpcs: the NPCs of the level inside the rectangle, ordered by id.

echo(getareanpcs(0, 0, 64, 64).size());

Specification: standard-library.md§17.6.

getascii(s: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the code of the first byte of the text, or 0 for an empty text.

echo(getascii("BC")); // 66

Specification: standard-library.md§2.1.

getboxcenter(box: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the middle point of a box written minx,miny,minz,maxx,maxy,maxz.

echo(getboxcenter("0,0,0,2,4,6")); // 1,2,3

Specification: standard-library.md§17.2.5.

getcallstack() -> array

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the active script calls of the running coroutine as an array of entries, outermost first. Each entry is named after its function and has the read-only fields scriptname, scriptline (the line it is executing; for a caller, the line of the call), lastreturnline (-1 before any call returned) and lastreturnscript (empty before any call returned).

temp.stack = getcallstack(); echo(temp.stack[temp.stack.size() - 1].scriptline);

Specification: standard-library.md§17.

getcallstackinfo() -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the active script calls as one text, innermost first, like “in RuanNPC.b1() at line 11 by RuanNPC.onCreated() at line 2”.

echo(getcallstackinfo());

Specification: standard-library.md§17.

getDesktopResolution() -> string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The size of the monitor as a “WxH” string.

echo(getDesktopResolution());

Specification: client-rendering.md§4.11.

getdir(dx: number, dy: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the direction (0 up, 1 left, 2 down, 3 right) that best matches an offset. Equal horizontal and vertical distances count as vertical, and a zero offset gives 2.

echo(getdir(5, 1)); // 3

Specification: standard-library.md§3.

getDisplayDeviceList() -> array

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The names of the monitors.

echo(getDisplayDeviceList());

Specification: client-rendering.md§4.11.

getdownloadprogress(name: string) -> number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Returns how much of a file has arrived, from 0 to 1. A file the client already has gives 1.

echo(getdownloadprogress("map.png"));

Specification: web-and-files.md§3.4.

getextension(path: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the extension of the last part of a path, dot included.

echo(getextension("a/b.txt")); // .txt

Specification: standard-library.md§17.3.4.

getfilemodtime(path: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the Unix time of the last change of the file, or 0.

echo(getfilemodtime("logs/script.log"));

Specification: standard-library.md§12.2.

getgamesubversion() -> string

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the sub-version of the game; always an empty text.

echo(getgamesubversion());

Specification: standard-library.md§17.5.6.

getguildnick(guild: string, account: string) -> string

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the guild nickname of a member. Guild membership is only the player’s guild tag here, so the answer is the empty string.

echo(getguildnick("Raven", "alice"));

Specification: standard-library.md§17.6.

gethttprequest(host: string, port: number, file: string) -> httprequest

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Returns the request object made for a host, port, and file, or the empty value.

temp.r = gethttprequest("example.com", 443, "/news.txt");

Specification: web-and-files.md§4.6.

gethttprequestforurl(url: string) -> httprequest

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Returns the request object made for a web address, or the empty value.

temp.r = getHTTPRequestForURL("https://example.com/news.txt");

Specification: web-and-files.md§4.6.

gethttprequests() -> httprequest[]

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Returns an array of all request objects made by requesturl and requesthttp that still exist.

echo(getHTTPRequests().size());

Specification: web-and-files.md§4.6.

getimgheight(image: string) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Height in pixels of an image the client has loaded, or 0 when it is missing.

echo(getimgheight("block.png"));

Specification: client-rendering.md§6.

getimgpixel(file: string, x: number, y: number) -> array

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns {red, green, blue, alpha}, each 0 to 255, of one pixel of an image file; an empty array outside the image or for a missing file.

temp.p = getimgpixel("hat.png", 3, 4);

Specification: standard-library.md§17.5.2.

getimgwidth(image: string) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Width in pixels of an image the client has loaded, or 0 when it is missing.

echo(getimgwidth("block.png"));

Specification: client-rendering.md§6.

getKeyCode(name: string) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The key code of a key name, 0 when the name is not known.

echo(getKeyCode("Enter"));

Specification: client-rendering.md§4.11.

getlastfiledownloadtime() -> number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The client time when a file or a part of a file last arrived. 0 before the first.

echo(getLastFileDownloadTime());

Specification: web-and-files.md§3.6.

getlastfilerequesttime() -> number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The client time when a file was last requested from the server. 0 before the first.

echo(getLastFileRequestTime());

Specification: web-and-files.md§3.6.

getlastwebdownloadtime() -> number

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

The time an answer to a web request last arrived: client time on a client, server time on the server. 0 before the first.

echo(getLastWebDownloadTime());

Specification: web-and-files.md§4.7.

getlastwebrequesttime() -> number

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

The time a web request was last sent: client time on a client, server time on the server. 0 before the first.

echo(getLastWebRequestTime());

Specification: web-and-files.md§4.7.

getlicenseexpirationtime() -> number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the Unix time the license expires; Borne has no license, so it is far away.

echo(getlicenseexpirationtime());

Specification: standard-library.md§17.6.11.

getloginaccountname() -> string

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the account name used to log in.

echo(getloginaccountname());

Specification: standard-library.md§17.5.6.

getmappartfile(column: number, row: number) -> string

Runs on: server and client. Origin: engine extension. Since: M8. Playground: no.

Returns the file name of the level at a cell of the gmap. Serverside, a level that no loaded gmap lists answers its own file name for every cell (verified); clientside, an empty string when the cell is empty or there is no map.

echo(getmappartfile(1, 0));

Specification: world-and-objects.md§20.7.

getmapx(level: string) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the column of the level in the world map the player is on, or -1 when the level is not on it.

echo(getmapx("b.nw"));

Specification: world-and-objects.md§20.7.

getmapy(level: string) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the row of the level in the world map the player is on, or -1 when the level is not on it.

echo(getmapy("b.nw"));

Specification: world-and-objects.md§20.7.

getmemorystatsobjects() -> number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the bytes the script objects hold (same estimate as getmemoryusage).

echo(getmemorystatsobjects());

Specification: standard-library.md§17.6.11.

getmemoryusage() -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the bytes the script heap holds.

echo(getmemoryusage());

Specification: standard-library.md§17.4.9.

getmusicfilename() -> string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The name of the music file that plays now, or an empty string.

echo(getmusicfilename());

Specification: web-and-files.md§3.10.

getmusicstatus() -> string

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns “ok” while the music channel plays a track and an empty text otherwise.

echo(getmusicstatus());

Specification: standard-library.md§17.5.1.

getmusictags() -> array

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the tags of the playing track; the client reads none, so the array is empty.

echo(getmusictags().size());

Specification: standard-library.md§17.5.1.

getnearestplayer(x: number, y: number) -> player

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Returns the player nearest to a point in the level, like findnearestplayer.

temp.pl = getnearestplayer(30, 30);

Specification: player-api.md§5.2.

getnearestplayers(x: number, y: number) -> player[]

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Serverside it returns the positions in the players array of the players of the level, ordered by distance to the point (use findnearestplayers for the players themselves). Clientside it returns the players, like findnearestplayers.

temp.index = getnearestplayers(30, 30)[0]; temp.nearest = players[temp.index];

Specification: player-api.md§5.2.

getnpcindex(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the position of the first NPC with this name in the NPCs of the level, or -1.

echo(getnpcindex("door"));

Specification: standard-library.md§17.6.

getnpcserveruptime() -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Deprecated spelling of getprocessuptime.

echo(getnpcserveruptime());

Specification: standard-library.md§17.4.9.

getplatform() -> string

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the name of the operating system the client runs on, such as linux, windows or macos.

echo(getplatform());

Specification: standard-library.md§17.5.6.

getplayerindex(account: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Position of the online player with that account in allplayers, -1 when not online.

echo(getplayerindex("ruanf"));

Specification: standard-library.md§17.6.10.

getPlayerListIcons() -> array

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

The names of the status icons of the player list as an array. Borne numbers them and has no names, so it is empty.

temp.icons = getplayerlisticons();

Specification: client-rendering.md§7.5.

getpremiumoption() -> string

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the premium option of the account; always an empty text.

echo(getpremiumoption());

Specification: standard-library.md§17.5.6.

getprocesscpuusage() -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the busy share (0 to 1) of the server simulation thread over the previous minute; multiply by 100 for a percentage.

echo(getprocesscpuusage());

Specification: standard-library.md§17.4.9.

getprocessuptime() -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns the whole seconds since the server started.

echo(getprocessuptime());

Specification: standard-library.md§17.4.9.

getResolutionList() -> array

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The fullscreen sizes of the monitor as “WxH” strings, smallest first.

echo(getResolutionList());

Specification: client-rendering.md§4.11.

getservername() -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the server name from the Server Options; the same as servername.

echo(getservername());

Specification: standard-library.md§17.4.9.

getstring(name: string) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Reads the variable whose full name is given (legacy name of makevar(name)).

echo(getstring("this.zz"));

Specification: standard-library.md§17.6.8.

getstringkeys(prefix: string) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the rest of the name of every variable whose full name, prefix included, starts with the given text, sorted by bytes.

temp.keys = getstringkeys("this.slot_");

Specification: standard-library.md§6.3.

getsupportedgraalversions() -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the client versions the server supports, as text (the legacy answer).

echo(getsupportedgraalversions());

Specification: standard-library.md§17.6.11.

gettextheight(size: number, font: string, style: string) -> number

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the height in pixels of one line of text at a size.

echo(gettextheight(14, "", ""));

Specification: standard-library.md§17.5.3.

gettextwidth(size: number, font: string, style: string, text: string) -> number

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the width in pixels of a text at a size. The font name is accepted and not used; the style holds letters such as b for bold.

echo(gettextwidth(14, "", "", "Hello"));

Specification: standard-library.md§17.5.3.

gettileset() -> string

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the tileset image of the current level, after the tile definitions.

echo(gettileset());

Specification: world-and-objects.md§20.7.

gettilesettype() -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Returns the number of the tile type table of the current level, after the tile definitions.

echo(gettilesettype());

Specification: world-and-objects.md§20.7.

getutctime() -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the whole seconds since 1970.

echo(getutctime());

Specification: standard-library.md§17.3.7.

getz(x?: number, y?: number) -> number

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns the height of a position; always 0 because the terrain is flat.

echo(getz(10, 12));

Specification: standard-library.md§17.5.6.

ghostsnear: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no. read-only.

Always false: the engine has no ghosts.

echo(ghostsnear);

Specification: world-and-objects.md§20.7.

graalversion: number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

The legacy client version number; 0 on the legacy server.

echo(graalversion);

Specification: standard-library.md§17.6.11.

gravity: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

The pull on flying objects, 9.8 by default. A weaker pull keeps them up longer and 0 keeps them up for good.

gravity = 4;

Specification: world-and-objects.md§20.7.

GuiAccordionCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. A row of pictures; the selected row opens the free width after its picture, where the children are shown.

new GuiAccordionCtrl("Panels") { width = 300; height = 40; }

Specification: gui-legacy.md§24.

GuiBitmapBorderCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Panel framed by a 3x3 bitmap border, stretched or tiled along the edges.

new GuiBitmapBorderCtrl("Frame") { width = 120; height = 80; }

Specification: gui.md§3.

GuiBitmapButtonCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Button drawn with images, with variants for hover, pressed and inactive states.

new GuiBitmapButtonCtrl("Play") { bitmap = "btn_play"; }

Specification: gui.md§3.

GuiBitmapCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Shows an image.

new GuiBitmapCtrl("Logo") { bitmap = "logo.png"; }

Specification: gui.md§3.

GuiButtonCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Push button with a text; raises onAction when clicked.

new GuiButtonCtrl("MainButton") { text = "Click"; }
// function MainButton.onAction() { player.chat = "Clicked!"; }

Specification: gui.md§3.

GuiCheckBoxCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Check box with a text; raises onAction when toggled.

new GuiCheckBoxCtrl("Sound") { text = "Sound on"; }

Specification: gui.md§3.

GuiContextMenuCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Pop-up menu; raises onSelect when the player picks an entry.

new GuiContextMenuCtrl("Context") { add("Copy", 1); }

Specification: gui.md§3.

GuiControl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Plain container control, the base of every other control type.

new GuiControl("Box") { width = 100; height = 50; }

Specification: gui.md§2.

GuiDrawingPanel

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Drawing surface for lines, text and images. On the server it renders in software and can save the result as a PNG.

new GuiDrawingPanel("Canvas") { width = 64; height = 64; }

Specification: gui.md§3.3.

GuiFrameSetCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Container that splits its area into frames the player can resize.

new GuiFrameSetCtrl("Frames") { columns = "0 100"; }

Specification: gui.md§3.

GuiGameCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. The game view: it draws nothing itself, and hiding it or clearing isrendering hides the world and the HUD. The client creates one at start under the legacy name of the game screen, and new also accepts the legacy type name.

new GuiGameCtrl("GameView") { isrendering = false; }

Specification: gui-legacy.md§28.

GuiMenuCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Menu bar.

new GuiMenuCtrl("Menu") { width = 300; }

Specification: gui.md§3.

GuiMLTextCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Multi-line text with markup tags for font, bold, italic, links and line breaks.

new GuiMLTextCtrl("Info") { text = "<b>Hello</b><br>world"; }

Specification: gui.md§3.

GuiMLTextEditCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Editable multi-line text.

new GuiMLTextEditCtrl("Notes") { width = 200; height = 100; }

Specification: gui.md§3.

GuiPopUpEditCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Drop-down list with a text field the player can type into.

new GuiPopUpEditCtrl("PickEdit") { add("Red", 1); }

Specification: gui.md§3.

GuiPopUpMenuCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Drop-down list; raises onSelect when the player picks an entry.

new GuiPopUpMenuCtrl("Pick") { add("Red", 1); add("Blue", 2); }

Specification: gui.md§3.

GuiProgressCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Progress bar filled from 0 to 1.

new GuiProgressCtrl("Loading") { value = 0.5; }

Specification: gui.md§3.

GuiRadioCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Radio button; only one button of the same group under the same parent is selected.

new GuiRadioCtrl("Easy") { text = "Easy"; groupnum = 1; }

Specification: gui.md§3.

GuiScrollCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Container that scrolls over the bounding box of its children, with horizontal and vertical scroll bars.

new GuiScrollCtrl("Scroll") { vScrollBar = "dynamic"; }

Specification: gui.md§3.

GuiShowImgCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Shows a show-image-like visual inside the GUI, with color, alpha, rotation and zoom.

new GuiShowImgCtrl("Icon") { image = "icon.png"; zoom = 2; }

Specification: gui.md§3.

GuiSliderCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Slider within a range; raises onAction while it moves.

new GuiSliderCtrl("Volume") { range = "0 100"; }

Specification: gui.md§3.

GuiSlideShowCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Pictures on a wheel that turns to the selected row, each with a reflection.

new GuiSlideShowCtrl("Slides") { width = 800; height = 600; }

Specification: gui-legacy.md§25.

GuiStartMenuCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. A context menu with a caption; its start-panel look comes from GUI styles.

new GuiStartMenuCtrl("Start") { text = "Games"; }

Specification: gui-legacy.md§27.1.

GuiStretchCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Container that scales its children from a virtual client size to its own size.

new GuiStretchCtrl("Stretch") { clientextent = "320 240"; }

Specification: gui.md§3.

GuiTabCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Row of tabs; raises onSelect when the player picks a tab.

new GuiTabCtrl("Tabs") { add("Items", 0); add("Skills", 1); }

Specification: gui.md§3.

GuiTaskbar

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. A plain control; its taskbar look comes from GUI styles.

new GuiTaskbar("Bar") { width = 640; height = 30; }

Specification: gui-legacy.md§27.2.

GuiTextCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Single-line text label.

new GuiTextCtrl("Label") { text = "Name:"; }

Specification: gui.md§3.

GuiTextEditCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Single-line text input; raises onAction when the player presses Enter.

new GuiTextEditCtrl("NameInput") { maxlength = 20; }

Specification: gui.md§3.

GuiTextEditSliderCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Number input with arrows to step the value within a range; raises onAction when the value changes.

new GuiTextEditSliderCtrl("Amount") { range = "0 10"; }

Specification: gui.md§3.

GuiTextListCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. List of rows with tab-separated columns; raises onSelect when the player picks a row.

new GuiTextListCtrl("List") { addrow(1, "Sword\t100"); }

Specification: gui.md§3.

GuiTreeViewCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Tree of nodes addressed by slash-separated paths; raises onSelect when the player picks a node.

new GuiTreeViewCtrl("Tree") { addnodebypath("Items/Swords", 1); }

Specification: gui.md§3.

GuiWindowCtrl

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Control type created with new; the optional argument names the control. Window with a title bar. Dragged by the title bar while canmove is true; its close button raises onClose, and the window hides when nothing handles that event.

new GuiWindowCtrl("MainWindow") {
text = "Hello";
canclose = true;
}

Specification: gui.md§3.

hash_hmac(algorithm: string, data: string, key: string) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the HMAC of the data as raw bytes; algorithms md5, sha1, sha256, sha384, sha512.

echo(base64encode(hash_hmac("sha256", "data", "key")));

Specification: standard-library.md§17.6.3.

hasright(rights: string, file: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

True when the player’s staff folder rules grant every letter of rights (r, w) on the file; players without staff rights hold none.

if (player.hasright("rw", "levels/start.nw")) echo("can edit");

Specification: rc-and-rights.md§4.

hasrightflag(flag: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

True when the player is staff and holds the right named by the legacy flag (warptoxy, updatelevel, NPC-Control, …).

if (player.hasrightflag("NPC-Control")) echo("staff");

Specification: rc-and-rights.md§4.

hasweapon(name: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns 1 when the player in scope, or the player it is called on, owns the weapon.

echo(hasweapon("Bow"));

Specification: world-and-objects.md§7.1.

headexists(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

1 when the image is in heads/ of the data root, else 0.

echo(headexists("zz.png"));

Specification: standard-library.md§17.6.7.

hextobin(hex: string) -> string

Runs on: server only. Origin: compatibility. Since: M8. Playground: yes.

Turns a hexadecimal string into the bytes it spells, half its length. An odd length drops the last digit; the first pair that is not two hex digits ends the text.

echo(hextobin("414243")); // ABC

Specification: standard-library.md§2.1.

hide()

Runs on: server and client. Origin: engine extension. Since: M8. Playground: no.

Hides this NPC. On the server the change replicates to every client; on the client it stays local and the next change from the server wins.

this.hide();

Specification: world-and-objects.md§20.8.

hideimg(index: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Removes the show image with the index. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

hideimg(300);

Specification: client-rendering.md§8.1.

hideimgs(first: number, last: number)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Removes the show images from the first index to the last, both included. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

hideimgs(300, 310);

Specification: client-rendering.md§8.1.

hidelocal()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Stops drawing this NPC on this client, whatever its visible field says.

this.hidelocal();

Specification: world-and-objects.md§20.8.

hideplayer(seconds: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Stops drawing the local player’s body for the given seconds, at most 3600. Other players still see it.

hideplayer(2);

Specification: player-api.md§2.11.

hidesword(seconds: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Stops drawing the local player’s sword for the given seconds, at most 3600.

hidesword(2);

Specification: player-api.md§2.11.

hitobjects(x: number, y: number, power: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Its behavior is not confirmed yet (OQ-PLAYER-10): the call reports R-NOT-IMPLEMENTED once and does nothing.

hitobjects(30, 30, 1);

Specification: player-api.md§12.

inet_aton(ip: string) -> number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Packs an IPv4 address into an integer, first octet in the lowest byte; 0 when malformed.

echo(inet_aton("192.168.1.1")); // 16885952

Specification: standard-library.md§17.6.4.

inet_ntoa(n: number) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Converts the 32-bit integer made by inet_aton back to an IPv4 address.

echo(inet_ntoa(16885952)); // 192.168.1.1

Specification: standard-library.md§17.6.4.

insertstring(list: any, index: number, value: any) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Inserts a value before the given position of the list held in the variable given as first argument; a position at or past the end appends it.

insertstring(temp.names, 0, "Ann");

Specification: standard-library.md§5.2.

installedLanguages: string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The languages the client has text for, separated by commas.

echo(installedLanguages);

Specification: client-rendering.md§4.11.

int(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Rounds down to the nearest whole number, so negative values move away from zero.

echo(int(-3.7)); // -4

Specification: standard-library.md§3.

isAdminGuild(guild: string) -> boolean

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

True when the guild is one of the staff guilds the server named. Borne has no such list, so it is always false.

if (isadminguild("Staff")) echo("staff");

Specification: client-rendering.md§7.5.

isApplicationActive: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the game window has the focus.

echo(isApplicationActive);

Specification: client-rendering.md§4.11.

iscarrying: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

Always false: Borne has no liftable objects.

echo(iscarrying);

Specification: player-api.md§2.10.

isclassloaded(name: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when a class of that name is loaded.

echo(isclassloaded("mylib"));

Specification: standard-library.md§17.4.9.

iscursoron() -> boolean

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

True while the GUI cursor is on (the start state).

if (!iscursoron()) cursoron();

Specification: gui-legacy.md§26.2.

isdemoversion() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Always false: the client has no demo edition.

echo(isdemoversion());

Specification: standard-library.md§17.5.6.

isdownloading(name: string) -> number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Returns 1 while a file of that name is downloading or waits for its turn.

echo(isdownloading("map.png"));

Specification: web-and-files.md§3.2.

isdownloadingfiles() -> number

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Returns 1 while any file or web request is downloading or waiting.

echo(isdownloadingfiles());

Specification: web-and-files.md§3.3.

isfocused: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 while a custom focus set by setfocus is active, 0 otherwise.

echo(isfocused);

Specification: client-rendering.md§5.2.

isFullscreenMode() -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while the window is in a fullscreen mode.

echo(isFullscreenMode());

Specification: client-rendering.md§4.11.

isimgpixeltransparent(file: string, x: number, y: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns true when the pixel has no opacity; outside the image counts as transparent.

echo(isimgpixeltransparent("hat.png", 3, 4));

Specification: standard-library.md§17.5.2.

isimgrectangletransparent(file: string, x: number, y: number, width: number, height: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns true when every pixel of the rectangle, cut to the image, has no opacity.

echo(isimgrectangletransparent("hat.png", 0, 0, 8, 8));

Specification: standard-library.md§17.5.2.

isinclass(className: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when the object has joined the class and 0 otherwise.

if (isinclass("health_functions")) heal(5);

Specification: world-and-objects.md§6.3.

isipinranges(ranges: string, ip: string, computerid: number) -> number

Runs on: server only. Origin: compatibility. Since: M14. Playground: no.

True when the IPv4 address lies in one of the ranges (comma or space separated): 192.168.., 10.0.0-15.*, or a CIDR block. The third argument (a computer id, -1 to skip) has no effect.

if (isipinranges("192.168.*.*, 127.0.0.1", obj.ipaddress, -1)) echo("local");

Specification: web-and-files.md§8.11.

isleader: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True when no other player in the level has a lower id.

echo(isleader);

Specification: player-api.md§5.2.

ismusicplaying() -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Tells whether the music channel is playing.

if (ismusicplaying()) stopmusic();

Specification: client-rendering.md§10.2.

isobject(name: any) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when an object with the given name exists, or when the argument is itself a live object.

if (isobject("Counter")) echo("found");

Specification: standard-library.md§6.2.

isofflinemode() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Returns true when the client plays a world folder without a server.

if (isofflinemode()) echo("offline");

Specification: standard-library.md§17.5.6.

isonmap: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no. read-only.

True when the player is in a level of a world map.

echo(isonmap);

Specification: world-and-objects.md§20.7.

isOpenGL: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True when the client draws with OpenGL; always false in Borne.

echo(isOpenGL);

Specification: client-rendering.md§4.11.

ispremiumversion() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Always false: the client has no premium edition.

echo(ispremiumversion());

Specification: standard-library.md§17.5.6.

isRecordingVideo: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the client records a video; always false because Borne has no recorder.

echo(isRecordingVideo);

Specification: client-rendering.md§4.11.

issoundplaying(file: string) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Tells whether an instance of a sound file is still playing.

if (!issoundplaying("wind.ogg")) playlooped("wind.ogg");

Specification: client-rendering.md§10.2.

isStreamingVideo: string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The kind of stream the client sends, empty when none.

echo(isStreamingVideo);

Specification: client-rendering.md§4.11.

isstringutf8(text: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when the text is well-formed UTF-8; plain ASCII and the empty text are.

echo(isstringutf8("abc")); // 1

Specification: standard-library.md§17.3.2.

join(className: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Merges a registered class into the object: its functions are added after the ones the object already has, its top-level statements run in the context of the object, and then its onCreated runs. Returns 1 when the class was joined and 0 when it already was.

join("health_functions");

Specification: world-and-objects.md§6.1.

jpegQuality: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The quality of JPEG screenshots, 1 to 100.

jpegQuality = 80;

Specification: client-rendering.md§4.11.

keydown(key: number) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

1 while a key bound to the game key number is held: 0 up, 1 left, 2 down, 3 right, 4 weapon, 5 sword, 6 grab, 7 map, 8 chat, 9 inventory, 10 pause.

if (keydown(4)) echo("weapon key");

Specification: client-rendering.md§4.1.

keydown2(keycode: number) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

1 while any of the keys with the given virtual-key codes is held.

if (keydown2(65, 37)) echo("A or left");

Specification: client-rendering.md§4.1.

keyDown2Global(code: number, anymodifier?: boolean) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while the key with the given code is held. Modifier bits add to the code (0x100 shift, 0x200 ctrl, 0x400 alt); without the second argument the modifiers must match exactly.

echo(keyDown2Global(65 + 0x200, true));

Specification: client-rendering.md§4.11.

keyDownGlobal(action: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

True while the key bound to a game action is held, whatever has the focus.

if (keyDownGlobal(0)) echo("up");

Specification: client-rendering.md§4.11.

keyName(action: number) -> string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The name of the first key bound to a game action, empty when none.

echo(keyName(0));

Specification: client-rendering.md§4.11.

keyName2(code: number) -> string

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The name of a key code, empty for a code without a name.

echo(keyName2(65));

Specification: client-rendering.md§4.11.

lastdownloadfile: string

Runs on: client only. Origin: compatibility. Since: M14. Playground: no. read-only.

The name of the file that finished downloading last.

echo(lastdownloadfile);

Specification: web-and-files.md§3.5.

lay2(item: string, x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Its behavior is not confirmed yet (OQ-PLAYER-10): the call reports R-NOT-IMPLEMENTED once and does nothing.

lay2("bush", 30, 30);

Specification: player-api.md§12.

leave(className: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes a joined class from the object. Variables the class set stay. Returns 1 when the class was joined and 0 otherwise.

leave("health_functions");

Specification: world-and-objects.md§6.3.

leftmousebutton: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 while the left mouse button is held.

echo(leftmousebutton);

Specification: client-rendering.md§4.4.

leftMouseButtonGlobal: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the left mouse button is held, whatever has the focus.

echo(leftMouseButtonGlobal);

Specification: client-rendering.md§4.11.

levelexists(name: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

True when the level is loaded or its file can be read.

if (levelexists("town.nw")) echo("there");

Specification: world-and-objects.md§10.

levelorgx: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no. read-only.

The x position in tiles of the current level in its world map; 0 when it is on none.

echo(levelorgx);

Specification: world-and-objects.md§20.7.

levelorgy: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no. read-only.

The y position in tiles of the current level in its world map; 0 when it is on none.

echo(levelorgy);

Specification: world-and-objects.md§20.7.

lighteffectsenabled: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 when the light effects option is on.

echo(lighteffectsenabled);

Specification: client-rendering.md§11.

loadclass(name: string)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Asks for a class to be ready before a script needs it. The classes of a script arrive with its signed manifest, so the call is accepted and does nothing.

loadclass("mylib");

Specification: networking.md§8.

loadingScreenEnabled: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Whether the loading panel shows while files download.

loadingScreenEnabled = 0;

Specification: client-rendering.md§4.11.

loadlines(path: string) -> array

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the lines of a file, accepting LF and CRLF endings. As a method, temp.lines.loadlines(path) sets the variable.

temp.lines.loadlines("databases/list.txt");

Specification: standard-library.md§12.2.

loadmap(name: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Loads the gmap with the name, with or without the .gmap extension, so warps into it work. Returns 1 when the map exists and 0 otherwise.

echo(loadmap("world"));

Specification: world-and-objects.md§3.5a.

loadstring(path: string) -> string

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the whole file as a string. As a method, temp.s.loadstring(path) sets the variable.

temp.s.loadstring("databases/note.txt");

Specification: standard-library.md§12.2.

log(base: number, value: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the logarithm of value in the given base. A value or base that is not positive, or a base of 1, gives 0.

echo(log(2, 8)); // 3

Specification: standard-library.md§3.

lowercase(s: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Function form of the lower method: turns ASCII capital letters into small ones.

echo(lowercase("ABC")); // abc

Specification: standard-library.md§2.1.

makescreenshot2(file: string, flags?: number, levelx?: number, levely?: number, levelz?: number, width?: number, height?: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Saves the frame as drawn to a PNG file in the screenshots folder of the config area, after the next frame. Flags and the level position are accepted and not used; width and height resize the picture.

makescreenshot2("view", 0, 0, 0, 0, 640, 480);

Specification: standard-library.md§17.5.4.

makescreenshotfull(file: string, width?: number, height?: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Saves the whole frame to a PNG file in the screenshots folder of the config area; a width and height resize it.

makescreenshotfull("full", -1, -1);

Specification: standard-library.md§17.5.4.

makescreenshotgame(file: string, flags?: number, width?: number, height?: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Saves the frame to a PNG file in the screenshots folder of the config area; flags are accepted and not used, a width and height resize it.

makescreenshotgame("game", 0, 640, 480);

Specification: standard-library.md§17.5.4.

makevar(fullName: string, value?: any) -> any

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Reads the variable named by a full name that includes its prefix. Together with a second argument it stores that value, which is the form the compiler uses for an assignment target.

makevar("temp.slot_" @ 3) = 5;

Specification: language.md§6.8.

matrixcreate(position: any, rotation: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Builds a matrix text px,py,pz,ax,ay,az,degrees from a position and a rotation.

temp.m = matrixcreate("1,2,3", "0,0,1,90");

Specification: standard-library.md§17.2.3.

matrixcreatefromeuler(euler: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Builds a matrix at the origin from a euler triple in radians.

temp.m = matrixcreatefromeuler("0,0,1.5708");

Specification: standard-library.md§17.2.3.

matrixmulpoint(matrix: any, point: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Moves a point by a matrix: rotation first, then position.

echo(matrixmulpoint(temp.m, "1,0,0"));

Specification: standard-library.md§17.2.3.

matrixmultiply(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Multiplies two matrices; the result applies the second first, then the first.

temp.m = matrixmultiply(temp.a, temp.b);

Specification: standard-library.md§17.2.3.

matrixmulvector(matrix: any, vector: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Rotates a vector by a matrix, ignoring its position.

echo(matrixmulvector(temp.m, "1,0,0"));

Specification: standard-library.md§17.2.3.

max(a: number, b: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the larger of two numbers.

echo(max(2, 5)); // 5

Specification: standard-library.md§3.

md5(s: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the MD5 digest of the text as 32 lowercase hexadecimal digits.

echo(md5("abc"));

Specification: standard-library.md§2.1.

message(text: string) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the chat text of the NPC.

this.message("Hello");

Specification: world-and-objects.md§11.4.

middlemousebutton: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 while the middle mouse button is held.

echo(middlemousebutton);

Specification: client-rendering.md§4.4.

middleMouseButtonGlobal: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the middle mouse button is held, whatever has the focus.

echo(middleMouseButtonGlobal);

Specification: client-rendering.md§4.11.

min(a: number, b: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the smaller of two numbers.

echo(min(2, 5)); // 2

Specification: standard-library.md§3.

minFileCacheSize: number

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Files smaller than this many bytes stay in memory. Never negative, 0 by default. Stored.

minfilecachesize = 1024;

Specification: client-rendering.md§7.5.

mouseButtons: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The held mouse buttons as bits (1 left, 2 middle, 4 right) while the game has the focus, otherwise 0.

echo(mouseButtons);

Specification: client-rendering.md§4.11.

mouseButtonsGlobal: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The held mouse buttons as bits: 1 left, 2 middle, 4 right.

echo(mouseButtonsGlobal);

Specification: client-rendering.md§4.11.

mousescreenx: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The mouse x in logical screen pixels.

echo(mousescreenx);

Specification: client-rendering.md§4.4.

mousescreeny: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The mouse y in logical screen pixels.

echo(mousescreeny);

Specification: client-rendering.md§4.4.

mousewheeldelta: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

Wheel steps turned in the current frame; positive is up.

echo(mousewheeldelta);

Specification: client-rendering.md§4.4.

mousex: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The mouse x in tiles of the current level.

echo(mousex);

Specification: client-rendering.md§4.4.

mousey: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The mouse y in tiles of the current level.

echo(mousey);

Specification: client-rendering.md§4.4.

move(dx: number, dy: number, time: number, options: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Moves the NPC by dx, dy tiles over time seconds. Options are a bit set: 1 no wall check, 2 stop at walls, 4 raise onMovementFinished at the end, 8 set dir from the movement, 16 add to the motion in progress. A time of zero or less moves at once.

this.move(4, 0, 2, 4);

Specification: world-and-objects.md§11.4.

movefile(from: string, to: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Moves a file inside the script file sandbox and replaces the destination. Returns 1 on success, 0 when the source is missing or a folder.

echo(movefile("databases/a.txt", "databases/b.txt"));

Specification: standard-library.md§12.2.

MovieClip

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Display object drawn on the screen. A clip shows an image, holds child clips at numbered depths, and can move, scale, rotate and fade. Created with new; a clip made without a parent clip is a root, and one made inside the initializer block of a clip becomes its child.

this.m = new MovieClip("Hud");
this.m.objectName = "hud.png";

Specification: movieclip.md§1.2.

MRandomGenerator

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Seeded random number source created with new; the optional argument is the seed, and the same seed gives the same sequence. Use randint and randfloat to draw from it.

temp.g = new MRandomGenerator(7);
echo(temp.g.randfloat() < 1);

Specification: standard-library.md§17.4.6.

musiclen() -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Length in seconds of the current music, or 0 without music.

echo(musiclen());

Specification: client-rendering.md§10.2.

musicpos() -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Position in seconds of the current music, or 0 without music.

echo(musicpos());

Specification: client-rendering.md§10.2.

n_(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M8. Playground: yes.

Returns the text unchanged: there is no translation table, as on the legacy server without one.

echo(n_("Hello"));

Specification: standard-library.md§3.

noplayeronwall(on: number)

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Lets the local player walk through walls on this client. Call it without an argument or with 1 to turn it on and with 0 to turn it off.

noplayeronwall(1);

Specification: world-and-objects.md§2.3.

npcs: npc[]

Runs on: client only. Origin: compatibility. Since: M8. Playground: no. read-only.

The NPCs of the level the script runs in (the NPC’s own level, otherwise the player’s), ordered by id.

for (temp.n: npcs) echo(temp.n.x);

Specification: world-and-objects.md§10.

onActionClientSide(...args: any)

Runs on: client only. Origin: compatibility. Since: M4. Playground: no.

Runs on the client part of a weapon or object when the server calls triggerclient for this player.

//#CLIENTSIDE
function onActionClientSide(cmd) {
echo(cmd);
}

Specification: networking.md§7.

onActionLeftMouse(x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the left button goes down over the game view, with the mouse position in tiles of the current level.

function onActionLeftMouse(x, y) {
echo("onActionLeftMouse");
}

Specification: player-api.md§11.1.

onActionMiddleMouse(x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the middle button goes down over the game view, with the mouse position in tiles of the current level.

function onActionMiddleMouse(x, y) {
echo("onActionMiddleMouse");
}

Specification: player-api.md§11.1.

onActionProjectile(...params: any)

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on the NPC a projectile landed on and on the weapon that shot it, with the parameters given when it was shot. On a CONTROL DB NPC it is onActionProjectile(x, y, params…) and runs for every shot that hits something or ends on a wall or the ground.

function onActionProjectile(kind) {
echo(kind);
}

Specification: world-and-objects.md§12.

onActionProjectile2(x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when a projectile ends on the ground, a wall or an object, unless disableactionprojectile2 is on.

function onActionProjectile2(x, y) {
echo("onActionProjectile2");
}

Specification: player-api.md§11.1.

onActionRightMouse(x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the right button goes down over the game view, with the mouse position in tiles of the current level.

function onActionRightMouse(x, y) {
echo("onActionRightMouse");
}

Specification: player-api.md§11.1.

onActionServerSide(...args: any)

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on the server part of a weapon or object when its client calls triggerserver; player is the caller. Check every argument: the client may send anything.

function onActionServerSide(cmd) {
if (cmd == "reward") player.coins = player.coins + 1;
}

Specification: networking.md§7.

onBind()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when bind succeeded; port holds the port.

function onBind() {
echo(this.port);
}

Specification: web-and-files.md§8.9.

onBindFailed()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when bind failed or the port is not allowed; error holds the reason.

function onBindFailed() {
echo(this.error);
}

Specification: web-and-files.md§8.9.

onClassLoaded(name: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the code of a class has arrived from the server; the argument is the class name.

function onClassLoaded(name) {
echo("loaded " @ name);
}

Specification: player-api.md§11.1.

onClose()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when its connection ended (legacy name of onDisconnected; both run).

function onClose() {
this.destroy();
}

Specification: web-and-files.md§8.9.

onConnect()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when its connection is open.

function onConnect() {
this.send("hello\n");
}

Specification: web-and-files.md§8.5.

onConnectFailed()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when the connection could not be opened; error holds the reason.

function onConnectFailed() {
echo(this.error);
}

Specification: web-and-files.md§8.5.

onConnectingToServer()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the client starts to connect to a server.

function onConnectingToServer() {
echo("onConnectingToServer");
}

Specification: client-rendering.md§4.11.

onControlKeyDown(keycode: number, key: string, scancode: number, window: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when Escape or a function key goes down and neither a GUI control nor the game took it.

function onControlKeyDown(keycode, key, scancode, window) {
echo(keycode);
}

Specification: client-rendering.md§4.11.

onControlKeyUp(keycode: number, key: string, scancode: number, window: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when Escape or a function key is released and neither a GUI control nor the game took it.

function onControlKeyUp(keycode, key, scancode, window) {
echo(keycode);
}

Specification: client-rendering.md§4.11.

onCreated()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Runs on an object after its script is created, loaded or reloaded, once the top-level statements ran.

function onCreated() {
setTimer(1);
}

Specification: world-and-objects.md§9.1.

onDestroy()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Runs on an object right before destroy() takes it away.

function onDestroy() {
echo("bye");
}

Specification: world-and-objects.md§9.2.

onDisconnected()

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket when the connection ended.

function onDisconnected() {
echo("closed");
}

Specification: web-and-files.md§8.5.

onDisconnectedFromServer()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the connection to the server ends.

function onDisconnectedFromServer() {
echo("onDisconnectedFromServer");
}

Specification: client-rendering.md§4.11.

onEmoticon(player: object, file: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when a player shows an emoticon.

function onEmoticon(player, file) {
echo("onEmoticon");
}

Specification: player-api.md§11.1.

onExternalStyleChanges(style: string)

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Raised when the external GUI style setting ($pref::video::externalguistyle) changes; the argument is the new value.

function onExternalStyleChanges(style) {
echo(style);
}

Specification: client-rendering.md§4.11.

onFileChunkReceived(name: string, received: number, total: number)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Runs on weapons and NPCs of the client after a part of a file arrived; total is the size of the file.

function onFileChunkReceived(name, received, total) {
echo(received / total);
}

Specification: web-and-files.md§3.8.

onFileDownloaded(name: string, size: number)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Runs on weapons and NPCs of the client when a file arrived complete; size is in bytes.

function onFileDownloaded(name, size) {
echo(name @ " " @ size);
}

Specification: web-and-files.md§3.8.

onFixedUpdate()

Runs on: server and client. Origin: engine extension. Since: M5. Playground: no.

Runs at every fixed tick on objects with keepalive on.

function onFixedUpdate() {
this.ticks++;
}

Specification: vm-and-coroutines.md§7.5.

onJoinedClassUpdated(classname: string)

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on the objects that joined a class when that class is saved again, with the class name.

function onJoinedClassUpdated(name) {
echo(name @ " changed");
}

Specification: world-and-objects.md§6.6.

onKeyPressed(keycode: number, key: string, scancode: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs on the client weapons and NPCs when a key goes down.

//#CLIENTSIDE
function onKeyPressed(code, key) {
if (key == "q") echo("q");
}

Specification: client-rendering.md§4.3.

onKeyReleased(key: string, scancode: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs on the client weapons and NPCs when a key goes up.

//#CLIENTSIDE
function onKeyReleased(key) {
echo(key);
}

Specification: client-rendering.md§4.3.

onLevelFileUpdated(name: string)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Runs on weapons and NPCs of the client when the server announced that a file changed.

function onLevelFileUpdated(name) {
echo(name);
}

Specification: web-and-files.md§3.8.

onLevelLoaded()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on the NPCs of a level once the level is loaded (on the server when it is read, on the client when its data arrived).

function onLevelLoaded() {
echo(this.level.name);
}

Specification: world-and-objects.md§3.2.

onLogMessage(text: string, red: number, green: number, blue: number, kind: string)

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Raised for every line written to the console since the last frame: the text, its colour (red, green, blue from 0 to 1) and the kind (empty for echo, “error”, “server”). Lines a handler writes are not raised again.

function onLogMessage(text, red, green, blue, kind) {
if (kind == "error") sendtorc(text);
}

Specification: client-rendering.md§7.5.

onMouseDown(button: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs on the client weapons and NPCs when a mouse button goes down over the game (left, right, middle or double). On a GUI control it runs with the control’s arguments instead.

//#CLIENTSIDE
function onMouseDown(button) {
if (button == "left") echo(mousex);
}

Specification: client-rendering.md§4.3.

onMouseUp(button: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs on the client weapons and NPCs when a mouse button goes up over the game. On a GUI control it runs with the control’s arguments instead.

//#CLIENTSIDE
function onMouseUp(button) {
echo(button);
}

Specification: client-rendering.md§4.3.

onMouseWheel(steps: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the wheel moved, after the up and down events. The steps are positive for up and negative for down.

function onMouseWheel(steps) {
echo("onMouseWheel");
}

Specification: player-api.md§11.1.

onMouseWheelDown(modifiers?: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs once per wheel step turned down, on the client weapons and NPCs or on the GUI control under the cursor.

//#CLIENTSIDE
function onMouseWheelDown() {
echo("down");
}

Specification: client-rendering.md§4.3.

onMouseWheelUp(modifiers?: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Runs once per wheel step turned up, on the client weapons and NPCs or on the GUI control under the cursor.

//#CLIENTSIDE
function onMouseWheelUp() {
echo("up");
}

Specification: client-rendering.md§4.3.

onMovementFinished()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on an NPC when a move() it started has reached its end.

function onMovementFinished() {
setani("idle", "");
}

Specification: world-and-objects.md§11.

onNewClient(client: object)

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a listening TSocket for each accepted connection; the argument is the new TSocket, also in clients.

function onNewClient(client) {
client.packagedelimiter = "\n";
}

Specification: web-and-files.md§8.9.

onOfflineModeStarted()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the client starts without a server.

function onOfflineModeStarted() {
echo("onOfflineModeStarted");
}

Specification: client-rendering.md§4.11.

onOpenInfoWindow()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Runs on client weapons and NPCs when the player presses F1 to open the game menu, also when disableinfowindow() turned the built-in menu off.

function onOpenInfoWindow() {
echo("F1 pressed");
}

Specification: client-rendering.md§4.9.

onOpenLogWindow()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the player opens the output window.

function onOpenLogWindow() {
echo("onOpenLogWindow");
}

Specification: client-rendering.md§4.11.

onOpenOptionsWindow()

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Runs on client weapons and NPCs when the player presses F3 to open the options, also when disableoptionswindow() turned the built-in menu off.

function onOpenOptionsWindow() {
// open a scripted options window here
}

Specification: client-rendering.md§4.9.

onOpenPlayerList()

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Runs on client weapons and NPCs when the player presses F7 to open the player list, also when disableplayerlist() turned the built-in list off.

function onOpenPlayerList() {
// show a scripted player list here
}

Specification: client-rendering.md§4.9.

onOpenServerList()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the player goes back to the server list.

function onOpenServerList() {
echo("onOpenServerList");
}

Specification: client-rendering.md§4.11.

onPathFound()

Runs on: server and client. Origin: compatibility. Since: M10. Playground: no.

Runs on the request object of findpathasync when the path search finished.

function onPathFound() {
echo(this.path.size());
}

Specification: world-and-objects.md§9.3.

onPlayAnimation(player: object, gani: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when a player starts a gani.

function onPlayAnimation(player, gani) {
echo("onPlayAnimation");
}

Specification: player-api.md§11.1.

onPlayerChanges(player: object, id: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the nickname, guild or look (head, body, sword, shield, colors) of another player changed; the arguments are the player and its number.

function onPlayerChanges(player, id) {
echo("changed " @ id);
}

Specification: player-api.md§11.1.

onPlayerChats()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs when a player sends chat; player.chat holds the text. The server raises it on the NPCs of that player’s level, the client on its NPCs and weapons.

function onPlayerChats() {
if (player.chat == "hello") echo("greeted");
}

Specification: world-and-objects.md§9.3.

onPlayerEndsReading()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when a sign message in the sign box closes.

function onPlayerEndsReading() {
echo("onPlayerEndsReading");
}

Specification: player-api.md§11.1.

onPlayerEnters()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on each NPC of a level when a player enters that level, with that player as player. On the client it runs for the local player.

function onPlayerEnters() {
player.chat = "Hi!";
}

Specification: world-and-objects.md§9.3.

onPlayerLanguageChanges(player: object, language: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the language setting changes.

function onPlayerLanguageChanges(player, language) {
echo(language);
}

Specification: client-rendering.md§4.11.

onPlayerLeaves()

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on the server on each NPC of a level when a player leaves it, with that player as player.

function onPlayerLeaves() {
echo(player.account @ " left");
}

Specification: world-and-objects.md§9.3.

onPlayerLogin(player: object)

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on every server script that declares it (database NPCs, then NPCs of the loaded levels, then weapon server parts) each time a player logs in, after the player is placed in its level. The argument is the player object, also in scope as player. Give starting weapons and join player classes here.

function onPlayerLogin(pl) {
pl.chat = "Joined the server.";
pl.addweapon("grab");
}

Specification: world-and-objects.md§9.4.

onPlayerLogout(player: object)

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on every server script that declares it (database NPCs, NPCs of the loaded levels, weapon server parts) when a player logs out, while the player object still exists. The argument is the player object.

function onPlayerLogout(pl) {
echo(pl.account @ " left");
}

Specification: world-and-objects.md§9.4.

onPlayerShoots(player: object, projectile: object)

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on every server script that declares it (database NPCs, then NPCs of the loaded levels, then weapon server parts) when a player shoots, before the projectile first flies. The first argument is the shooter, also in scope as player; the second is the TProjectile. projectile.destroy() takes the shot out of the air.

function onPlayerShoots(pl, shot) {
echo(pl.account @ " shot " @ shot.params[0]);
}

Specification: world-and-objects.md§12.2.

onPlayerTouchsMe()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on an NPC when the box of a player starts touching it, with that player as player.

function onPlayerTouchsMe() {
say2("Welcome");
}

Specification: world-and-objects.md§11.3.

onPlayerTouchsOther(other: object)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the box of the local player starts to overlap another player.

function onPlayerTouchsOther(other) {
echo("onPlayerTouchsOther");
}

Specification: player-api.md§11.1.

onRCChat(cmd: string, params: array)

Runs on: server only. Origin: compatibility. Since: M4. Playground: no.

Runs on the database NPCs when an RC chat line starts with / and the engine has no command of that name. cmd is the word after /, params the rest split into words; player is the staff member when online.

function onRCChat(cmd, params) {
if (cmd == "ping") echo("pong");
}

Specification: world-and-objects.md§9.5.

onRCCommandKind(cmd: string) -> string

Runs on: server only. Origin: engine extension. Since: M11. Playground: no.

Raised on every database NPC that defines it before the MCP server runs an RC command. Returning “admin” (any case) marks the command as an admin action, and the MCP server refuses it. Any other result allows it. RC staff typing the command are not affected.

function onRCCommandKind(cmd) {
if (cmd == "ban") return "admin";
}

Specification: rc-and-rights.md§11.4 (OQ-RC-3).

onRCTabMessage(sender: object, tabName: string, message: string)

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

Runs on every server script that declares it when staff type in an RC tab that is not read-only. sender is the rc player of the typing session, tabName the tab name and message the text, which may start with a slash: in a script tab nothing is a server command. Name the parameter tabName, not tab (TAB is a keyword).

function onRCTabMessage(sender, tabName, message) {
if (tabName == "Borne Police" && message.starts("/jail ")) {
echo2("jail: " @ message, tabName);
}
}

Specification: rc-and-rights.md§10.7.

onReceiveData()

Runs on: server and client. Origin: compatibility. Since: M10. Playground: no.

Runs on a SQL or web request object when its answer arrived, and on a TSocket for each read (the bytes just read are the argument).

function onReceiveData() {
echo(this.completed);
}

Specification: standard-library.md§13.

onReceiveDataPackage(package: string)

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a TSocket for every complete package when packagedelimiter is set; the delimiter is not part of the package.

function onReceiveDataPackage(package) {
echo(package);
}

Specification: web-and-files.md§8.6.

onReceivePing(time: number)

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Raised on the request object that sendping returned when the client answered; time is the round trip in milliseconds. Use catchevent on the request or define function request.onReceivePing(time).

function request.onReceivePing(time) {
echo("ping " @ time @ " ms");
}

Specification: player-api.md§5.1.

onReceiveUDPData(data: string, ip: string, port: number)

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Runs on a UDP TSocket for each datagram: the bytes, the sender address and port.

function onReceiveUDPData(data, ip, port) {
echo(ip);
}

Specification: web-and-files.md§8.9.

onRemoteControlLogin(rc: object)

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

Runs on every server script that declares it (database NPCs, then NPCs of the loaded levels, then weapon server parts) when a staff member logs in to the RC, once per session. The argument is the rc player of that session, also usable with findrc: the account’s player in memory, outside every level. Open script tabs here with rc.addtab.

function onRemoteControlLogin(rc) {
if (rc.clientr.isPoliceStaff) {
temp.t = new RCTab("Borne Police");
rc.addtab(temp.t);
}
}

Specification: rc-and-rights.md§10.7.

onRemotePlayerChats(player: object, text: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when the chat text of another player changed.

function onRemotePlayerChats(player, text) {
echo("onRemotePlayerChats");
}

Specification: player-api.md§11.1.

onRemoved()

Runs on: server and client. Origin: compatibility. Since: M4. Playground: no.

Runs on an object taken out of its level without being destroyed, for example when the level unloads or its NPC changed in the file.

function onRemoved() {
echo("removed");
}

Specification: world-and-objects.md§9.2.

onServerLogin()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the server lets the player in.

function onServerLogin() {
echo("onServerLogin");
}

Specification: client-rendering.md§4.11.

onTimeout()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: no.

Runs when the timer started with setTimer runs out. Set the timer again inside it to repeat.

function onTimeout() {
setTimer(0.05);
}

Specification: world-and-objects.md§9.3.

onToggleScriptedPlayerList()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Raised when the player asks for the list of players while a script owns that list.

function onToggleScriptedPlayerList() {
echo("onToggleScriptedPlayerList");
}

Specification: client-rendering.md§4.11.

onUpdate()

Runs on: client only. Origin: engine extension. Since: M5. Playground: no.

Runs every frame on objects with keepalive on.

//#CLIENTSIDE
function onUpdate() {
this.frames++;
}

Specification: vm-and-coroutines.md§7.5.

onwall(x: number, y: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns 1 when the point is blocked for walking: tile type 20 or 22, inside the shape of an NPC that blocks (not after dontblock) or on another player. The calling NPC or player does not block itself.

echo(onwall(this.x, this.y));

Specification: world-and-objects.md§2.3.

onwall2(x: number, y: number, width: number, height: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns 1 when any point of the rectangle is blocked for walking, by a tile, a blocking NPC or another player.

echo(onwall2(10, 10, 2, 2));

Specification: world-and-objects.md§2.3.

onwallpath(x: number, y: number, width: number, height: number, dx: number, dy: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns 1 when a box moved by (dx, dy) meets a blocked tile or NPC shape on the way.

echo(onwallpath(30, 30, 1, 1, 2, 2));

Specification: standard-library.md§17.6.

onWasShot()

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Raised when a shot from another player hits the local player. shotbyplayer is true while it runs.

function onWasShot() {
echo("onWasShot");
}

Specification: player-api.md§11.1.

onwater(x: number, y: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns 1 when the tile type at the point is 8 or 11.

echo(onwater(10, 10));

Specification: world-and-objects.md§2.3.

onwater2(x: number, y: number, width: number, height: number) -> boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Returns true when any tile of the rectangle is water.

echo(onwater2(10, 10, 2, 2));

Specification: player-api.md§9.4.

onwaterpath(x: number, y: number, width: number, height: number, dx: number, dy: number) -> boolean

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Returns 1 when a box moved by (dx, dy) crosses a water tile on the way.

echo(onwaterpath(30, 30, 1, 1, 2, 2));

Specification: standard-library.md§17.6.

openurl(url: string)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Opens a web address in the default browser of the player’s system. Only http and https addresses are accepted.

openurl("https://example.com/help");

Specification: web-and-files.md§7.1.

openurl2(url: string, width: number, height: number)

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Like openurl; the window size is ignored.

openurl2("https://example.com/help", 800, 600);

Specification: web-and-files.md§7.1.

parsejson(target: object, json: string)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Reads JSON text into the variables of an object; the same as object.loadjsonfromstring.

parsejson(temp.o, "{\"a\":1}");

Specification: standard-library.md§17.3.6.

particleeffectsenabled: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 when the particle effects option is on.

echo(particleeffectsenabled);

Specification: client-rendering.md§11.

pi: number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes. read-only.

The constant 3.141592653589793.

echo(pi);

Specification: language.md§4.3.

play(file: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Plays a sound file once, heard the same everywhere. A long OGG or MP3 file starts the music channel instead.

play("chime.wav");

Specification: client-rendering.md§10.2.

play2(file: string, x: number, y: number, volume: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Plays a sound file once at a world position. The volume falls off to silence 16 tiles from the camera center and pans by the horizontal offset.

play2("splash.wav", x, y, 1);

Specification: client-rendering.md§10.2.

play3d(file: string, loop: number, position: string, velocity?: string)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Plays a sound at a position in tiles written {x, y, z}. The second value says whether it loops; height and velocity are accepted and not used.

play3d("wind.wav", 1, "{20, 30, 0}", "{0, 0, 0}");

Specification: standard-library.md§17.5.1.

playerblocking(on: number)

Runs on: client only. Origin: engine extension. Since: M12. Playground: no.

Decides whether the other players count as walls for onwall and onwall2 on this client. Call it without an argument or with 1 to turn it on (the default) and with 0 to turn it off.

playerblocking(0);

Specification: world-and-objects.md§2.3.

players: player[]

Runs on: server only. Origin: compatibility. Since: M8. Playground: no. read-only.

The players of the level a level NPC stands in; every online player in weapons, DB NPCs and classes.

for (temp.pl: players) echo(temp.pl.account);

Specification: world-and-objects.md§10.

playlooped(file: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Plays a sound file again and again until it is stopped.

playlooped("wind.ogg");

Specification: client-rendering.md§10.2.

playlooped2(file: string, x: number, y: number, volume: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Plays a sound file in a loop at a world position until it is stopped.

playlooped2("fire.wav", x, y, 0.8);

Specification: client-rendering.md§10.2.

popalldialogs() -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Removes every dialog.

popAllDialogs();

Specification: gui.md§7.

popdialog() -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Removes the top dialog and raises onDialogPop.

popDialog();

Specification: gui.md§7.

pow(base: number, exponent: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Raises base to the exponent, the same as the ^ operator.

echo(pow(2, 10)); // 1024

Specification: standard-library.md§3.

preloadanimation(gani: string)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Loads the images a gani draws now and keeps them in memory until freeallresources.

preloadanimation("walk");

Specification: client-rendering.md§6.9.

preloadimage(file: string, keep?: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Loads an image now; with a true second argument it stays in memory until freeallresources.

preloadimage("hat.png", 1);

Specification: standard-library.md§17.5.2.

preloadleveldefaulttile: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

The tile used to fill a level while it loads, 0 by default; values from 0 to 4095.

preloadleveldefaulttile = 0;

Specification: world-and-objects.md§20.7.

printf(pattern: string, ...values?: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Formats its arguments like format and writes the result as one output line, the same way echo does.

printf("HP: %d", 12);

Specification: standard-library.md§2.3.

pushdialog(control: object) -> number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Shows a control as a modal dialog above everything and raises onDialogPush.

pushDialog(MainWindow);

Specification: gui.md§7.

putleaps(count: number, x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Its behavior is not confirmed yet (OQ-PLAYER-10): the call reports R-NOT-IMPLEMENTED once and does nothing.

putleaps(1, 30, 30);

Specification: player-api.md§12.

putnpc2(x: number, y: number, script: string) -> npc

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Creates a local NPC at x, y in the level of the caller and returns it. The script text runs as the NPC script once the calling script ends: top-level code first, then onCreated. A compile error is reported and the call returns empty; script text in the first, older script language is translated to the current language before it is compiled.

temp.n = putnpc2(10, 10, "function onCreated() { echo(1); }");

Specification: world-and-objects.md§5.2.

radtodeg(radians: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Converts radians to degrees.

echo(radtodeg(pi)); // 180

Specification: standard-library.md§3.

random(min: number, max: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns a pseudo-random number from min up to, not including, max, drawn from the generator of this script engine.

temp.roll = int(random(1, 7));

Specification: standard-library.md§3.

randomstring(length: number) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns a pseudo-random text of the given length made of letters and digits.

temp.code = randomstring(8);

Specification: standard-library.md§2.1.

rc4_cipher(key: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Encrypts or decrypts with RC4; the same call does both. An empty key or empty data gives an empty text.

temp.plain = rc4_cipher("key", rc4_cipher("key", "secret"));

Specification: standard-library.md§17.1.2.

RCTab(name: string) -> object

Runs on: server only. Origin: engine extension. Since: M14. Playground: no.

Makes a tab for the RC chat. Show it with rc.addtab. The name is one line of 1 to 64 bytes and is not RC Chat. Its readonly property is true by default; set it to false so staff can type in the tab. Use it as new RCTab(“Borne Police”).

temp.t = new RCTab("Borne Police");
temp.t.readonly = false;
rc.addtab(temp.t);

Specification: rc-and-rights.md§10.7.

reflectarrow(index: number)

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Turns the projectile at the index of the level projectile list around.

reflectarrow(0);

Specification: world-and-objects.md§20.6.

regexescape(str: string) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Puts a backslash in front of every character that has a special meaning in a pattern, so the text can be matched literally.

echo(regexescape("1+1")); // 1\\+1

Specification: standard-library.md§8.1.

regexfind(str: string, pattern: string, flags?: string) -> array

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns the first match as an array of the whole match followed by each group (unmatched groups are empty texts), or empty when nothing matches.

temp.m = regexfind("id=42", "(\\w+)=(\\d+)");

Specification: standard-library.md§8.1.

regexfindall(str: string, pattern: string, flags?: string) -> array

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns an array with one match array per non-overlapping match, left to right; an empty match moves on by one byte.

temp.all = regexfindall("a1b22", "\\d+");

Specification: standard-library.md§8.1.

regexfindpos(str: string, pattern: string, flags?: string) -> array

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns {start, length} of the first match in bytes, or empty when nothing matches.

temp.at = regexfindpos("hello", "l+");

Specification: standard-library.md§8.1.

regexmatch(str: string, pattern: string, flags?: string) -> number

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns 1 when the pattern matches anywhere in the text, otherwise 0. Flags are i ignores ASCII case, m lets ^ and $ work per line, s lets . match line breaks.

echo(regexmatch("abc", "b"));

Specification: standard-library.md§8.1.

regexreplace(str: string, pattern: string, replacement: string, flags?: string) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Replaces every match with the replacement text, where $0 is the whole match, $1 to $9 are groups, and $$ is a dollar sign.

echo(regexreplace("ab", "(a)(b)", "$2$1"));

Specification: standard-library.md§8.1.

regexsplit(str: string, pattern: string, flags?: string) -> array

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Cuts the text at every match and returns the parts, keeping empty parts at the ends and leaving groups out.

temp.parts = regexsplit("a, b,c", "\\s*,\\s*");

Specification: standard-library.md§8.1.

regextest(str: string, pattern: string, flags?: string) -> number

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Another name for regexmatch.

echo(regextest("abc", "^a"));

Specification: standard-library.md§8.1.

regexvalid(pattern: string) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns an empty text when the pattern compiles, otherwise the error message.

if (regexvalid("(a") != "") echo("bad");

Specification: standard-library.md§8.1.

removearrow(index: number)

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Takes the projectile at the index of the level projectile list out of the air.

removearrow(0);

Specification: world-and-objects.md§20.6.

removeescapesfromfilename(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M14. Playground: yes.

Reverses escapefilename.

echo(removeescapesfromfilename("a%032b")); // a b

Specification: web-and-files.md§2.4.

removeguild(guild: string)

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Clears the guild tag of every online player in the guild.

removeguild("Raven");

Specification: standard-library.md§17.6.

removestring(list: any, index: number) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes the first element equal to the value from the list held in the variable. The variable is given by name as a string, as in legacy scripts, or directly.

removestring("this.names", "Ann");

Specification: standard-library.md§5.2.

removetiledefs(start: string)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Forgets the tile definitions and overlays made on this client for the level names that start with the text. An empty text forgets nothing.

removetiledefs("cave");

Specification: world-and-objects.md§20.7.

removeweapon(name: string) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Removes the weapon from the list of the player in scope or of the player it is called on. Returns 1 when it was removed and 0 when the player did not have it.

player.removeweapon("Bow");

Specification: world-and-objects.md§7.1.

replaceani(default: string, replacement: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Makes the local player play another gani whenever the default one is set. An empty replacement removes the mapping.

replaceani("idle", "myidle");

Specification: world-and-objects.md§11.5.

replacestring(list: any, index: number, value: any) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Replaces the element at the given position of the list held in the variable given as first argument; a position outside the list changes nothing.

replacestring(temp.names, 1, "Bob");

Specification: standard-library.md§5.2.

requestcurl(url: string) -> curlrequest

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Creates a TCURLRequest for url, sends it as a GET, and returns it. The host must be in Server Options httpallowlist; otherwise the request completes at once with returncode 0 and an error. It fires onReceiveData when finished.

temp.req = requestcurl("https://api.example.com/time"); waitfor(temp.req, "onReceiveData", 30); echo(temp.req.data);

Specification: standard-library.md§14.1.

requesthttp(host: string, port: number, file: string) -> httprequest

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Like requesturl, for a host, a port, and a file. Port 443 uses https, any other port http.

temp.r = requesthttp("example.com", 443, "/news.txt");

Specification: web-and-files.md§4.4.

requestsql(sql: string, expectResult: boolean, bindings?: array) -> sqlrequest

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Starts a statement on the default database databases/default.sqlite and returns a TSQLRequest at once. With expectResult true the rows arrive in rows; an optional array binds its values to the ? placeholders in order, which is the safe way to put script text into a statement. The request fires onReceiveData when it finishes; a failed statement sets error and raises no script error. One object may have 64 pending requests.

temp.req = await requestsql("SELECT price FROM items WHERE name = ?", true, {temp.itemName}); echo(temp.req.rows[0][0]);

Specification: standard-library.md§13.2.

requestsql2(dbName: string, sql: string, expectResult: boolean, bindings?: array) -> sqlrequest

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Like requestsql, on the database databases/.sqlite, created on first use. Names use letters, digits, _ and -, at most 64 characters, and are matched without regard to case.

temp.req = requestsql2("stats", "INSERT INTO visits(level) VALUES (?)", false, {player.level}); waitfor(temp.req, "onReceiveData", 5);

Specification: standard-library.md§13.1.

requesturl(url: string) -> httprequest

Runs on: server and client. Origin: compatibility. Since: M14. Playground: no.

Starts a GET request for a web address and returns the request object, or the empty value for an address that is not http or https. On the server the host must be in Server Options httpallowlist; on a client the server makes the request for the player and only when Server Option clienthttp is true. A second call for the same address returns the same object; a finished one is sent again. onReceiveData fires on the object when the answer arrived.

temp.r = requesturl("https://example.com/news.txt"); waitfor(temp.r, "onReceiveData", 15); echo(temp.r.fulldata);

Specification: web-and-files.md§4.4.

requesturlasgamefile(url: string, name: string, modtime: number, force: number) -> httprequest

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

Fetches a web address through the server and keeps the answer as a game file under a name, as if the server had sent it. Only image, sound, and gani names are accepted. Returns the request object, or the empty value when the name or address was refused. onFileDownloaded fires when the file is in place.

requesturlasgamefile("https://example.com/logo.png", "logo.png", 0, false);

Specification: web-and-files.md§4.8.

resetfocus()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Gives the camera back to the player after setfocus.

resetfocus();

Specification: client-rendering.md§5.2.

resetimageanimation(image: string)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Sets an image animation back to its first frame. Images never animate on Borne, so it does nothing.

resetimageanimation("loader.gif");

Specification: client-rendering.md§6.9.

resolvehost(name: string) -> string

Runs on: server only. Origin: compatibility. Since: M14. Playground: no.

Returns the IPv4 address of a host name as text, or an empty string. Only hosts of Server Options httpallowlist are resolved; the call waits at most half a second and a slow answer is kept for the next call.

echo(resolvehost("example.com"));

Specification: web-and-files.md§5.3.

rightmousebutton: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

1 while the right mouse button is held.

echo(rightmousebutton);

Specification: client-rendering.md§4.4.

rightMouseButtonGlobal: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the right mouse button is held, whatever has the focus.

echo(rightMouseButtonGlobal);

Specification: client-rendering.md§4.11.

rotationadd(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Combines two rotations written x,y,z,degrees: the first applied, then the second.

echo(rotationadd("0,0,1,90", "0,0,1,90"));

Specification: standard-library.md§17.2.2.

rotationaddeuler(rotation: any, euler: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Applies a euler triple (radians) after a rotation and returns the combined rotation.

echo(rotationaddeuler("0,0,1,90", "0,0.5,0"));

Specification: standard-library.md§17.2.2.

rotationfromeuler(euler: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Converts a euler triple in radians to a rotation x,y,z,degrees.

echo(rotationfromeuler("0,0,1.5708"));

Specification: standard-library.md§17.2.2.

rotationsub(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Removes the second rotation from the first.

echo(rotationsub("0,0,1,180", "0,0,1,90"));

Specification: standard-library.md§17.2.2.

rotationtoeuler(rotation: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Converts a rotation to a euler triple in radians.

echo(rotationtoeuler("0,0,1,90"));

Specification: standard-library.md§17.2.2.

round(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Rounds to the nearest whole number; values exactly between two whole numbers move away from zero.

echo(round(2.5)); // 3

Specification: standard-library.md§3.

rsa_decrypt(privatekey: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M13. Playground: yes.

Decrypts a block with a private RSA key (DER, PKCS#1 or PKCS#8) and removes the type 2 padding. Empty when the key or the padding is wrong.

temp.m = rsa_decrypt(privatekey, temp.c);

Specification: standard-library.md§17.1.5.

rsa_encodesignature(hash: string) -> string

Runs on: server and client. Origin: compatibility. Since: M13. Playground: yes.

Wraps a SHA-1 digest in the DER DigestInfo structure that rsa_sign signs. Empty for an empty digest or one over 74 bytes.

temp.d = rsa_encodesignature(sha1hash);

Specification: standard-library.md§17.1.5.

rsa_encrypt(publickey: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M13. Playground: yes.

Encrypts data with a public RSA key (DER, RSAPublicKey or SubjectPublicKeyInfo) using PKCS#1 type 2 padding. Empty when the key cannot be read or the data is longer than the key size minus 11.

temp.c = rsa_encrypt(publickey, "secret");

Specification: standard-library.md§17.1.5.

rsa_generateprivatekey(bits: number, exponent: number) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Makes a PKCS#1 RSA private key (DER) of the given even bit length (256 to 2048) and public exponent.

temp.k = rsa_generateprivatekey(512, 65537);

Specification: standard-library.md§17.6.12.

rsa_getpublickey(privateKey: string) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the PKCS#1 RSA public key (DER) of a private key; empty when unreadable.

temp.p = rsa_getpublickey(temp.k);

Specification: standard-library.md§17.6.12.

rsa_sign(privatekey: string, data: string) -> string

Runs on: server and client. Origin: compatibility. Since: M13. Playground: yes.

Signs data with a private RSA key using PKCS#1 type 1 padding; the data is usually the result of rsa_encodesignature. Empty when the key cannot be read or the data is too long.

temp.s = rsa_sign(privatekey, rsa_encodesignature(sha1hash));

Specification: standard-library.md§17.1.5.

rsa_verify(publickey: string, message: string, signature: string) -> boolean

Runs on: server and client. Origin: compatibility. Since: M13. Playground: yes.

True when the signature, opened with the public key, holds exactly the message.

if (rsa_verify(publickey, message, signature)) echo("ok");

Specification: standard-library.md§17.1.5.

rungarbagecollector()

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Runs a full collection of unreachable arrays and objects now.

rungarbagecollector();

Specification: standard-library.md§17.4.9.

saveaccount() -> any

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

Saves the player now. On a TServerPlayer of an offline account it writes the copy to the account.

temp.p = new TServerPlayer(acct);
if (temp.p.offline) temp.p.saveaccount();

Specification: player-api.md; world-and-objects.md§4.8.

savelevel(level: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Writes a loaded level to its file at once. Returns 1 when the file is up to date afterwards, 0 when the level is not loaded or cannot be written. The server also saves changed boards every 30 seconds, before it unloads a level and when it stops.

echo(savelevel("start.nw"));

Specification: standard-library.md§17.6.

savelog(message: string) -> number

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Appends a line with a UTC timestamp to logs/script.log.

savelog("quest started");

Specification: standard-library.md§12.2.

savelog2(file: string, message: string) -> number

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Appends a line with a UTC timestamp to logs/.

savelog2("quests.log", "quest started");

Specification: standard-library.md§12.2.

say(index: number)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Shows the text of the sign with that number in the current level in the sign box. It does nothing while paused or for a number the level lacks.

say(0);

Specification: player-api.md§6.2.

say2(text: string)

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Shows a message in the sign box. On the server it acts on the player the call is made on (player.say2()) or the player in scope, and that player’s client does it.

say2("Welcome!");

Specification: world-and-objects.md§11.5.

scheduleevent(delay: number, event: string, ...args?: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Runs the event onName with the given arguments once, after the delay in seconds. An object can have any number of independent entries; due entries run in time order, ties in scheduling order.

scheduleevent(0.5, "Hit", 5);

Specification: vm-and-coroutines.md§7.3.

screenheight: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The window height in logical pixels.

echo(screenheight);

Specification: client-rendering.md§3.1.

screenPixelScale: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The number of device pixels in a logical pixel as the script sees it; always 1.

echo(screenPixelScale);

Specification: client-rendering.md§4.11.

screenwidth: number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

The window width in logical pixels.

echo(screenwidth);

Specification: client-rendering.md§3.1.

screenX(x: number, y: number) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The screen column in logical pixels of a position in tiles of the level, -1 without a player.

echo(screenX(player.x, player.y));

Specification: client-rendering.md§4.11.

screenY(x: number, y: number) -> number

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The screen row in logical pixels of a position in tiles of the level, -1 without a player.

echo(screenY(player.x, player.y));

Specification: client-rendering.md§4.11.

scriptedControls: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while scripts have put controls on the screen.

echo(scriptedControls);

Specification: client-rendering.md§4.11.

scriptedPlayerList: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no. read-only.

True while the built-in player list is turned off, so a script owns the list.

echo(scriptedPlayerList);

Specification: client-rendering.md§4.11.

selectedListPlayers: player[]

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

The player objects a script has marked as selected in its player list.

selectedListPlayers = {player};

Specification: client-rendering.md§4.11.

selectedsword: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

A number the script stores; the engine does not use it.

selectedsword = 2;

Specification: player-api.md§2.8.

selectedweapon: number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The position of the selected weapon in the weapons array, or -1. Writing a position selects that weapon.

selectedweapon = 0;

Specification: player-api.md§2.7.

sendrpgmessage(text: string)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Writes the text to the script log, like trace. On the server it acts on the player the call is made on (player.sendrpgmessage()) or the player in scope, and that player’s client does it.

sendrpgmessage("hello");

Specification: player-api.md§9.5.

sendtonc(text: string) -> any

Runs on: server only. Origin: compatibility. Since: M8. Playground: no.

Sends a line to the NPC-Control chat; here that is the RC chat.

sendtonc("npc ready");

Specification: standard-library.md§11.

sendtorc(text: string) -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Sends a line to the RC chat of staff only.

sendtorc("quest finished");

Specification: standard-library.md§11.

servername() -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the server name from the Server Options. It can be read with or without parentheses.

echo(servername);

Specification: standard-library.md§17.

set(name: string)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Sets the variable whose full name is given to 1.

set("this.q");

Specification: standard-library.md§17.6.8.

setani(ani: string, params: string)

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Starts a gani on the local player. The parameters are a comma separated list that fills the PARAM slots. Setting the same name again restarts it unless the gani is continuous.

player.setani("sword", "");

Specification: client-rendering.md§9.1.

setarray(var: array, count: number) -> array

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Makes the variable an array of count elements (0 in new ones).

setarray(this.arr, 3);

Specification: standard-library.md§17.6.9.

setbeltcolor(color: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Sets the belt color of the local player and tells the server.

setbeltcolor("blue");

Specification: player-api.md§4.4.

setbody(file: string) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the body image of the player. The name must be a plain file name; anything else reports R-FILE-ACCESS.

player.setbody("body2.png");

Specification: world-and-objects.md§11.5.

setbow(image: string)

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Sets the bow image this NPC shows when it is drawn as a character on this client.

this.setbow("bow.png");

Specification: world-and-objects.md§20.8.

setcharani(ani: string, param: string) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Plays an animation on the NPC. The name and the parameter are stored on the NPC.

this.setcharani("idle", "");

Specification: world-and-objects.md§11.1.

setcharprop(code: string, value: any)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Sets a property by its legacy code on the NPC (this): “#c” chat, “#n” nick, “#g” guild (player only), “#1” sword image, “#2” shield image, “#3” head image, “#5” horse image (player only), “#8” body image, “#C” color number n, “#P” attribute number n. A code without a property for that owner does nothing.

setcharprop("#n", "Guard");

Specification: world-and-objects.md§11.5.

setcoatcolor(color: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Sets the coat color of the local player and tells the server.

setcoatcolor("red");

Specification: player-api.md§4.4.

setcoloreffect(red: number, green: number, blue: number, alpha: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Tints the NPC. Each value is a number from 0 to 1.

this.setcoloreffect(1, 0.5, 0.5, 1);

Specification: world-and-objects.md§11.1.

setContentControl(control: object)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Adds a GUI control to the screen, stretched over all of it and under the other controls.

setContentControl(temp.backdrop);

Specification: client-rendering.md§4.11.

setcursor2(image: string)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Gives the GUI cursor a picture. Like the legacy client, the picture is kept but the desktop pointer is what shows (OQ-GLY-11).

setcursor2("mycursor.png");

Specification: gui-legacy.md§26.3.

setEffect(red: number, green: number, blue: number, alpha: number)

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Draws a colour over the game view (red, green, blue and alpha from 0 to 1); four zeros turn it off.

seteffect(0, 0, 0.3, 0.4);

Specification: client-rendering.md§7.5.

seteffectmode(mode: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets how the NPC blends: 0 add, 1 transparent, 2 subtract, 3 day and night. Other values are reported and ignored.

this.seteffectmode(1);

Specification: world-and-objects.md§11.1.

setfocus(x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Points the camera at a fixed world position in tiles instead of the player.

setfocus(40, 30);

Specification: client-rendering.md§5.2.

sethead(file: string) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the head image of the player. The name must be a plain file name; anything else reports R-FILE-ACCESS.

player.sethead("head5.png");

Specification: world-and-objects.md§11.5.

setimg(file: string) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the image of the NPC. An empty name removes it. The image size sets the default blocking and touch box.

this.setimg("door.png");

Specification: world-and-objects.md§11.1.

setimgpart(file: string, x: number, y: number, width: number, height: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Shows the pixel rectangle of an image. The rectangle size is the size used for blocking and touch.

this.setimgpart("tiles.png", 0, 0, 32, 32);

Specification: world-and-objects.md§11.1.

setletters(text: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Stores the letters string of the local player; it is the same as writing player.letters.

setletters("abc");

Specification: player-api.md§2.9.

setlevel2(level: string, x: number, y: number) -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Moves the player in scope to the level and position. The level loads when needed; when it cannot, the call is reported and the player stays.

setlevel2("start.nw", 30, 30);

Specification: world-and-objects.md§11.5.

setminimap(file: string, image: string, x: number, y: number)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Remembers a minimap: the text file that lists the levels, the map image, and the default position on it.

setminimap("maps.txt", "map.png", 0, 0);

Specification: world-and-objects.md§20.7.

setmusicvolume(left: number, right?: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Sets the music level from the mean of the two values, each 0 to 1.

setmusicvolume(0.5, 0.5);

Specification: standard-library.md§17.5.1.

setplayerdir(dir: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Turns the local player to a direction: 0 up, 1 left, 2 down, 3 right.

setplayerdir(2);

Specification: world-and-objects.md§11.5.

setplayerprop(code: string, value: any)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Sets a property by its legacy code on the player in scope: “#c” chat, “#n” nick, “#g” guild (player only), “#1” sword image, “#2” shield image, “#3” head image, “#5” horse image (player only), “#8” body image, “#C” color number n, “#P” attribute number n. A code without a property for that owner does nothing.

setplayerprop("#c", "hello");

Specification: world-and-objects.md§11.5.

setshape(type: number, width: number, height: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Gives the NPC a blocking rectangle of the given size in pixels. Only type 1 exists; other types report R-NOT-IMPLEMENTED.

this.setshape(1, 32, 32);

Specification: world-and-objects.md§11.2.

setshape2(width: number, height: number, tileTypes: array) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Gives the NPC a grid of tile types, width times height entries. A wrong length reports R-SHAPE.

this.setshape2(2, 1, {0, 22});

Specification: world-and-objects.md§11.2.

setshield(file: string, power: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the shield image and power of the player. The name must be a plain file name.

player.setshield("shield2.png", 2);

Specification: world-and-objects.md§11.5.

setshoecolor(color: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Sets the shoe color of the local player and tells the server.

setshoecolor("black");

Specification: player-api.md§4.4.

setshootparams(params: string)

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the parameters passed with the next shoot call of the same object.

setshootparams("fire", 3);

Specification: world-and-objects.md§12.2.

setskincolor(color: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Sets the skin color of the local player and tells the server. It takes a color name or an index.

setskincolor("orange");

Specification: player-api.md§4.4.

setsleevecolor(color: any)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Sets the sleeve color of the local player and tells the server.

setsleevecolor("white");

Specification: player-api.md§4.4.

setsoundpitch(file: string, pitch: number)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Sets the playback speed of a sound file: 1 is normal, 2 is an octave up. It changes the sounds playing and the ones started later.

setsoundpitch("chime.wav", 1.5);

Specification: standard-library.md§17.5.1.

setsoundpitchbynote(file: string, base: string, wanted: string)

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Sets the pitch of a sound recorded in one note so it is heard in another; notes read like cn4 or gs3 (equal temperament).

setsoundpitchbynote("bell.wav", "cn4", "en4");

Specification: standard-library.md§17.5.1.

setspritesimage(file: string)

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Replaces the image used by the SPRITES slot of every gani the client plays. An empty name restores the built-in image.

setspritesimage("mysprites.png");

Specification: player-api.md§2.9.

setStatusImage(name: string)

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

Chooses the picture the status icons of the player list come from. Stored; Borne draws its own list icons.

setstatusimage("states.png");

Specification: client-rendering.md§7.5.

setstring(name: string, text: string)

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Stores the text in the variable whose full name is given.

setstring("this.zz", "hi");

Specification: standard-library.md§17.6.8.

setsword(file: string, power: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Sets the sword image and power of the player. The name must be a plain file name.

player.setsword("sword2.png", 2);

Specification: world-and-objects.md§11.5.

setTimer(seconds: number)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Schedules one onTimeout call after the given number of seconds, replacing any pending timeout of the object. Zero or less cancels it. Delays below one tick (server) or one frame (client) are raised to that minimum.

setTimer(0.5);

Specification: vm-and-coroutines.md§7.2.

setz(x: number, y: number, width: number, height: number, z1: number, z2: number, z3: number, z4: number)

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Sets the ground height over a rectangle of tiles from the heights at its four corners: top left, top right, bottom left, bottom right. Later calls win where they overlap.

setz(0, 0, 8, 8, 0, 1, 0, 1);

Specification: world-and-objects.md§20.7.

setzoomeffect(factor: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Scales the NPC when drawn.

this.setzoomeffect(2);

Specification: world-and-objects.md§11.1.

sha1(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes.

Returns the SHA-1 digest of the text as 40 lower-case hexadecimal characters.

echo(sha1("abc")); // a9993e36...

Specification: standard-library.md§17.6.1.

sha256(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the 32 raw bytes of the SHA-256 digest of the text; encode them with base64encode to print them.

echo(base64encode(sha256("abc")));

Specification: standard-library.md§17.1.1.

shieldexists(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

1 when the image is in shields/ of the data root, else 0.

echo(shieldexists("zz.png"));

Specification: standard-library.md§17.6.7.

shoot(x: number, y: number, z: number, angle: number, zangle: number, speed: number, ani: string, params: string)

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Creates a projectile in the level of the caller. Speed is in tiles per second; angle 0 flies right and pi/2 flies up; a negative zangle descends. It stops at blocking tiles, the level edge, NPCs, players, or the ground. Returns the projectile id. NPCs hit get onWasHit; the weapon whose code shot gets onActionProjectile with the parameters.

shoot(this.x, this.y, 0, 0, 0, 10, "arrow", "p1");

Specification: world-and-objects.md§12.2.

shotbyplayer: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while onWasShot runs.

echo(shotbyplayer);

Specification: player-api.md§2.8.

show()

Runs on: server and client. Origin: engine extension. Since: M8. Playground: no.

Shows this NPC again after hide.

this.show();

Specification: world-and-objects.md§20.8.

showani(index: number, x: number, y: number, dir: number, ani: string) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Creates a show image that plays a gani in a direction. An optional last argument is a comma separated list of parameters for the gani. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showani(302, 10, 10, 2, "idle");

Specification: client-rendering.md§8.1.

showani2(index: number, x: number, y: number, dir: number, ani: string, layer: number) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Like showani with the layer as the last argument; parameters, when given, come before the layer. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showani2(302, 10, 10, 2, "idle", 1);

Specification: client-rendering.md§8.1.

showcharacter() -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Makes the NPC draw as a character, using its look fields (head, body, sword, shield, colors).

this.showcharacter();

Specification: world-and-objects.md§11.1.

showimg(index: number, file: string, x: number, y: number) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Creates or replaces the show image with the index, showing the file at the position. Indexes from 200 up stay on this client; lower ones are shared with nearby players. The position is in tiles on layers 0 to 3. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showimg(300, "block.png", 10, 12);

Specification: client-rendering.md§8.1.

showimg2(index: number, file: string, x: number, y: number, layer: number) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Like showimg with the layer as the last argument. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showimg2(300, "block.png", 10, 12, 1);

Specification: client-rendering.md§8.1.

showlocal()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Draws this NPC again on this client after hidelocal.

this.showlocal();

Specification: world-and-objects.md§20.8.

showpoly(index: number, coords: array) -> showimg

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Creates a filled polygon from an array of x and y pairs. Fewer than three points, or an odd count of numbers, creates nothing.

showpoly(303, {1,1, 5,1, 3,4});

Specification: client-rendering.md§8.1.

showpoly2(index: number, coords: array) -> showimg

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Creates a polygon from an array of x, y, and z triples; z lifts a point on screen.

showpoly2(304, {1,1,0, 5,1,0, 3,4,2});

Specification: client-rendering.md§8.1.

showTerrainGrid: boolean

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

A flag for scripts and the options to show a grid over the terrain.

showTerrainGrid = 1;

Specification: client-rendering.md§4.11.

showtext(index: number, x: number, y: number, font: string, style: string, text: string) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Creates a show image that draws text. The style is a string of letters: b bold, i italic, u underline, s strikethrough, c centered, r right. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showtext(301, 4, 4, "", "b", "Hello");

Specification: client-rendering.md§8.1.

showtext2(index: number, x: number, y: number, font: string, style: string, text: string, layer: number) -> showimg

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Like showtext with the layer as the last argument. On the server it runs on an NPC and the change is sent to every client that knows the NPC.

showtext2(301, 4, 4, "", "b", "Hello", 4);

Specification: client-rendering.md§8.1.

sin(radians: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the sine of an angle given in radians.

echo(sin(0));

Specification: standard-library.md§3.

sleep(seconds: number)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Suspends the calling coroutine, and every function in its call chain, for the given seconds (at least one tick or frame). The object’s pending timer is cleared and its other events wait until the sleep ends; scheduled events keep running.

sleep(1);

Specification: vm-and-coroutines.md§6.1.

spritesimage: string

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

The image of the SPRITES slot; empty means the built-in one.

spritesimage = "mysprites.png";

Specification: player-api.md§2.9.

sqliteDefragment(host: string) -> boolean

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Defragments and shrinks a SQLite database (VACUUM) and waits for it, at most the remaining time budget of the script. The argument is the database name, empty for the main database. Returns true on success; a bad name or a failure gives false and dbLastError() says why.

if (sqlitedefragment("")) echo("done");

Specification: standard-library.md§13.4.

sqliteenablefilesynchronization(host: string, on: boolean) -> boolean

Runs on: server and client. Origin: compatibility. Since: M12. Playground: no.

Legacy switch of file synchronization for script databases. Borne decides that itself, so the call only returns true.

echo(sqliteenablefilesynchronization("localhost", false));

Specification: web-and-files.md§5.

sqrt(x: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the square root; a negative number gives 0.

echo(sqrt(16)); // 4

Specification: standard-library.md§3.

Stage

Runs on: client only. Origin: compatibility. Since: M14. Playground: no.

The screen the clips are drawn on. Get it from the stage property of a clip; its width and height are the window size in logical pixels.

temp.s = this.m.stage;
echo(temp.s.width);

Specification: movieclip.md§1.3.

startrecordvideo() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Video capture is not offered; returns false.

echo(startrecordvideo());

Specification: standard-library.md§17.5.6.

statusImage: string

Runs on: client only. Origin: compatibility. Since: M13. Playground: no.

The picture the status icons come from, see setstatusimage. Stored.

echo(statusimage);

Specification: client-rendering.md§7.5.

stopmidi()

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Stops the music channel, the same as stopmusic.

stopmidi();

Specification: standard-library.md§17.5.1.

stopmusic()

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Stops the music channel.

stopmusic();

Specification: client-rendering.md§10.2.

stoprecordvideo() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Video capture is not offered; returns false.

echo(stoprecordvideo());

Specification: standard-library.md§17.5.6.

stopsound(file: string)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Stops every playing instance of a sound file.

stopsound("wind.ogg");

Specification: client-rendering.md§10.2.

stopsounds(includelooped: number)

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Stops all one-shot sounds, and the looped ones too when the argument is true. The music channel is not touched.

stopsounds(true);

Specification: client-rendering.md§10.2.

strcmp(a: string, b: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Compares two texts byte by byte and returns -1 when a sorts first, 1 when b sorts first, and 0 when they are equal.

echo(strcmp("a", "b")); // -1

Specification: standard-library.md§2.1.

strequals(a: string, b: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns 1 when both texts have exactly the same bytes, otherwise 0.

echo(strequals("a", "A")); // 0

Specification: standard-library.md§2.1.

strlen(s: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns how many bytes the text holds. Characters outside ASCII count as several bytes.

echo(strlen("abc")); // 3

Specification: standard-library.md§2.1.

strpos(s: string, sub: string) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the byte offset at which sub first appears inside s, or -1 when it never appears. The search is case-sensitive.

echo(strpos("hello", "ll")); // 2

Specification: standard-library.md§2.1.

strtofloat(text: string) -> number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: yes.

Reads text as a number, like float.

echo(strtofloat("1.5"));

Specification: standard-library.md§3.

supportsopenglshader() -> boolean

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Always false: scripts cannot use shader programs.

echo(supportsopenglshader());

Specification: standard-library.md§17.5.6.

swordexists(name: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

1 when the image is in swords/ of the data root, else 0.

echo(swordexists("zz.png"));

Specification: standard-library.md§17.6.7.

tan(radians: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the tangent of an angle given in radians.

echo(tan(0));

Specification: standard-library.md§3.

testnpc(x: number, y: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the index in level.npcs of an NPC whose box contains the point, or -1.

echo(testnpc(10, 10));

Specification: world-and-objects.md§2.3.

testplayer(x: number, y: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the index in level.players of a player whose box contains the point, or -1.

echo(testplayer(30, 30));

Specification: world-and-objects.md§2.3.

testsign(x: number, y: number) -> number

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Returns the index in the level sign list of the first sign whose box holds the point, or -1. A sign covers two tiles in a row.

echo(testsign(30, 30));

Specification: world-and-objects.md§20.3.

tilelayercount: number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

The number of tile layers of the level of the script.

echo(tilelayercount);

Specification: standard-library.md§17.6.

tilelayers: tileslayer[]

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

The tile layers of the level of the script, as a list of layers.

echo(tilelayers.size());

Specification: standard-library.md§17.6.

tiles: object

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

The tiles of the bottom layer of the current level: tiles[x, y] reads or writes the tile number at a cell (0 to 4095).

if (tiles[int(player.x), int(player.y)] == 0) echo("tile 0");

Specification: world-and-objects.md§20.7.

tiletype(x: number, y: number) -> number

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Returns the tile type at the tile that contains the point, in the level of the caller. Outside the level it is 22.

echo(tiletype(10, 10));

Specification: world-and-objects.md§2.3.

time::deltatime: number

Runs on: client only. Origin: engine extension. Since: M1. Playground: yes. read-only.

Seconds since the previous rendered frame.

echo(time::deltatime);

Specification: vm-and-coroutines.md§7.5.

time::fixeddeltatime: number

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes. read-only.

Seconds between two onFixedUpdate calls: one divided by the fixed update rate.

echo(time::fixeddeltatime);

Specification: vm-and-coroutines.md§7.5.

time::fps: number

Runs on: client only. Origin: engine extension. Since: M1. Playground: yes. read-only.

Rendered frames per second, averaged over the last second.

echo(time::fps);

Specification: vm-and-coroutines.md§7.5.

timereverywhere()

Runs on: client only. Origin: engine extension. Since: M8. Playground: no.

Marks this NPC as one whose timeouts run wherever the player is. Client NPC timeouts always run in the loaded levels, so this only records the request.

this.timereverywhere();

Specification: world-and-objects.md§20.8.

timevar: number

Runs on: server and client. Origin: compatibility. Since: M12. Playground: yes. read-only.

The server clock in steps of five seconds counted from the legacy server calendar epoch, with the fraction kept.

echo(timevar);

Specification: player-api.md§10.1.

timevar2: number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes. read-only.

Wall-clock Unix time in seconds.

echo(timevar2);

Specification: standard-library.md§17.

toall(text: string) -> any

Runs on: server only. Origin: engine extension. Since: M4. Playground: no.

Sends a server message to every connected player. One object may call it ten times per second; more reports R-LIMIT.

toall("Restart in 5 minutes");

Specification: standard-library.md§11.

touchfile(path: string) -> number

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Sets the modification time of a script file to now; 1 on success (a missing file is created empty).

echo(touchfile("scriptfiles/x.txt"));

Specification: standard-library.md§17.6.7.

trace(message: any)

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Writes the text form of its argument like echo; the host sees it as a trace line.

trace("state: " @ this.state);

Specification: standard-library.md§11.

triggeraction(x: number, y: number, name: string, ...params?: any) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Raises onAction with the given arguments on the NPCs of the current level whose box contains the point, ordered by id, with the caller player in scope. The events run after the calling script ends; arguments are numbers and strings.

triggeraction(10, 10, "Ping", "hello");

Specification: world-and-objects.md§10.

triggerclient(type: string, name: string, ...args?: any) -> any

Runs on: server only. Origin: engine extension. Since: M6. Playground: no.

Sends a trigger to the client of the player in scope. The type is gui or weapon for a weapon of that player, or npc; the target name and any further arguments follow, and the client runs onActionClientSide with them. With await, the call returns the client’s return value (an untrusted input). Without a player in scope the call does nothing and reports R-NO-PLAYER.

temp.answer = await triggerclient("gui", this.name, "ping");

Specification: networking.md§7.3.

triggerserver(type: string, name: string, ...args?: string) -> any

Runs on: client only. Origin: compatibility. Since: M5. Playground: no.

Asks the server to run onActionServerSide on a weapon or object. The type is gui or weapon for a weapon the player owns, or npc for a DB NPC in the player’s levels; then the target name and any further arguments follow. With await, the call returns the handler’s return value. Without a server connection the call is reported as not sent.

triggerserver("gui", "Heal", "heal", 1);

Specification: networking.md§7.1.

tstaticvar() -> object

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Creates an object with no template: a bag of variables and function values that any script can fill. New variable names need no declaration, a variable that was never set reads as an empty string, and a function value stored in a variable is called as a method with this set to the object. Use it as new TStaticVar().

temp.doc = new TStaticVar();
temp.doc.title = "Hello";
echo(temp.doc.title);

Specification: language.md§9.8.

typeof(value: any) -> string

Runs on: server and client. Origin: engine extension. Since: M1. Playground: yes.

Returns the kind of a value as text: “number”, “string”, “array”, “object”, “function”, or “null”. The way a value was created decides between “number” and “string”.

echo(typeof(temp.value));

Specification: standard-library.md§6.1.

unfreezeplayer()

Runs on: server and client. Origin: compatibility. Since: M5. Playground: no.

Lets a frozen local player move again. On the server it acts on the player the call is made on (player.unfreezeplayer()) or the player in scope, and that player’s client does it.

unfreezeplayer();

Specification: world-and-objects.md§11.5.

unset(varname: string)

Runs on: server and client. Origin: compatibility. Since: M8. Playground: yes.

Clears the variable whose full name is given as text, such as “this.zz”, “temp.t” or “server.sv1”. A name without a prefix does nothing. Use it as a statement; the legacy server did not clear the variable when the call’s value was used.

this.zz = 5; unset("this.zz"); echo(this.zz); // empty

Specification: language.md§6.8.

updateboard(x: number, y: number, width: number, height: number)

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Asks for the tiles of an area to be drawn again. Tiles are drawn from the level data on every frame, so a change shows at once and the call only notes the request.

updateboard(0, 0, 64, 64);

Specification: world-and-objects.md§20.7.

updateboard2(x: number, y: number, width: number, height: number)

Runs on: server only. Origin: compatibility. Since: M12. Playground: no.

Sends the changed board of the level to the players that know it. Tiles are changed with layer.tiles[x, y] = tile; savelevel writes the file.

updateboard2(0, 0, 64, 64);

Specification: standard-library.md§17.6.

updateterrain()

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Asks for the terrain to be drawn again; see updateboard.

updateterrain();

Specification: world-and-objects.md§20.7.

uppercase(s: string) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Function form of the upper method: turns ASCII small letters into capitals.

echo(uppercase("abc")); // ABC

Specification: standard-library.md§2.1.

urldecode(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M14. Playground: yes.

Reverses urlencode: + becomes a space and %XX becomes the byte it names.

echo(urldecode("a+b%26c")); // a b&c

Specification: web-and-files.md§2.2.

urlencode(text: string) -> string

Runs on: server and client. Origin: compatibility. Since: M14. Playground: yes.

Encodes text for a web address: letters, digits and the characters * - . _ stay, a space becomes +, every other byte becomes %XX.

echo(urlencode("a b&c")); // a+b%26c

Specification: web-and-files.md§2.1.

vectoradd(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Adds two vectors, each written x,y,z or given as an array of three numbers.

echo(vectoradd("1,2,3", "4,5,6")); // 5,7,9

Specification: standard-library.md§17.2.1.

vectorcross(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the cross product of two vectors.

echo(vectorcross("1,0,0", "0,1,0")); // 0,0,1

Specification: standard-library.md§17.2.1.

vectordist(a: array, b: array) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the straight-line distance between two points given as {x, y, z} arrays; a missing part counts as 0.

echo(vectordist({0, 0, 0}, {3, 4, 0})); // 5

Specification: standard-library.md§3.

vectordot(a: any, b: any) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the dot product of two vectors.

echo(vectordot("1,2,3", "4,5,6")); // 32

Specification: standard-library.md§17.2.1.

vectorlen(v: any) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the length of a vector.

echo(vectorlen("0,3,4")); // 5

Specification: standard-library.md§17.2.1.

vectornormalize(v: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the vector scaled to length 1; the zero vector stays zero.

echo(vectornormalize("0,3,4")); // 0,0.6,0.8

Specification: standard-library.md§17.2.1.

vectororthobasis(rotation: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the three axes of a rotation (x,y,z,degrees) as nine numbers, x axis first.

echo(vectororthobasis("0,0,1,90"));

Specification: standard-library.md§17.2.1.

vectorscale(v: any, factor: number) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Multiplies every component of a vector by a number.

echo(vectorscale("1,2,3", 2)); // 2,4,6

Specification: standard-library.md§17.2.1.

vectorsub(a: any, b: any) -> string

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Subtracts the second vector from the first.

echo(vectorsub("4,5,6", "1,2,3")); // 3,3,3

Specification: standard-library.md§17.2.1.

vecx(dir: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the horizontal step of a direction (0 up, 1 left, 2 down, 3 right); the direction wraps modulo 4.

echo(vecx(3)); // 1

Specification: standard-library.md§3.

vecy(dir: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Returns the vertical step of a direction (0 up, 1 left, 2 down, 3 right); the direction wraps modulo 4.

echo(vecy(0)); // -1

Specification: standard-library.md§3.

VK_0: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 48 (0x30), the code key events carry on every platform.

if (key == VK_0) echo("pressed");

Specification: client-rendering.md§4.2.

VK_1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 49 (0x31), the code key events carry on every platform.

if (key == VK_1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 50 (0x32), the code key events carry on every platform.

if (key == VK_2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_3: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 51 (0x33), the code key events carry on every platform.

if (key == VK_3) echo("pressed");

Specification: client-rendering.md§4.2.

VK_4: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 52 (0x34), the code key events carry on every platform.

if (key == VK_4) echo("pressed");

Specification: client-rendering.md§4.2.

VK_5: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 53 (0x35), the code key events carry on every platform.

if (key == VK_5) echo("pressed");

Specification: client-rendering.md§4.2.

VK_6: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 54 (0x36), the code key events carry on every platform.

if (key == VK_6) echo("pressed");

Specification: client-rendering.md§4.2.

VK_7: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 55 (0x37), the code key events carry on every platform.

if (key == VK_7) echo("pressed");

Specification: client-rendering.md§4.2.

VK_8: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 56 (0x38), the code key events carry on every platform.

if (key == VK_8) echo("pressed");

Specification: client-rendering.md§4.2.

VK_9: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 57 (0x39), the code key events carry on every platform.

if (key == VK_9) echo("pressed");

Specification: client-rendering.md§4.2.

VK_A: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 65 (0x41), the code key events carry on every platform.

if (key == VK_A) echo("pressed");

Specification: client-rendering.md§4.2.

VK_ACCEPT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 30 (0x1E), the code key events carry on every platform.

if (key == VK_ACCEPT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_ADD: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 107 (0x6B), the code key events carry on every platform.

if (key == VK_ADD) echo("pressed");

Specification: client-rendering.md§4.2.

VK_APPS: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 93 (0x5D), the code key events carry on every platform.

if (key == VK_APPS) echo("pressed");

Specification: client-rendering.md§4.2.

VK_ATTN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 246 (0xF6), the code key events carry on every platform.

if (key == VK_ATTN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_B: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 66 (0x42), the code key events carry on every platform.

if (key == VK_B) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BACK: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 8 (0x08), the code key events carry on every platform.

if (key == VK_BACK) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_BACK: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 166 (0xA6), the code key events carry on every platform.

if (key == VK_BROWSER_BACK) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_FAVORITES: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 171 (0xAB), the code key events carry on every platform.

if (key == VK_BROWSER_FAVORITES) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_FORWARD: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 167 (0xA7), the code key events carry on every platform.

if (key == VK_BROWSER_FORWARD) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_HOME: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 172 (0xAC), the code key events carry on every platform.

if (key == VK_BROWSER_HOME) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_REFRESH: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 168 (0xA8), the code key events carry on every platform.

if (key == VK_BROWSER_REFRESH) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_SEARCH: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 170 (0xAA), the code key events carry on every platform.

if (key == VK_BROWSER_SEARCH) echo("pressed");

Specification: client-rendering.md§4.2.

VK_BROWSER_STOP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 169 (0xA9), the code key events carry on every platform.

if (key == VK_BROWSER_STOP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_C: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 67 (0x43), the code key events carry on every platform.

if (key == VK_C) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CANCEL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 3 (0x03), the code key events carry on every platform.

if (key == VK_CANCEL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CAPITAL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 20 (0x14), the code key events carry on every platform.

if (key == VK_CAPITAL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CLEAR: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 12 (0x0C), the code key events carry on every platform.

if (key == VK_CLEAR) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CONTROL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 17 (0x11), the code key events carry on every platform.

if (key == VK_CONTROL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CONVERT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 28 (0x1C), the code key events carry on every platform.

if (key == VK_CONVERT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_CRSEL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 247 (0xF7), the code key events carry on every platform.

if (key == VK_CRSEL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_D: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 68 (0x44), the code key events carry on every platform.

if (key == VK_D) echo("pressed");

Specification: client-rendering.md§4.2.

VK_DECIMAL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 110 (0x6E), the code key events carry on every platform.

if (key == VK_DECIMAL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_DELETE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 46 (0x2E), the code key events carry on every platform.

if (key == VK_DELETE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_DIVIDE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 111 (0x6F), the code key events carry on every platform.

if (key == VK_DIVIDE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_DOWN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 40 (0x28), the code key events carry on every platform.

if (key == VK_DOWN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_E: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 69 (0x45), the code key events carry on every platform.

if (key == VK_E) echo("pressed");

Specification: client-rendering.md§4.2.

VK_END: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 35 (0x23), the code key events carry on every platform.

if (key == VK_END) echo("pressed");

Specification: client-rendering.md§4.2.

VK_EREOF: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 249 (0xF9), the code key events carry on every platform.

if (key == VK_EREOF) echo("pressed");

Specification: client-rendering.md§4.2.

VK_ESCAPE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 27 (0x1B), the code key events carry on every platform.

if (key == VK_ESCAPE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_EXECUTE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 43 (0x2B), the code key events carry on every platform.

if (key == VK_EXECUTE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_EXSEL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 248 (0xF8), the code key events carry on every platform.

if (key == VK_EXSEL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 70 (0x46), the code key events carry on every platform.

if (key == VK_F) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 112 (0x70), the code key events carry on every platform.

if (key == VK_F1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F10: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 121 (0x79), the code key events carry on every platform.

if (key == VK_F10) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F11: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 122 (0x7A), the code key events carry on every platform.

if (key == VK_F11) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F12: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 123 (0x7B), the code key events carry on every platform.

if (key == VK_F12) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F13: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 124 (0x7C), the code key events carry on every platform.

if (key == VK_F13) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F14: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 125 (0x7D), the code key events carry on every platform.

if (key == VK_F14) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F15: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 126 (0x7E), the code key events carry on every platform.

if (key == VK_F15) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F16: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 127 (0x7F), the code key events carry on every platform.

if (key == VK_F16) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F17: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 128 (0x80), the code key events carry on every platform.

if (key == VK_F17) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F18: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 129 (0x81), the code key events carry on every platform.

if (key == VK_F18) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F19: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 130 (0x82), the code key events carry on every platform.

if (key == VK_F19) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 113 (0x71), the code key events carry on every platform.

if (key == VK_F2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F20: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 131 (0x83), the code key events carry on every platform.

if (key == VK_F20) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F21: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 132 (0x84), the code key events carry on every platform.

if (key == VK_F21) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F22: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 133 (0x85), the code key events carry on every platform.

if (key == VK_F22) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F23: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 134 (0x86), the code key events carry on every platform.

if (key == VK_F23) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F24: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 135 (0x87), the code key events carry on every platform.

if (key == VK_F24) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F3: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 114 (0x72), the code key events carry on every platform.

if (key == VK_F3) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F4: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 115 (0x73), the code key events carry on every platform.

if (key == VK_F4) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F5: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 116 (0x74), the code key events carry on every platform.

if (key == VK_F5) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F6: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 117 (0x75), the code key events carry on every platform.

if (key == VK_F6) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F7: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 118 (0x76), the code key events carry on every platform.

if (key == VK_F7) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F8: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 119 (0x77), the code key events carry on every platform.

if (key == VK_F8) echo("pressed");

Specification: client-rendering.md§4.2.

VK_F9: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 120 (0x78), the code key events carry on every platform.

if (key == VK_F9) echo("pressed");

Specification: client-rendering.md§4.2.

VK_FINAL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 24 (0x18), the code key events carry on every platform.

if (key == VK_FINAL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_G: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 71 (0x47), the code key events carry on every platform.

if (key == VK_G) echo("pressed");

Specification: client-rendering.md§4.2.

VK_H: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 72 (0x48), the code key events carry on every platform.

if (key == VK_H) echo("pressed");

Specification: client-rendering.md§4.2.

VK_HANGUL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 21 (0x15), the code key events carry on every platform.

if (key == VK_HANGUL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_HANJA: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 25 (0x19), the code key events carry on every platform.

if (key == VK_HANJA) echo("pressed");

Specification: client-rendering.md§4.2.

VK_HELP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 47 (0x2F), the code key events carry on every platform.

if (key == VK_HELP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_HOME: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 36 (0x24), the code key events carry on every platform.

if (key == VK_HOME) echo("pressed");

Specification: client-rendering.md§4.2.

VK_I: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 73 (0x49), the code key events carry on every platform.

if (key == VK_I) echo("pressed");

Specification: client-rendering.md§4.2.

VK_IME_OFF: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 26 (0x1A), the code key events carry on every platform.

if (key == VK_IME_OFF) echo("pressed");

Specification: client-rendering.md§4.2.

VK_IME_ON: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 22 (0x16), the code key events carry on every platform.

if (key == VK_IME_ON) echo("pressed");

Specification: client-rendering.md§4.2.

VK_INSERT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 45 (0x2D), the code key events carry on every platform.

if (key == VK_INSERT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_J: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 74 (0x4A), the code key events carry on every platform.

if (key == VK_J) echo("pressed");

Specification: client-rendering.md§4.2.

VK_JUNJA: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 23 (0x17), the code key events carry on every platform.

if (key == VK_JUNJA) echo("pressed");

Specification: client-rendering.md§4.2.

VK_K: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 75 (0x4B), the code key events carry on every platform.

if (key == VK_K) echo("pressed");

Specification: client-rendering.md§4.2.

VK_KANA: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 21 (0x15), the code key events carry on every platform.

if (key == VK_KANA) echo("pressed");

Specification: client-rendering.md§4.2.

VK_KANJI: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 25 (0x19), the code key events carry on every platform.

if (key == VK_KANJI) echo("pressed");

Specification: client-rendering.md§4.2.

VK_L: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 76 (0x4C), the code key events carry on every platform.

if (key == VK_L) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LAUNCH_APP1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 182 (0xB6), the code key events carry on every platform.

if (key == VK_LAUNCH_APP1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LAUNCH_APP2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 183 (0xB7), the code key events carry on every platform.

if (key == VK_LAUNCH_APP2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LAUNCH_MAIL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 180 (0xB4), the code key events carry on every platform.

if (key == VK_LAUNCH_MAIL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LAUNCH_MEDIA_SELECT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 181 (0xB5), the code key events carry on every platform.

if (key == VK_LAUNCH_MEDIA_SELECT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LBUTTON: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 1 (0x01), the code key events carry on every platform.

if (key == VK_LBUTTON) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LCONTROL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 162 (0xA2), the code key events carry on every platform.

if (key == VK_LCONTROL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LEFT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 37 (0x25), the code key events carry on every platform.

if (key == VK_LEFT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LMENU: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 164 (0xA4), the code key events carry on every platform.

if (key == VK_LMENU) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LSHIFT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 160 (0xA0), the code key events carry on every platform.

if (key == VK_LSHIFT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_LWIN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 91 (0x5B), the code key events carry on every platform.

if (key == VK_LWIN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_M: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 77 (0x4D), the code key events carry on every platform.

if (key == VK_M) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MBUTTON: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 4 (0x04), the code key events carry on every platform.

if (key == VK_MBUTTON) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MEDIA_NEXT_TRACK: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 176 (0xB0), the code key events carry on every platform.

if (key == VK_MEDIA_NEXT_TRACK) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MEDIA_PLAY_PAUSE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 179 (0xB3), the code key events carry on every platform.

if (key == VK_MEDIA_PLAY_PAUSE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MEDIA_PREV_TRACK: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 177 (0xB1), the code key events carry on every platform.

if (key == VK_MEDIA_PREV_TRACK) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MEDIA_STOP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 178 (0xB2), the code key events carry on every platform.

if (key == VK_MEDIA_STOP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MENU: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 18 (0x12), the code key events carry on every platform.

if (key == VK_MENU) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MODECHANGE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 31 (0x1F), the code key events carry on every platform.

if (key == VK_MODECHANGE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_MULTIPLY: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 106 (0x6A), the code key events carry on every platform.

if (key == VK_MULTIPLY) echo("pressed");

Specification: client-rendering.md§4.2.

VK_N: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 78 (0x4E), the code key events carry on every platform.

if (key == VK_N) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NEXT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 34 (0x22), the code key events carry on every platform.

if (key == VK_NEXT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NONAME: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 252 (0xFC), the code key events carry on every platform.

if (key == VK_NONAME) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NONCONVERT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 29 (0x1D), the code key events carry on every platform.

if (key == VK_NONCONVERT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMLOCK: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 144 (0x90), the code key events carry on every platform.

if (key == VK_NUMLOCK) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD0: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 96 (0x60), the code key events carry on every platform.

if (key == VK_NUMPAD0) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 97 (0x61), the code key events carry on every platform.

if (key == VK_NUMPAD1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 98 (0x62), the code key events carry on every platform.

if (key == VK_NUMPAD2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD3: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 99 (0x63), the code key events carry on every platform.

if (key == VK_NUMPAD3) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD4: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 100 (0x64), the code key events carry on every platform.

if (key == VK_NUMPAD4) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD5: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 101 (0x65), the code key events carry on every platform.

if (key == VK_NUMPAD5) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD6: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 102 (0x66), the code key events carry on every platform.

if (key == VK_NUMPAD6) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD7: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 103 (0x67), the code key events carry on every platform.

if (key == VK_NUMPAD7) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD8: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 104 (0x68), the code key events carry on every platform.

if (key == VK_NUMPAD8) echo("pressed");

Specification: client-rendering.md§4.2.

VK_NUMPAD9: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 105 (0x69), the code key events carry on every platform.

if (key == VK_NUMPAD9) echo("pressed");

Specification: client-rendering.md§4.2.

VK_O: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 79 (0x4F), the code key events carry on every platform.

if (key == VK_O) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 186 (0xBA), the code key events carry on every platform.

if (key == VK_OEM_1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_102: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 226 (0xE2), the code key events carry on every platform.

if (key == VK_OEM_102) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 191 (0xBF), the code key events carry on every platform.

if (key == VK_OEM_2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_3: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 192 (0xC0), the code key events carry on every platform.

if (key == VK_OEM_3) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_4: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 219 (0xDB), the code key events carry on every platform.

if (key == VK_OEM_4) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_5: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 220 (0xDC), the code key events carry on every platform.

if (key == VK_OEM_5) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_6: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 221 (0xDD), the code key events carry on every platform.

if (key == VK_OEM_6) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_7: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 222 (0xDE), the code key events carry on every platform.

if (key == VK_OEM_7) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_8: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 223 (0xDF), the code key events carry on every platform.

if (key == VK_OEM_8) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_CLEAR: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 254 (0xFE), the code key events carry on every platform.

if (key == VK_OEM_CLEAR) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_COMMA: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 188 (0xBC), the code key events carry on every platform.

if (key == VK_OEM_COMMA) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_MINUS: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 189 (0xBD), the code key events carry on every platform.

if (key == VK_OEM_MINUS) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_PERIOD: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 190 (0xBE), the code key events carry on every platform.

if (key == VK_OEM_PERIOD) echo("pressed");

Specification: client-rendering.md§4.2.

VK_OEM_PLUS: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 187 (0xBB), the code key events carry on every platform.

if (key == VK_OEM_PLUS) echo("pressed");

Specification: client-rendering.md§4.2.

VK_P: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 80 (0x50), the code key events carry on every platform.

if (key == VK_P) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PA1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 253 (0xFD), the code key events carry on every platform.

if (key == VK_PA1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PACKET: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 231 (0xE7), the code key events carry on every platform.

if (key == VK_PACKET) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PAUSE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 19 (0x13), the code key events carry on every platform.

if (key == VK_PAUSE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PLAY: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 250 (0xFA), the code key events carry on every platform.

if (key == VK_PLAY) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PRINT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 42 (0x2A), the code key events carry on every platform.

if (key == VK_PRINT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PRIOR: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 33 (0x21), the code key events carry on every platform.

if (key == VK_PRIOR) echo("pressed");

Specification: client-rendering.md§4.2.

VK_PROCESSKEY: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 229 (0xE5), the code key events carry on every platform.

if (key == VK_PROCESSKEY) echo("pressed");

Specification: client-rendering.md§4.2.

VK_Q: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 81 (0x51), the code key events carry on every platform.

if (key == VK_Q) echo("pressed");

Specification: client-rendering.md§4.2.

VK_R: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 82 (0x52), the code key events carry on every platform.

if (key == VK_R) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RBUTTON: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 2 (0x02), the code key events carry on every platform.

if (key == VK_RBUTTON) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RCONTROL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 163 (0xA3), the code key events carry on every platform.

if (key == VK_RCONTROL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RETURN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 13 (0x0D), the code key events carry on every platform.

if (key == VK_RETURN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RIGHT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 39 (0x27), the code key events carry on every platform.

if (key == VK_RIGHT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RMENU: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 165 (0xA5), the code key events carry on every platform.

if (key == VK_RMENU) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RSHIFT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 161 (0xA1), the code key events carry on every platform.

if (key == VK_RSHIFT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_RWIN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 92 (0x5C), the code key events carry on every platform.

if (key == VK_RWIN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_S: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 83 (0x53), the code key events carry on every platform.

if (key == VK_S) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SCROLL: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 145 (0x91), the code key events carry on every platform.

if (key == VK_SCROLL) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SELECT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 41 (0x29), the code key events carry on every platform.

if (key == VK_SELECT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SEPARATOR: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 108 (0x6C), the code key events carry on every platform.

if (key == VK_SEPARATOR) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SHIFT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 16 (0x10), the code key events carry on every platform.

if (key == VK_SHIFT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SLEEP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 95 (0x5F), the code key events carry on every platform.

if (key == VK_SLEEP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SNAPSHOT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 44 (0x2C), the code key events carry on every platform.

if (key == VK_SNAPSHOT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SPACE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 32 (0x20), the code key events carry on every platform.

if (key == VK_SPACE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_SUBTRACT: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 109 (0x6D), the code key events carry on every platform.

if (key == VK_SUBTRACT) echo("pressed");

Specification: client-rendering.md§4.2.

VK_T: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 84 (0x54), the code key events carry on every platform.

if (key == VK_T) echo("pressed");

Specification: client-rendering.md§4.2.

VK_TAB: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 9 (0x09), the code key events carry on every platform.

if (key == VK_TAB) echo("pressed");

Specification: client-rendering.md§4.2.

VK_U: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 85 (0x55), the code key events carry on every platform.

if (key == VK_U) echo("pressed");

Specification: client-rendering.md§4.2.

VK_UP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 38 (0x26), the code key events carry on every platform.

if (key == VK_UP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_V: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 86 (0x56), the code key events carry on every platform.

if (key == VK_V) echo("pressed");

Specification: client-rendering.md§4.2.

VK_VOLUME_DOWN: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 174 (0xAE), the code key events carry on every platform.

if (key == VK_VOLUME_DOWN) echo("pressed");

Specification: client-rendering.md§4.2.

VK_VOLUME_MUTE: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 173 (0xAD), the code key events carry on every platform.

if (key == VK_VOLUME_MUTE) echo("pressed");

Specification: client-rendering.md§4.2.

VK_VOLUME_UP: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 175 (0xAF), the code key events carry on every platform.

if (key == VK_VOLUME_UP) echo("pressed");

Specification: client-rendering.md§4.2.

VK_W: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 87 (0x57), the code key events carry on every platform.

if (key == VK_W) echo("pressed");

Specification: client-rendering.md§4.2.

VK_X: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 88 (0x58), the code key events carry on every platform.

if (key == VK_X) echo("pressed");

Specification: client-rendering.md§4.2.

VK_XBUTTON1: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 5 (0x05), the code key events carry on every platform.

if (key == VK_XBUTTON1) echo("pressed");

Specification: client-rendering.md§4.2.

VK_XBUTTON2: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 6 (0x06), the code key events carry on every platform.

if (key == VK_XBUTTON2) echo("pressed");

Specification: client-rendering.md§4.2.

VK_Y: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 89 (0x59), the code key events carry on every platform.

if (key == VK_Y) echo("pressed");

Specification: client-rendering.md§4.2.

VK_Z: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 90 (0x5A), the code key events carry on every platform.

if (key == VK_Z) echo("pressed");

Specification: client-rendering.md§4.2.

VK_ZOOM: number

Runs on: server and client. Origin: compatibility. Since: M8. Playground: no. read-only.

Windows virtual-key code 251 (0xFB), the code key events carry on every platform.

if (key == VK_ZOOM) echo("pressed");

Specification: client-rendering.md§4.2.

waitfor(object: object, event: string, timeout?: number) -> number

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Suspends the calling coroutine until the named event is dispatched to the object (answer 1) or the timeout passes (answer 0). The object keeps handling its other events and its timer. A timeout of zero or less means 60 seconds.

temp.ok = waitfor(this, "Done", 5);

Specification: vm-and-coroutines.md§6.2.

warpto(level: string, x: number, y: number) -> any

Runs on: server and client. Origin: engine extension. Since: M4. Playground: no.

Moves a DB or local NPC to a level position, loading the level when needed. NPCs placed by level files cannot leave their level and report R-WARP-DENIED.

this.warpto("start.nw", 10, 10);

Specification: world-and-objects.md§11.4.

wasshooted: boolean

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

True while onWasShot runs; the same as shotbyplayer.

echo(wasshooted);

Specification: player-api.md§2.8.

watercolorflags: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Bit flags that tint the water: 1 to 4 brighten red, green and blue and 8 to 32 clear them. 4 by default; only the six lowest bits count.

watercolorflags = 4;

Specification: world-and-objects.md§20.7.

waterheight: number

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

The height of the water over the ground, 0 by default.

waterheight = 0.5;

Specification: world-and-objects.md§20.7.

weapons: weapon[]

Runs on: client only. Origin: compatibility. Since: M12. Playground: no. read-only.

The weapons the local player owns, as an array of objects.

echo(weapons.size());

Specification: player-api.md§2.7.

weathereffectsenabled: boolean

Runs on: client only. Origin: compatibility. Since: M8. Playground: no.

Whether scripts may show weather effects. True by default.

weathereffectsenabled = false;

Specification: world-and-objects.md§20.7.

worldx(screenx: number, screeny: number) -> number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Converts a point of the screen, in logical pixels, to a world tile column under the current camera.

echo(worldx(100, 100));

Specification: player-api.md§9.4.

worldy(screenx: number, screeny: number) -> number

Runs on: client only. Origin: compatibility. Since: M12. Playground: no.

Converts a point of the screen, in logical pixels, to a world tile row under the current camera.

echo(worldy(100, 100));

Specification: player-api.md§9.4.

wraptext(width: number, delims: string, text: string) -> array

Runs on: server and client. Origin: compatibility. Since: M1. Playground: yes.

Breaks text into lines of at most width characters. Lines break only after one of the delimiter characters, and a word longer than width stays whole on its own line.

temp.lines = wraptext(10, " ", "hello world foo");

Specification: standard-library.md§2.1.

wraptext2(width: number, size: number, breaks: string, text: string) -> array

Runs on: client only. Origin: compatibility. Since: M10. Playground: no.

Splits a text into lines no wider than a width in pixels, breaking at spaces and at the characters of the third argument. A text may start with font@style@.

temp.lines = wraptext2(200, 14, "", "a long sentence to wrap");

Specification: standard-library.md§17.5.3.

These names exist so that older scripts compile. Calling one reports R-NOT-IMPLEMENTED and does nothing else.

Name Signature Runs on
accounts accounts() -> any client only (not yet verified)
activeplayer activeplayer() -> any client only (not yet verified)
adddnsentry adddnsentry(hostname: any, ip: any) -> any client only (not yet verified)
addguildmember addguildmember(guild: any, account: any, nick: any) -> any server only (not yet verified)
addmaterialmapping addmaterialmapping(x: any, param1: any) -> any client only (not yet verified)
addutf8fontrange addutf8fontrange(param0: any, y: any, z: any) -> any client only (not yet verified)
Adventure_addFileToIgnore Adventure_addFileToIgnore(arg1: string) -> any client only (not yet verified)
Adventure_addMenuLink Adventure_addMenuLink() -> any client only (not yet verified)
Adventure_clearFilesToIgnore Adventure_clearFilesToIgnore() -> any client only (not yet verified)
Adventure_disablePingConnection Adventure_disablePingConnection() -> any client only (not yet verified)
Adventure_enablePingConnection Adventure_enablePingConnection() -> any client only (not yet verified)
Adventure_excludeFileFromBackup Adventure_excludeFileFromBackup(arg1: string, arg2: boolean) -> any client only (not yet verified)
Adventure_fileExists Adventure_fileExists(path: any) -> boolean client only (not yet verified)
Adventure_fileIsFolder Adventure_fileIsFolder(arg1: string) -> boolean client only (not yet verified)
Adventure_fileSize Adventure_fileSize(arg1: string) -> number client only (not yet verified)
Adventure_getAndroidDeviceModel Adventure_getAndroidDeviceModel() -> string client only (not yet verified)
Adventure_getAndroidOSVersion Adventure_getAndroidOSVersion() -> string client only (not yet verified)
Adventure_getApplicationFolder Adventure_getApplicationFolder(arg1: number) -> string client only (not yet verified)
Adventure_getBuildTime Adventure_getBuildTime() -> string client only (not yet verified)
Adventure_getEditAccountNames Adventure_getEditAccountNames() -> array client only (not yet verified)
Adventure_getEditNickName Adventure_getEditNickName() -> string client only (not yet verified)
Adventure_getFileContent Adventure_getFileContent(arg1: string) -> string client only (not yet verified)
Adventure_getFileModTimeGlobal Adventure_getFileModTimeGlobal(arg1: string) -> number client only (not yet verified)
Adventure_getFolder Adventure_getFolder(arg1: string, arg2: string, arg3: boolean, arg4: boolean) -> array client only (not yet verified)
Adventure_getFrameTick Adventure_getFrameTick() -> number client only (not yet verified)
Adventure_getInstallationPath Adventure_getInstallationPath() -> string client only (not yet verified)
Adventure_getIPhoneID Adventure_getIPhoneID() -> string client only (not yet verified)
Adventure_getOSID Adventure_getOSID() -> string client only (not yet verified)
Adventure_getSystemID Adventure_getSystemID(index: any) -> string client only (not yet verified)
Adventure_getWindowList Adventure_getWindowList() -> array client only (not yet verified)
Adventure_hasSignerKey Adventure_hasSignerKey() -> boolean client only (not yet verified)
Adventure_installGraal Adventure_installGraal(path: any, install: any, update: any) -> any client only (not yet verified)
Adventure_invokeKeyEvent Adventure_invokeKeyEvent(arg1: number, arg2: number, arg3: string, arg4: number) -> any client only (not yet verified)
Adventure_invokeMouseEvent Adventure_invokeMouseEvent(arg1: number, arg2: number, arg3: number, arg4: number, double: any, double: any, arg7: number) -> any client only (not yet verified)
Adventure_openDefaultViewer Adventure_openDefaultViewer() -> any client only (not yet verified)
Adventure_openExternalOptions Adventure_openExternalOptions() -> any client only (not yet verified)
Adventure_openExternalPM Adventure_openExternalPM(recipient: any) -> boolean client only (not yet verified)
Adventure_openServerList Adventure_openServerList() -> any client only (not yet verified)
Adventure_quit Adventure_quit() -> any client only (not yet verified)
Adventure_reconnect Adventure_reconnect() -> any client only (not yet verified)
Adventure_requestDownload Adventure_requestDownload(arg1: string) -> any client only (not yet verified)
Adventure_requestFileDeletion Adventure_requestFileDeletion(arg1: string) -> any client only (not yet verified)
Adventure_requestFileRename Adventure_requestFileRename() -> any client only (not yet verified)
Adventure_requestFilesMove Adventure_requestFilesMove(arg1: string, arg2: string) -> any client only (not yet verified)
Adventure_requestUpdateCRC Adventure_requestUpdateCRC(arg1: string) -> any client only (not yet verified)
Adventure_requestUpdateModTime Adventure_requestUpdateModTime(arg1: string) -> any client only (not yet verified)
Adventure_saveGraalOptions Adventure_saveGraalOptions() -> any client only (not yet verified)
Adventure_selectFileSelect Adventure_selectFileSelect(arg1: string) -> any client only (not yet verified)
Adventure_selectFileSetFolder Adventure_selectFileSetFolder(arg1: number) -> any client only (not yet verified)
Adventure_selectFileSetFolderByText Adventure_selectFileSetFolderByText(arg1: string) -> any client only (not yet verified)
Adventure_selectFileShowHiddenFiles Adventure_selectFileShowHiddenFiles(arg1: boolean) -> any client only (not yet verified)
Adventure_setAccountName Adventure_setAccountName(arg1: string) -> any client only (not yet verified)
Adventure_setAllowedPortsBind Adventure_setAllowedPortsBind(arg1: number) -> any client only (not yet verified)
Adventure_setAllowedSocketsConnect Adventure_setAllowedSocketsConnect(arg1: string) -> any client only (not yet verified)
Adventure_setAllowRecordByScript Adventure_setAllowRecordByScript(arg1: boolean) -> any client only (not yet verified)
Adventure_setChat Adventure_setChat(arg1: string) -> any client only (not yet verified)
Adventure_setCheatWindows Adventure_setCheatWindows(arg1: array) -> any client only (not yet verified)
Adventure_setDebugDataHandlersAuthorization Adventure_setDebugDataHandlersAuthorization(auth: any) -> any client only (not yet verified)
Adventure_setFileContent Adventure_setFileContent(arg1: string, arg2: string, arg3: number) -> boolean client only (not yet verified)
Adventure_setFrameTick Adventure_setFrameTick(arg1: number) -> any client only (not yet verified)
Adventure_setFullscreen Adventure_setFullscreen(arg1: boolean) -> any client only (not yet verified)
Adventure_setGraalControlRecreate Adventure_setGraalControlRecreate(arg1: boolean) -> any client only (not yet verified)
Adventure_setNickName Adventure_setNickName(nickname: any) -> string client only (not yet verified)
Adventure_setPassword Adventure_setPassword(arg1: string) -> any client only (not yet verified)
Adventure_setRemoveVars Adventure_setRemoveVars(arg1: boolean) -> any client only (not yet verified)
Adventure_setScriptedDownloadSystem Adventure_setScriptedDownloadSystem(arg1: boolean) -> any client only (not yet verified)
Adventure_setTextEditText Adventure_setTextEditText(arg1: object, arg2: string) -> any client only (not yet verified)
Adventure_startOnlineMode Adventure_startOnlineMode() -> any client only (not yet verified)
Adventure_updateMidiVolume Adventure_updateMidiVolume() -> any client only (not yet verified)
Adventure_updateMp3Volume Adventure_updateMp3Volume() -> any client only (not yet verified)
Adventure_updatePlayerMuted Adventure_updatePlayerMuted() -> any client only (not yet verified)
Adventure_updateRadioVolume Adventure_updateRadioVolume() -> any client only (not yet verified)
Adventure_uploadFile Adventure_uploadFile(arg1: string) -> any client only (not yet verified)
alliedguilds alliedguilds() -> any client only (not yet verified)
allowloginreconnect allowloginreconnect: boolean client only (not yet verified)
allstats allstats() -> any client only (not yet verified)
androidGetDisplayAttributes androidGetDisplayAttributes() -> array client only (not yet verified)
ap ap(arg1: string) -> any client only (not yet verified)
backgroundalpha backgroundalpha(arg1: number) -> any client only (not yet verified)
ballindex ballindex(arg1: number) -> any server and client (not yet verified)
bombpower bombpower() -> any client only (not yet verified)
bushes bushes() -> any client only (not yet verified)
call call(index: any, value1: any, param2: any) -> any client only (not yet verified)
castray castray(x: any, y: any, z: any, value3: any, value4: any, value5: any, param6: any) -> object client only (not yet verified)
channelid channelid() -> any client only (not yet verified)
clearutf8fontranges clearutf8fontranges() -> any client only (not yet verified)
compsdead compsdead() -> any client only (not yet verified)
computerfirstlogin computerfirstlogin(arg1: number) -> any client only (not yet verified)
date date(arg1: string) -> any client only (not yet verified)
deleteattachment deleteattachment(index: any) -> any client only (not yet verified)
deletepos deletepos(index: any, value1: any) -> any client only (not yet verified)
deletesprite deletesprite(index: any) -> any client only (not yet verified)
deletestep deletestep(index: any) -> any client only (not yet verified)
description description() -> any client only (not yet verified)
destroymudobject destroymudobject(index: any) -> any client only (not yet verified)
directorylisting directorylisting() -> any client only (not yet verified)
disableactionprojectile disableactionprojectile: boolean client only (not yet verified)
disableactionprojectile2 disableactionprojectile2() -> any client only (not yet verified)
disableapnoheal disableapnoheal() -> any client only (not yet verified)
disableapsaint disableapsaint() -> any client only (not yet verified)
disablenpchits disablenpchits() -> any client only (not yet verified)
disablenpconnpchits disablenpconnpchits() -> any client only (not yet verified)
disableselectweapons disableselectweapons() -> any client only (not yet verified)
disableweapons disableweapons() -> any client only (not yet verified)
downloadedsize downloadedsize() -> any client only (not yet verified)
downloadfiletofolder downloadfiletofolder(arg1: string, arg2: string) -> any client only (not yet verified)
downloadurltoarray downloadurltoarray(x: any, param1: any, z: any) -> any client only (not yet verified)
downloadurltofile downloadurltofile(x: any, filename: any, param2: any, value3: any) -> any client only (not yet verified)
downloadwebfiles downloadwebfiles() -> any client only (not yet verified)
dx dx(arg1: number, arg2: number) -> any client only (not yet verified)
dy dy(arg1: number, arg2: number) -> any client only (not yet verified)
enableganimoviereposition enableganimoviereposition() -> any client only (not yet verified)
enablepockets enablepockets() -> any client only (not yet verified)
enableselectweapons enableselectweapons() -> any client only (not yet verified)
enableutf8 enableutf8() -> any client only (not yet verified)
enableweapons enableweapons() -> any client only (not yet verified)
explodebomb explodebomb(arg1: number) -> any client only (not yet verified)
extensionrewrite extensionrewrite() -> any client only (not yet verified)
filecount filecount() -> any client only (not yet verified)
filedownloadedsize filedownloadedsize() -> any client only (not yet verified)
filename filename() -> any client only (not yet verified)
filetotalsize filetotalsize() -> any client only (not yet verified)
findarchetype findarchetype(x: any) -> object client only (not yet verified)
findball findball(arg1: number) -> any client only (not yet verified)
finishmoves finishmoves() -> any client only (not yet verified)
firstcontact firstcontact(arg1: number) -> any server and client (not yet verified)
flash flash() -> any client only (not yet verified)
flashfile flashfile() -> any client only (not yet verified)
from from() -> any client only (not yet verified)
get3dobjectat get3dobjectat(x: any, y: any, z: any) -> any client only (not yet verified)
get3dobjectatmouse get3dobjectatmouse(x: any) -> any client only (not yet verified)
get3dobjectbyray get3dobjectbyray(x: any, param1: any) -> any client only (not yet verified)
get3dobjectsbybox get3dobjectsbybox(x: any, y: any) -> any client only (not yet verified)
get3dobjectsbyradius get3dobjectsbyradius(param0: any, y: any, z: any) -> any client only (not yet verified)
get3dscreenposition get3dscreenposition(param0: any, y: any) -> any client only (not yet verified)
getanglesfromvector getanglesfromvector(x: any) -> any client only (not yet verified)
getbasepackage getbasepackage() -> any client only (not yet verified)
getdatablockvars getdatablockvars() -> array client only (not yet verified)
getdownloadedupdatepackagesize getdownloadedupdatepackagesize() -> any client only (not yet verified)
getdownloading getdownloading(filename: any) -> any client only (not yet verified)
getdownloadingpackage getdownloadingpackage() -> any client only (not yet verified)
getdownloadingpackagescount getdownloadingpackagescount() -> any client only (not yet verified)
getdropz getdropz(x: any, y: any) -> any client only (not yet verified)
getflashvariable getflashvariable(arg1: string) -> any client only (not yet verified)
getimageforsprite getimageforsprite(arg1: object) -> string client only (not yet verified)
getkingdomhasright getkingdomhasright(index: any, y: any) -> boolean client only (not yet verified)
getkingdomisally getkingdomisally(x: any, y: any) -> boolean client only (not yet verified)
getkingdomisenemy getkingdomisenemy(x: any, y: any) -> boolean client only (not yet verified)
getkingdomisinkingdom getkingdomisinkingdom(index: any, y: any) -> boolean client only (not yet verified)
getkingdomismember getkingdomismember(index: any, y: any) -> boolean client only (not yet verified)
getkingdomrankname getkingdomrankname(index: any) -> string client only (not yet verified)
getkingdomrankrights getkingdomrankrights(index: any) -> array client only (not yet verified)
getkingdomranktitle getkingdomranktitle(index: any) -> string client only (not yet verified)
getnearestmonster getnearestmonster(x: any, y: any) -> object client only (not yet verified)
getpackagesdownloadcomplete getpackagesdownloadcomplete() -> any client only (not yet verified)
getpackagesdownloaded getpackagesdownloaded() -> any client only (not yet verified)
getpersonaluploadfolder getpersonaluploadfolder() -> string client only (not yet verified)
getplayer getplayer(index: any) -> any client only (not yet verified)
getscriptaccessfile getscriptaccessfile(arg1: string, arg2: boolean) -> any client only (not yet verified)
getsprite getsprite(arg1: string) -> object client only (not yet verified)
getspriteforspritepos getspriteforspritepos(arg1: object) -> object client only (not yet verified)
getSystemTime getSystemTime() -> number client only (not yet verified)
getterraintexture getterraintexture(x: any, y: any) -> any client only (not yet verified)
getterraintextureindex getterraintextureindex(x: any, y: any) -> any client only (not yet verified)
gettotalupdatepackagesize gettotalupdatepackagesize() -> any client only (not yet verified)
getupdatepackage getupdatepackage(arg1: string) -> any client only (not yet verified)
getvectorfromangles getvectorfromangles(x: any, param1: any) -> any client only (not yet verified)
getwordfiltermatches getwordfiltermatches(arg1: number) -> any client only (not yet verified)
getwordfiltermessage getwordfiltermessage() -> any client only (not yet verified)
getwordfilternewtext getwordfilternewtext() -> any client only (not yet verified)
gmap gmap(arg1: string) -> any client only (not yet verified)
graalplugincookie graalplugincookie() -> any client only (not yet verified)
headdir headdir() -> any client only (not yet verified)
hideonoverlap hideonoverlap() -> any client only (not yet verified)
hitnpc hitnpc(arg1: number, arg2: number, arg3: number, arg4: number) -> any client only (not yet verified)
hitplayer hitplayer(arg1: number, arg2: number, arg3: number, arg4: number) -> any client only (not yet verified)
hurted hurted() -> any client only (not yet verified)
indexOf indexOf(arg1: number, arg2: object) -> any client only (not yet verified)
initgame initgame(x: any) -> any client only (not yet verified)
insertattachment insertattachment(arg1: number) -> object client only (not yet verified)
insertpos insertpos(arg1: number, arg2: number) -> object client only (not yet verified)
insertstep insertstep(arg1: number) -> object client only (not yet verified)
ischannel ischannel() -> any client only (not yet verified)
ischannelopen ischannelopen() -> any client only (not yet verified)
ischanneluser ischanneluser() -> any client only (not yet verified)
ischecked ischecked() -> boolean client only (not yet verified)
isdevicefullscreenonly isdevicefullscreenonly() -> boolean client only (not yet verified)
isgraalplugin isgraalplugin() -> any client only (not yet verified)
isinvincible isinvincible() -> any client only (not yet verified)
isinvincible2 isinvincible2() -> any client only (not yet verified)
isuninstalled isuninstalled() -> any client only (not yet verified)
item item(arg1: number) -> any client only (not yet verified)
kingdomadd kingdomadd(x: any) -> any client only (not yet verified)
kingdomaddally kingdomaddally(x: any, y: any) -> any client only (not yet verified)
kingdomaddenemy kingdomaddenemy(x: any, y: any) -> any client only (not yet verified)
kingdomaddmember kingdomaddmember(x: any, value1: any) -> any client only (not yet verified)
kingdomaddrank kingdomaddrank(x: any, y: any) -> any client only (not yet verified)
kingdomgetkingdom kingdomgetkingdom(index: any) -> string client only (not yet verified)
kingdomjoin kingdomjoin(x: any, value1: any) -> any client only (not yet verified)
kingdomlistallies kingdomlistallies(x: any) -> array client only (not yet verified)
kingdomlistenemies kingdomlistenemies(x: any) -> array client only (not yet verified)
kingdomlistkingdoms kingdomlistkingdoms() -> array client only (not yet verified)
kingdomlistmembers kingdomlistmembers(x: any) -> array client only (not yet verified)
kingdomlistrankmembers kingdomlistrankmembers(x: any, y: any) -> array client only (not yet verified)
kingdomlistranks kingdomlistranks(x: any) -> array client only (not yet verified)
kingdommessage kingdommessage(x: any, y: any) -> any client only (not yet verified)
kingdommessage2 kingdommessage2(x: any, y: any, z: any) -> any client only (not yet verified)
kingdomprofilekingdom kingdomprofilekingdom(x: any) -> object client only (not yet verified)
kingdomprofilemember kingdomprofilemember(x: any, value1: any) -> object client only (not yet verified)
kingdomprofilerank kingdomprofilerank(x: any, y: any) -> object client only (not yet verified)
kingdomremove kingdomremove(x: any) -> any client only (not yet verified)
kingdomremoveally kingdomremoveally(x: any, y: any) -> any client only (not yet verified)
kingdomremoveenemy kingdomremoveenemy(x: any, y: any) -> any client only (not yet verified)
kingdomremovemember kingdomremovemember(x: any, value1: any) -> any client only (not yet verified)
kingdomremoverank kingdomremoverank(x: any, y: any) -> any client only (not yet verified)
kingdomrenamemember kingdomrenamemember(x: any, value1: any, param2: any) -> any client only (not yet verified)
kingdomrenamerank kingdomrenamerank(x: any, y: any, z: any) -> any client only (not yet verified)
kingdomsetrank kingdomsetrank(x: any, value1: any, z: any) -> any client only (not yet verified)
kingdomsetrankparent kingdomsetrankparent(x: any, y: any, z: any) -> any client only (not yet verified)
kingdomsetrankrights kingdomsetrankrights(x: any, y: any, z: any) -> any client only (not yet verified)
kingdomsetranktitle kingdomsetranktitle(x: any, y: any, param2: any) -> any client only (not yet verified)
kingdomsettitle kingdomsettitle(x: any, value1: any, param2: any) -> any client only (not yet verified)
lastindexof lastindexof(x: any, param1: any) -> number client only (not yet verified)
lastreturnline lastreturnline(arg1: number) -> any server and client (not yet verified)
lastreturnscript lastreturnscript(arg1: string) -> any server and client (not yet verified)
lay lay(itemname: any) -> any client only (not yet verified)
lightscene lightscene() -> any client only (not yet verified)
loadaccount loadaccount() -> any client only (not yet verified)
loadimg loadimg(filename: any) -> object client only (not yet verified)
loadtranslation loadtranslation(arg1: string) -> any client only (not yet verified)
localversion localversion() -> any client only (not yet verified)
logintime logintime(arg1: number, compatible: any) -> any client only (not yet verified)
loopmovie loopmovie() -> any client only (not yet verified)
ltmfs ltmfs() -> any client only (not yet verified)
ltmmax ltmmax() -> any client only (not yet verified)
ltmmin ltmmin() -> any client only (not yet verified)
makemudobject makemudobject(x: any, y: any, z: any) -> object client only (not yet verified)
makescreenshot makescreenshot(filename: any) -> any client only (not yet verified)
messagebubble messagebubble() -> any client only (not yet verified)
messageonoverlap messageonoverlap() -> any client only (not yet verified)
moves moves(arg1: string) -> any server and client (not yet verified)
moviename moviename() -> any client only (not yet verified)
mp mp() -> any client only (not yet verified)
MRandomLCG MRandomLCG(void: any) -> object client only (not yet verified)
MRandomR250 MRandomR250() -> any server and client (not yet verified)
mudaddinvobject mudaddinvobject(index: any) -> any client only (not yet verified)
mudaddmoney mudaddmoney(amount: any) -> any client only (not yet verified)
mudapplyinvobject mudapplyinvobject(index: any) -> any client only (not yet verified)
mudapplyobject mudapplyobject(index: any) -> any client only (not yet verified)
mudattack mudattack(index: any) -> any client only (not yet verified)
mudcastspell mudcastspell(param0: any, value1: any) -> any client only (not yet verified)
mudcommand mudcommand(commandtext: any) -> any client only (not yet verified)
mudcountinvobject mudcountinvobject(x: any) -> number client only (not yet verified)
muddooropen muddooropen(index: any) -> any client only (not yet verified)
muddropinvobject muddropinvobject(index: any) -> any client only (not yet verified)
mudequipweapon mudequipweapon(index: any) -> any client only (not yet verified)
mudexamineinvobject mudexamineinvobject(index: any) -> string client only (not yet verified)
mudexamineinvobject2 mudexamineinvobject2(index: any) -> object client only (not yet verified)
mudexamineobject mudexamineobject(index: any) -> string client only (not yet verified)
mudfindinvobject mudfindinvobject(x: any) -> object client only (not yet verified)
mudfirespell mudfirespell(spellname: any) -> any client only (not yet verified)
mudfirespell2 mudfirespell2(param0: any, y: any) -> any client only (not yet verified)
mudhaskey mudhaskey(x: any) -> boolean client only (not yet verified)
mudhaskey2 mudhaskey2(index: any) -> boolean client only (not yet verified)
mudhaveskill mudhaveskill(skillname: any) -> boolean client only (not yet verified)
mudidentify mudidentify(index: any) -> string client only (not yet verified)
mudisbattleground mudisbattleground(x: any, y: any) -> boolean client only (not yet verified)
mudlistequipment mudlistequipment() -> array client only (not yet verified)
mudlistskills mudlistskills() -> array client only (not yet verified)
mudlistspells mudlistspells() -> array client only (not yet verified)
mudlistweapons mudlistweapons() -> array client only (not yet verified)
mudmissileactions mudmissileactions(index: any) -> any client only (not yet verified)
mudmissileattack mudmissileattack(index: any) -> any client only (not yet verified)
mudmoveinvobject mudmoveinvobject(index: any, param1: any) -> any client only (not yet verified)
mudnpccountinvobject mudnpccountinvobject(index: any, y: any) -> number client only (not yet verified)
mudnpcpickupobject mudnpcpickupobject(index: any, value1: any) -> any client only (not yet verified)
mudnpcremoveinvobject mudnpcremoveinvobject(index: any, value1: any) -> any client only (not yet verified)
mudobjectattr mudobjectattr(index: any, y: any) -> string client only (not yet verified)
mudorderinventory mudorderinventory() -> any client only (not yet verified)
mudpay mudpay(amount: any) -> boolean client only (not yet verified)
mudpickupobject mudpickupobject(index: any) -> any client only (not yet verified)
mudpickupobject2 mudpickupobject2(x: any, y: any) -> any client only (not yet verified)
mudremoveinvobject mudremoveinvobject(index: any) -> any client only (not yet verified)
mudresetinvobject mudresetinvobject(index: any) -> any client only (not yet verified)
mudresetplayer mudresetplayer() -> any client only (not yet verified)
mudrollstats mudrollstats() -> object client only (not yet verified)
mudselectspell mudselectspell(spellname: any) -> any client only (not yet verified)
mudsetplayerclass mudsetplayerclass(classname: any) -> any client only (not yet verified)
mudskilllevel mudskilllevel(skillname: any) -> number client only (not yet verified)
mudspellnumber mudspellnumber(spellname: any) -> number client only (not yet verified)
mudstartspell mudstartspell(spellname: any) -> any client only (not yet verified)
mudstopspell mudstopspell() -> any client only (not yet verified)
mudtransferobject mudtransferobject(index: any, value1: any) -> any client only (not yet verified)
muduseskill muduseskill(skillname: any) -> any client only (not yet verified)
muduseskill2 muduseskill2(param0: any, value1: any) -> any client only (not yet verified)
mudvalue mudvalue(index: any) -> number client only (not yet verified)
multitaskingenabled multitaskingenabled: boolean client only (not yet verified)
nopkzone nopkzone() -> any client only (not yet verified)
onAccelerator onAccelerator() -> any client only (not yet verified)
onActionDoubleMouse onActionDoubleMouse() -> any client only (not yet verified)
onActionPulled onActionPulled() -> any client only (not yet verified)
onActionPushed onActionPushed() -> any client only (not yet verified)
onActionsProjectile onActionsProjectile() -> any client only (not yet verified)
onAllRCChat onAllRCChat() -> any client only (not yet verified)
onAmazonHistory onAmazonHistory() -> any client only (not yet verified)
onAmazonHistoryDone onAmazonHistoryDone() -> any client only (not yet verified)
onAmazonPurchase onAmazonPurchase() -> any client only (not yet verified)
onAmazonUser onAmazonUser() -> any client only (not yet verified)
onAppEnterBackground onAppEnterBackground() -> any client only (not yet verified)
onAppLeaveBackground onAppLeaveBackground() -> any client only (not yet verified)
onBodyChanges onBodyChanges(param0: any, filename: any) -> any client only (not yet verified)
onCall onCall(index: any, value1: any, z: any) -> any client only (not yet verified)
onChildMouseDown onChildMouseDown(arg1: object) -> any client only (not yet verified)
onChildResized onChildResized(arg1: object) -> any client only (not yet verified)
onClassesDownloaded onClassesDownloaded() -> any client only (not yet verified)
onData onData(client: any, packetid: any, packetdata: any) -> any server only (not yet verified)
onDeviceBackButton onDeviceBackButton() -> any client only (not yet verified)
onDeviceOrientationChanges onDeviceOrientationChanges() -> any client only (not yet verified)
onDropFiles onDropFiles() -> any client only (not yet verified)
onFabzatEvent onFabzatEvent() -> any client only (not yet verified)
onFileRequests onFileRequests() -> any client only (not yet verified)
onFilesUploaded onFilesUploaded() -> any client only (not yet verified)
onFolderLog onFolderLog(message: any) -> any client only (not yet verified)
onGaniAttributeChanged onGaniAttributeChanged(arg1: number) -> any server only (not yet verified)
onGaniStepChanged onGaniStepChanged() -> any server only (not yet verified)
onGeneratedThumbnail onGeneratedThumbnail(param0: any, filename: any) -> any client only (not yet verified)
onGooglePlayInitialized onGooglePlayInitialized() -> any client only (not yet verified)
onGooglePlayPurchase onGooglePlayPurchase() -> any client only (not yet verified)
onHandShake onHandShake() -> any client only (not yet verified)
onHeadChanges onHeadChanges(param0: any, filename: any) -> any client only (not yet verified)
onInitialized onInitialized() -> any server and client (not yet verified)
onInputEvent onInputEvent(arg1: object) -> any client only (not yet verified)
onKeyRepeat onKeyRepeat(arg1: object) -> any client only (not yet verified)
onLeftMouseButton onLeftMouseButton() -> any client only (not yet verified)
onMapClick onMapClick(player: any) -> any client only (not yet verified)
onmapx onmapx(level: any) -> any client only (not yet verified)
onmapy onmapy(level: any) -> any client only (not yet verified)
onMiddleMouseButton onMiddleMouseButton() -> any client only (not yet verified)
onMobirooInAppItems onMobirooInAppItems() -> any client only (not yet verified)
onMobirooPurchase onMobirooPurchase() -> any client only (not yet verified)
onMobirooPurchaseUpdate onMobirooPurchaseUpdate() -> any client only (not yet verified)
onMobirooUser onMobirooUser() -> any client only (not yet verified)
onMouseYawPitch onMouseYawPitch(index: any, value1: any) -> any client only (not yet verified)
onMoved onMoved() -> any client only (not yet verified)
onMusicDataReceived onMusicDataReceived(name: any, value: any) -> any client only (not yet verified)
onNewAnimation onNewAnimation() -> any server only (not yet verified)
onNickChanges onNickChanges(param0: any, filename: any) -> any client only (not yet verified)
onOpenHelpWindow onOpenHelpWindow() -> any client only (not yet verified)
onOpenPlayerPositionWindow onOpenPlayerPositionWindow() -> any client only (not yet verified)
onOpenProfileWindow onOpenProfileWindow(player: any) -> any client only (not yet verified)
onPackagesDownloadComplete onPackagesDownloadComplete() -> any client only (not yet verified)
onPackagesDownloaded onPackagesDownloaded() -> any client only (not yet verified)
onParentResized onParentResized(arg1: number, arg2: number) -> any client only (not yet verified)
onPeltwithblackstone onPeltwithblackstone() -> any client only (not yet verified)
onPeltwithbush onPeltwithbush() -> any client only (not yet verified)
onPeltwithnpc onPeltwithnpc() -> any client only (not yet verified)
onPeltwithsign onPeltwithsign() -> any client only (not yet verified)
onPeltwithstone onPeltwithstone() -> any client only (not yet verified)
onPeltwithvase onPeltwithvase() -> any client only (not yet verified)
onPlayerAttached onPlayerAttached() -> any client only (not yet verified)
onPlayerDetached onPlayerDetached() -> any client only (not yet verified)
onPlayerDies onPlayerDies() -> any client only (not yet verified)
onPlayerHurt onPlayerHurt() -> any client only (not yet verified)
onPM onPM(player: any) -> any client only (not yet verified)
onReceiveGraalData onReceiveGraalData(index: any, param1: any) -> any client only (not yet verified)
onReconnect onReconnect() -> any client only (not yet verified)
onRender onRender(arg1: number) -> any client only (not yet verified)
onResourceFileUpdated onResourceFileUpdated(arg1: object) -> any server only (not yet verified)
onResourceObjectUpdated onResourceObjectUpdated(arg1: object, arg2: object) -> any client only (not yet verified)
onRightMouseButton onRightMouseButton() -> any client only (not yet verified)
onScriptFunctionCall onScriptFunctionCall() -> any client only (not yet verified)
onSelectedFileForUpload onSelectedFileForUpload(filename: any) -> any client only (not yet verified)
onSendAddBomb onSendAddBomb(client: any, x: any, y: any, power: any, time: any, jolt: any, imagestr: any) -> any server only (not yet verified)
onSendBoardModify onSendBoardModify(client: any, x: any, y: any, width: any, height: any, layer: any, tiletype: any) -> any server only (not yet verified)
onSendBoardModify2 onSendBoardModify2(client: any, levelname: any, x: any, y: any, width: any, height: any, layer: any, tiletype: any) -> any server only (not yet verified)
onSendCarryThrown onSendCarryThrown(client: any) -> any server only (not yet verified)
onSendDelBomb onSendDelBomb(client: any, x: any, y: any) -> any server only (not yet verified)
onSendDeleteNPC onSendDeleteNPC(client: any, npc: any) -> any server only (not yet verified)
onSendDeleteWeapon onSendDeleteWeapon(client: any, weapon: any) -> any server only (not yet verified)
onSendDownloadFile onSendDownloadFile(client: any, str1: any, str2: any, str3: any) -> any server only (not yet verified)
onSendEnterLevel onSendEnterLevel(client: any, level: any) -> any server only (not yet verified)
onSendExplosion onSendExplosion(client: any, x: any, y: any, radiusx: any, radiusy: any, damaging: any) -> any server only (not yet verified)
onSendExtra onSendExtra(client: any, x: any, y: any, extratype: any) -> any server only (not yet verified)
onSendFileDeletion onSendFileDeletion(client: any, filename: any) -> any server only (not yet verified)
onSendFileRename onSendFileRename(client: any, oldname: any, newname: any) -> any server only (not yet verified)
onSendFilesMove onSendFilesMove(client: any, source: any, destination: any) -> any server only (not yet verified)
onSendFireSpying onSendFireSpying(client: any, x: any, y: any) -> any server only (not yet verified)
onSendFlag onSendFlag(client: any, flagname: any) -> any server only (not yet verified)
onSendFolderDeletion onSendFolderDeletion(client: any, foldername: any) -> any server only (not yet verified)
onSendHaveWindow onSendHaveWindow(client: any, haswindow: any, windowname: any) -> any server only (not yet verified)
onSendImageUpdate onSendImageUpdate(client: any, imagename: any) -> any server only (not yet verified)
onSendImageUpdateCRC onSendImageUpdateCRC(client: any, imagename: any) -> any server only (not yet verified)
onSendIsPKer onSendIsPKer(client: any, player: any) -> any server only (not yet verified)
onSendLevelWarp onSendLevelWarp(client: any, x: any, y: any, levelname: any) -> any server only (not yet verified)
onSendLevelWarpModtime onSendLevelWarpModtime(client: any, x: any, y: any, levelname: any, modtime: any) -> any server only (not yet verified)
onSendNPCProperties onSendNPCProperties(client: any, properties: any) -> any server only (not yet verified)
onSendOpenChest onSendOpenChest(client: any, x: any, y: any) -> any server only (not yet verified)
onSendPingAnswer onSendPingAnswer(client: any, pingtime: any) -> any server only (not yet verified)
onSendPlayerHurt onSendPlayerHurt(client: any, player: any, npc: any, x: any, y: any, damage: any) -> any server only (not yet verified)
onSendPlayerProperties onSendPlayerProperties(client: any, properties: any) -> any server only (not yet verified)
onSendPreloadLevel onSendPreloadLevel(client: any, level: any) -> any server only (not yet verified)
onSendProjectile onSendProjectile(client: any, x: any, y: any, z: any, angle: any, zvel: any, speed: any, sprite: any, script: any, params1: any, params2: any) -> any server only (not yet verified)
onSendRCChat onSendRCChat(client: any, message: any) -> any server only (not yet verified)
onSendRemoveExtra onSendRemoveExtra(client: any, x: any, y: any) -> any server only (not yet verified)
onSendRequestText onSendRequestText(client: any, title: any, message: any, default: any) -> any server only (not yet verified)
onSendSaveFile onSendSaveFile(client: any, filename: any, size: any, data: any) -> any server only (not yet verified)
onSendServerWarp onSendServerWarp(client: any, servername: any) -> any server only (not yet verified)
onSendSetText onSendSetText(client: any, var1: any, var2: any, var3: any, var4: any) -> any server only (not yet verified)
onSendShot onSendShot(client: any, x: any, y: any, direction: any, strength: any, aniindex: any, charging: any, crystal: any) -> any server only (not yet verified)
onSendTakeExtra onSendTakeExtra(client: any, x: any, y: any, extratype: any) -> any server only (not yet verified)
onSendToAllChat onSendToAllChat(client: any, message: any) -> any server only (not yet verified)
onSendTriggerAction onSendTriggerAction(client: any, npc: any, x: any, y: any, action: any, params: any) -> any server only (not yet verified)
onSendUnsetFlag onSendUnsetFlag(client: any, flagname: any) -> any server only (not yet verified)
onSendUpdatePackage onSendUpdatePackage(client: any, package: any, forced: any) -> any server only (not yet verified)
onSendUploadEnd onSendUploadEnd(client: any, filename: any) -> any server only (not yet verified)
onSendUploadStart onSendUploadStart(client: any, filename: any) -> any server only (not yet verified)
onSendWantClassScript onSendWantClassScript(client: any, classname: any, version: any) -> any server only (not yet verified)
onSendWantGaniScript onSendWantGaniScript(client: any, scriptname: any, version: any) -> any server only (not yet verified)
onSendWantImage onSendWantImage(client: any, imagename: any) -> any server only (not yet verified)
onSendWantWeaponScript onSendWantWeaponScript(client: any, weaponname: any) -> any server only (not yet verified)
onSendWeaponHit onSendWeaponHit(client: any, x: any, y: any, power: any, npc: any) -> any server only (not yet verified)
onSendWeaponImage onSendWeaponImage(client: any, imagename: any) -> any server only (not yet verified)
onSendWindowList onSendWindowList(client: any, windowlist: any) -> any server only (not yet verified)
onServerListerConnect onServerListerConnect() -> any client only (not yet verified)
onServerWarp onServerWarp() -> any client only (not yet verified)
onShotByBaddy onShotByBaddy() -> any client only (not yet verified)
onShotByPlayer onShotByPlayer() -> any client only (not yet verified)
onStartedWithURL onStartedWithURL() -> any client only (not yet verified)
onStyleUpdated onStyleUpdated() -> any client only (not yet verified)
onSwordChanges onSwordChanges(param0: any, filename: any) -> any client only (not yet verified)
onToall onToall(param1: any, filename: any) -> any client only (not yet verified)
onTranslationUpdated onTranslationUpdated(language: any) -> any client only (not yet verified)
onUpdateColors onUpdateColors() -> any server only (not yet verified)
onUpdatePackageDownloaded onUpdatePackageDownloaded(package: any) -> any client only (not yet verified)
onVideoFinished onVideoFinished() -> any client only (not yet verified)
onVideoLoaded onVideoLoaded() -> any client only (not yet verified)
onWasHit onWasHit() -> any client only (not yet verified)
onWasPelt onWasPelt() -> any client only (not yet verified)
onWasThrown onWasThrown() -> any client only (not yet verified)
onWeaponFired onWeaponFired() -> any client only (not yet verified)
opengraalurl opengraalurl(arg1: string) -> any client only (not yet verified)
params params: array server and client (not yet verified)
passwordmatches passwordmatches(arg1: string, arg2: string) -> boolean client only (not yet verified)
performclick performclick() -> any client only (not yet verified)
playersinlevel playersinlevel() -> array client only (not yet verified)
pocketballs pocketballs(arg1: string) -> any server and client (not yet verified)
pokereval pokereval(arg1: string, arg2: object, arg3: object, arg4: object, arg5: number) -> any server only (not yet verified)
power power() -> any client only (not yet verified)
protectoverwrite protectoverwrite() -> any client only (not yet verified)
putcomp putcomp(param0: any, y: any, z: any) -> any client only (not yet verified)
putnewcomp putnewcomp(param0: any, y: any, z: any, text: any, value4: any) -> any client only (not yet verified)
putnpc putnpc(param0: any, y: any, z: any, value3: any) -> object client only (not yet verified)
recordfile recordfile() -> any client only (not yet verified)
removeguildmember removeguildmember(arg1: string, arg2: string) -> any client only (not yet verified)
requestfiledeletion requestfiledeletion(filename: any) -> any client only (not yet verified)
requestfilerename requestfilerename(old: any, new: any) -> any client only (not yet verified)
requestfilesmove requestfilesmove(x: any, param1: any) -> any client only (not yet verified)
requestmysql requestmysql(x: any, y: any) -> any client only (not yet verified)
saveinfo saveinfo(filename: any, data: any) -> any client only (not yet verified)
savelocally savelocally() -> any client only (not yet verified)
scriptline scriptline(arg1: number) -> any server and client (not yet verified)
scriptlogwritetoreadonly scriptlogwritetoreadonly() -> any client only (not yet verified)
scriptname scriptname(arg1: string) -> any server and client (not yet verified)
selectfilefordownload selectfilefordownload(arg1: string) -> any client only (not yet verified)
selectfileforupload selectfileforupload() -> any client only (not yet verified)
senddata senddata(index: any, param1: any) -> any client only (not yet verified)
sendpm sendpm(arg1: string) -> any client only (not yet verified)
serverstartconnect serverstartconnect() -> any client only (not yet verified)
serverstartparams serverstartparams() -> any client only (not yet verified)
serverwarp serverwarp(arg1: string) -> any client only (not yet verified)
setactivelanguage setactivelanguage(arg1: string) -> any client only (not yet verified)
setdisallowedpaths setdisallowedpaths(param0: any) -> any client only (not yet verified)
setdownloadkey setdownloadkey(param0: any) -> any client only (not yet verified)
setflashvariable setflashvariable(param0: any, filename: any) -> any client only (not yet verified)
setfogcolors setfogcolors(x: any) -> any client only (not yet verified)
setgender setgender(arg1: string) -> any client only (not yet verified)
setinteriorrendermode setinteriorrendermode(mode: any) -> any client only (not yet verified)
setmap setmap(param0: any, y: any, z: any) -> any client only (not yet verified)
setmoves setmoves(arg1: string) -> any client only (not yet verified)
setpm setpm(arg1: string) -> any client only (not yet verified)
setRetinaDisplayNoAntialias setRetinaDisplayNoAntialias() -> any client only (not yet verified)
setskybandcolors setskybandcolors(x: any) -> any client only (not yet verified)
setskybandsizes setskybandsizes(x: any) -> any client only (not yet verified)
setstreamingmode setstreamingmode(arg1: string) -> boolean client only (not yet verified)
setsuncolors setsuncolors(x: any) -> any client only (not yet verified)
setterrainrendermode setterrainrendermode(mode: any) -> any client only (not yet verified)
shootcycles shootcycles(arg1: number) -> any server and client (not yet verified)
shotbybaddy shotbybaddy() -> any client only (not yet verified)
showfile showfile(filename: any) -> any client only (not yet verified)
spyfire spyfire(length: any, power: any) -> any client only (not yet verified)
start start() -> any client only (not yet verified)
startgame startgame() -> any client only (not yet verified)
startshoot startshoot() -> any client only (not yet verified)
startswith startswith(param0: any, filename: any) -> any client only (not yet verified)
strcontains strcontains(param0: any, filename: any) -> any client only (not yet verified)
streamid streamid() -> any client only (not yet verified)
string string(varname: any, arg2: string) -> any client only (not yet verified)
switchOpenGLDeviceScale switchOpenGLDeviceScale(arg1: number) -> any client only (not yet verified)
switchtodirectx switchtodirectx() -> any client only (not yet verified)
switchtoopengl switchtoopengl() -> any client only (not yet verified)
synctimeofday synctimeofday() -> any client only (not yet verified)
TActionScriptVar TActionScriptVar() -> object client only (not yet verified)
takeplayercarry takeplayercarry() -> any client only (not yet verified)
takeplayerhorse takeplayerhorse() -> any client only (not yet verified)
targettopspin targettopspin() -> any server and client (not yet verified)
thumbnailfile thumbnailfile() -> any client only (not yet verified)
time time(arg1: number) -> any client only (not yet verified)
timershow timershow() -> any client only (not yet verified)
toinventory toinventory() -> any client only (not yet verified)
totalsize totalsize() -> any client only (not yet verified)
toweapons toweapons() -> any client only (not yet verified)
TSocket TSocket() -> object server and client (not yet verified)
update update(arg1: string) -> any client only (not yet verified)
update3dterrain update3dterrain() -> any client only (not yet verified)
updateratingdeviation updateratingdeviation(arg1: number, arg2: number) -> any client only (not yet verified)
updateratings updateratings(arg1: object) -> any client only (not yet verified)
updatevisibledistance updatevisibledistance() -> any client only (not yet verified)
uploadfile uploadfile(arg1: string) -> any client only (not yet verified)
usechecksum usechecksum() -> any client only (not yet verified)
version version() -> any client only (not yet verified)
weaponsenabled weaponsenabled() -> any client only (not yet verified)
wordfiltertext wordfiltertext(arg1: string, arg2: string) -> any client only (not yet verified)
WorldsF.getControlBinding WorldsF.getControlBinding(action: any, slot: any) -> controlbinding client only (not yet verified)

Engine version 0.1.0. Built 2026-11-18.