Skip to content

Scripting

Jeremy Harton edited this page Jun 1, 2017 · 11 revisions

Introduction

There is a very, very basic internal scripting language that can be used through triggers, etc. You can also run scripts directly from from the game prompt using @pgm in the following manner:

@pgm <script>

At the moment, there is no protection at all as to what can be modified and by whom, besides the limitations of the script functions and the direct interpretation afforded by '@pgm' being restricted to admin or higher permissions.

Basics

The language syntax, structure, etc is based on Fuzzball MPI (http://www.fuzzball.org/docs/mpihelp.html). Every function returns a String, but there are essentially three cases: an empty string (""), a string representation of a value ("5"), and a string token (":true"). These loosely equate to void, int/number, and boolean return types.

Functions

Numerical Comparisons

add (+), sub (-)

returns: int/number

eq, gt (>), ge (>=), lt (<), le (<=)

returns: :true or :false


Logical Operations and Branching

and, if, or

returns: :true or :false


Properties

set

sets an interpreter variable

returns: empty string

prop

returns: the property with the specified name from the given object

store

store a value in a property set on the given object

returns: empty string


Special Functionality?

give

give a player an item

returns: empty string

create_item

create a new item based on a prototype

returns: int/number

dbref

determine the database reference number of the object specified by name

returns: int/number

Clone this wiki locally