Main Connecting Starting



Building: Libs

Updated at Wed Aug 20 01:41:52 2025

Modules

void act (object what, string txt, nilobject target, nilobject prop, string arg)

uses /txt/ as the text of an action and performs it as /what/. %1 appears to be "you" to what. If specified /target/ and /prop/ are used. Not shown to sleeping viewers.

string acts (object what, string txt, nilobject target, nilobject prop, string txt2)

format /txt/ as if it were an action string performed by /what/. Optionally make it a targettable action aimed at /target/. Optionally using /prop/. Optionally use /txt2/ if the action uses %s to specify some text.

string acts2 (object observer, object what, string txt, nilobject target, nilobject prop, string txt2)

format /txt/ as if it were an action string performed by /what/, from the point of view of /observer/

object assume (nilobject what)

type casting function for static analysis

void awaymsg (object towho, object possiblyaway)

If /possiblyaway/ is away, inform /towho/. Messages only sent once in a 5-miute time period. No messaging is done unless both parties are players.

set children (object what)

returns all objects directly in /what/

void debug (any varargs)

bool destroy_coroutine (int i)

Deletes coroutine /i/ from the persistent coroutine table. Returns true if deletion was successful.

string do_look (object observer, object where, object forwho, bool showyouare, bool shownvg, bool showexits, bool showlinked)

Returns the description of /where/ as if /observer/ had just used 'look' there. Colour and paragraphing choices are taken from /forwho/. /showyouare/ controls display of the 'you are' header line. /shownvg/ controls display of 'You are forced to wear your night vision' messaging. /showexits/ controls display of the 'obvious exits' block. /showlinked/ controls listing of players and mobiles in linked locations.

string drunkify (object who, string txt)

mangle the text /txt/ to make it as spoken by /who/. Does slurring, mog conversion, literacy filter, etc.

void endpager (player who)

activate the pager upon /who/. done automatically if not done in a trap.

int findflag (string what)

returns the flag named /what/

int findpriv (string what)

returns the pflag named /what/

string flagname (flag f)

returns the name of flag with identifier /f/

object get (string id, bool wantreal)

looks up the object with specified /id/. if you are in a simulation, returns the simulated clone of it if applicable, unless /wantreal/ is 1.

bool getapriv (object o, priv f)

returns 1 if /o/ has priv /f/ but has put it in abeyance (perhaps they remorted), otherwise nil.

bool getflag (object o, flag f)

returns 1 if /o/ has flag /f/, otherwise nil. Flag constants look like 'flag.Fixed'

float getfloat (object what, key id, float d)

object getobj (object what, key id)

returns object property /id/ on /what/ or if not present, nil

bool getpriv (object o, priv f)

returns 1 if /o/ has priv /f/, otherwise nil. Priv constants look like 'priv.God'

table getprops (object what, string pref)

returns a table with all the properties on /what/ (only those starting with /pref/ if specified)

bool getrflag (object o, flag f)

returns 1 if /o/ has flag /f/ set as a "reset flag" (eg. saved to disk, not cleared on reset).

int getstate (object what)

returns which state /what/ is in

nilstring getstr (object what, key id)

returns string property /id/ on /what/ or if not present, nil

bool is_dark (object where)

Is /where/ a dark room, or is it outdoors at night?

bool is_illuminated (object where)

Are there any sources of light in /where/?

bool is_valid_object (object what)

returns true if /what/ is a valid reference, or /false/ if the MudObject /what/ references has been deleted.

string lang (string txt, object who)

translates the text /txt/ according to the language /who/ is speaking

vector light_sources (object where)

Gets all the sources of light in /where/

nilstring mail (string to, string from, string subj, string content)

sends a timestamped mail to /to/, from /from/, with the subject /subj/ and the body /content/. Returns nil on success, or an error message on failure.

vector minis ()

returns all minimission templates

void oact (object what, string txt, nilobject target, nilobject prop, string arg)

uses /txt/ as the text of an action and performs it as /what/. doesn't get sent to /what/. If specified, /target/ and /prop/ are used. Not shown to sleeping viewers.

void oact2 (object what, string txt, nilobject target, nilobject prop, string arg)

uses /txt/ as the text of an action and performs it as /what/. doesn't get sent to /what/ or /target/. If specified, /target/ and /prop/ are used. Not shown to sleeping viewers.

void others (object what, string txt, filter filter_fn)

send /txt/ to everything in the same room as /what/. Optionally, only show the message to objects matching /filter_fn/. newline not needed.

void othersf (object what, object avoid, string fmt, object varargs)

format /fmt/ according to internal mud printf rules and send to everyone in the same room as /what/ except /avoid/

object owner (object o)

returns the object that /o/ is in

string privname (priv p)

returns the name of pflag with identifier /p/

vector quests ()

returns all quests

int random (int range)

returns number between 0 and /range/-1

set recchildren (object what)

returns all objects in /what/, or in objects in those, etc.

int register_coroutine (function f, bool autoresume)

Pushes /f/ onto the coroutine table. Please see the lua coroutine documentation at http://www.lua.org/manual/5.1/manual.html#2.11 for more details. Returns the new coroutine's unique ID number.

void sendf (object what, string fmt, object varargs)

format /fmt/ according to internal mud printf rules, and send to /what/

void sendr (object what, string txt, bool exclude_linked, filter filter_fn)

send /txt/ to everything in the room /what/. Also sends to any linked rooms unless exclude_linked is set to 1

void sendzone (zonetag zone, string txt)

send /txt/ to all players in rooms with zone /zone/

void sendzonebut (zonetag zone, object notr, string txt)

send /txt/ to all players in rooms with zone /zone/, except for those in /not/

void set (object what, key id, object val)

sets property /id/ on /what/ to /val/

void setbflag (object o, flag f, bool v)

sets the current and reset flag /f/ on /o/ to /v/

void setflag (object o, flag f, bool v)

sets the flag /f/ on /o/ to /v/

void setfloat (object what, key id, float value)

void setstate (object what, int n)

sets /what/ to be in state /n/

void startpager (player who, bool pagercodes)

start the pager on /who/. all further output sent to them will be send instead to a file and then paged back to them later. If specified, pagercodes will be handled when the output is shown to the user.

void syslog (priv pfl, string cat, object who, string msg)

generate a log message /msg/ from /who/ in category /cat/, displayed to those with pflag /pfl/

void syslog2 (priv pfl, flag fl, string cat, object who, string msg)

generate a log message /msg/ from /who/ in category /cat/, displayed to those with pflag /pfl/ and hidden from those with flag /fl/

object tryget (string id, bool wantreal)

same as get but hints to our static analysis that you are ok if the literal string passed in doesn't exist

string type (void something)

returns "nil", "number", "string", "table", "function" or "userdata", depending on /something/.

void unset (object what, key id)

removes the property /id/ on /what/

untainted untaint (string what)

type casting function for static analysis

object void ()

return the empty room or void where vanished objects go.

body

string body.action (object who, nilstring original)

get the (possibly mogged) action string associated with /who/ emoting /original/ (or the default action text)/

float body.blood_alcohol (object who)

The blood alcohol percentage of /who/

bool body.can_breathe_air (object who)

Can /who/ breathe air without artificial assistance?

bool body.can_breathe_water (object who)

Can /who/ breathe underwater without artificial assistance?

bool body.can_fly (object who)

Can /who/ fly?

bool body.can_heal (object who)

can /who/ regenerate damage naturally?

bool body.can_swim (object who)

Can /who/ swim?

bool body.can_talk (object who)

Can /who/ talk?

bool body.can_walk (object who)

Can /who/ walk on land?

int body.get_attribute (object who, int attribute)

get the standard attribute /attribute/ (from the attribute table) value of /who/. Takes into account mog, implants, etc.

nilstring body.getstr (object who, key what)

Gets string property /what/ from the body object of the species that /who/ belongs to, or one of its ancestors.

bool body.has_legs (object who)

Does /who/ have any legs?

void body.set_attribute (object who, int attribute, int value)

sets the value of the standard attribute /attribute/ on /obj/

nilstring body.species (object o)

returns the name of the species of /o/

object body.species_object (object o)

returns the body template object corresponding to the species of /o/

string body.vocalisation (object who, nilstring original)

get the (possibly mogged) speech associated with /who/ saying /original/ (or the default speech text).

cash

int cash.balance (object o, object cur)

obtain the /cur/ balance of /o/

int cash.convert (int amt, nilobject from, nilobject to)

convert /amt/ from /from/ to /to/. if /from/ or /to/ is nil, this means ICUs

vector cash.currencies ()

return all the currencies defined in the game

object cash.currency (object o)

returns the preferred currency that /o/ uses

void cash.dofine (object mob, object victim, int amount, object cur)

pay /amount/ units in /cur/ from /from/ to /to/

string cash.format (int amt, object o, bool long_form)

format /amt/ which is denominated in /o/. l can be 1 to indicate long format

int cash.get (object o, object cur)

obtain the amount of /cur/ that /o/ is carrying

void cash.give (object who, int amount, object curr)

give /who/ /amount/ in /curr/

void cash.pay (object from, object to, int amount, object cur)

pay /amount/ units in /cur/ from /from/ to /to/

void cash.set (object o, object cur, int amt)

set the amount of /cur/ that /o/ is carrying to /amt/

void cash.transaction (object o, nilobject source, int amt, string note, object cur)

modify /o/'s account in /cur/ by /amt/ units

int cash.value (object o)

how much is /o/ worth in ICUs

int cash.value_at (object what, object shop, object who)

void cash.wipe (object who)

kill all cash held by /who/

combat

void combat.startfight (object attack, object victim)

makes /attack/ start a fight with /victim/

void combat.stopfighting (object who)

stop /who/ fighting. Note that combat will automatically restart unless you call stopfighting on all participants in a fight.

compat

void compat.doaction (object who, object targ, string cmd)

make /who/ do /cmd/ at /targ/. use interpret instead.

string compat.id (object what)

returns the id of /what/. use get(what, "id") instead.

void compat.killroom (object room, string why)

kill the entire /room/ because /why/

void compat.rawsend (object what, string txt)

send /txt/ as-is to /what/ without appending a newline.

void compat.restorestuff (object what)

puts /what/ back in their original body with their original stuff.

cryo

object cryo.anyfreedock (object dock)

returns a random free dock which is free, from the list of docks on /dock/

object cryo.anyfreequarters ()

return some random free quarters anywhere on the station

object cryo.findport (string code)

given a port /code/ (like "BCR"), return a dock object

void cryo.mushroom (object who)

makes /who/ go to the mushroom zone

void cryo.takeevidence (object who, object what, string z)

make /who/ take everything from /what/ in zone /what/ as evidence.

effect

object effect.addtimer (object on, string endlua, int duration)

spawn a simple timed effect, triggering /endlua/ after /duration/ seconds.

vector effect.get (object who)

returns all effects targetted at /who/

vector effect.get_template (object who, object templ)

returns all effects targetted at /who/ based on effect template /templ/

void effect.purge (object who, bool noaftereffect)

causes every effect targetted at /who/ to timeout. The effect's /endlua/ will not be triggered if /noaftereffect/ is true

object effect.spawn (object on, object efftemplate, object source)

creates a new effect based on an existing template /efftemplate/. /source/ is the cause object for audit purposes.

object effect.spawn_plain (object on, string name, int duration, object source, string ticklua, string endlua)

spawns a custom effect object on /on/, calling /ticklua/ every second for /duration/ seconds and /endlua/ when the time runs out. /name/ and /source/ are for cosmetic/audit/debug purposes only.

void effect.timeout (object effect, bool noaftereffect)

finishes effect /effect/. the effect's /endlua/ will not be triggered if /noaftereffect/ is true

eq

string eq.abilities (object what)

returns a string describing the capabilities of /what/

object eq.airsupply (object who, bool hostile)

returns the object that is providing /who/ with air. This can be /who/ itself, or nil if they are asphyxiating. Set /hostile/ to 1 if you want to check if they could survive in a hostile atmosphere even if they aren't currently in one.

int eq.armour (object who)

returns the total value of armour worn by /who/, plus their natural armour

vector eq.clothing (object who)

returns all clothing worn by /who/. Includes wornfrom equipment.

set eq.dragged (object what)

returns the objects that are currently trying to drag /what/, if any.

object eq.get_wornfrom (object what)

returns the object from whom /what/ will inherit clothing and equipment, if any

set eq.held_items (object who)

return sall the objects /who/ is gripping in their hands, including weapons.

bool eq.hold (object who, object what, nilstring hand)

set /what/ as held by /who/ without any messaging. Be aware that this skips some logic called by the hold verb which you should use instead in most cases. Returns true if holding was successful.

vector eq.implants (object who)

returns all cybernetic implants installed in /who/. Includes wornfrom equipment.

bool eq.is_storeable (object what)

returns true if /what/ could be saved for a player upon quit, or kept in quarters over a reset or reboot

object eq.spacesuit (object who)

returns the object that is protecting /who/ from vacuum (and some other hostile environments)

void eq.unhold (object who, object what)

unset /what/ as gripped by /who/ without any messaging.

void eq.unwield (object who, object what)

unset /what/ as a weapon of /who/ without any messaging.

object eq.weapon (object who)

return the object that /who/ is wielding. Includes wornfrom equipment. Use the weapons hook instead.

set eq.weapons (object who)

return all the objects that /who/ is wielding.

bool eq.wear (object who, object what)

make /who/ wear /what/. Only invokes the most minimal wearability logic (check that nothing else is worn on the same location at the same wornlevel), and so shoudl be avoided in most cases. Returns true if wearing suceeded.

bool eq.wears (object who, object what)

return true if /who/ is wearing the actual object /what/

bool eq.wield (object who, object what, nilstring hand)

set /what/ as weapon of /who/ without any messaging. Be aware that this skips some logic called by the wield verb which you should use instead in most cases. Returns true if wielding was successful.

object eq.wornon (object who, string where)

returns the outermost clothing worn by /who/ on their /where/

file

int file.player_getint (string id, key attribute, int def)

returns the value of attribute /attribute/ associated with (possibly offline) player /id/.

nilstring file.player_getstr (string id, key attribute)

returns the value of attribute /attribute/ associated with (possibly offline) player /id/.

void file.player_set (string id, key attribute, int value)

sets or updates the value of /attribute/ on (possibly offline) player /id/.

void file.player_unset (string id, key attribute)

removed attribute /attribute/ from (possibly offline) player /id/.

string file.view (string domain, string name)

shows the raw file contents of /domain/ file /name/. Domain is something like /help/ or /info/ and should be all lower case. /name/ should not have any file suffices such as ".i" for info files.

fluid

int fluid.capacity (object where)

returns the remaining volume in /where/, taking into account fluid contents

nilstring fluid.describe (object fluid)

returns a string describing the fluids in /where/, or nil if /where/ is dry

nilstring fluid.describe_in (object where)

returns a string describing the fluids in /where/, or nil if /where/ is dry

object fluid.get (object where)

get the object defining the fluids in /where/, or nil if it is dry.

void fluid.vanish_contents (object where)

removes all fluids from /where/

int fluid.volume (object fluid)

returns the volume of fluid object /fluid/

int fluid.volume_in (object where)

returns the volume of fluid in /where/

justice

void justice.arrest (object crim, object victim, string help)

/victim/ will cry /help/ on the intercom. this will cause the arrest of /crim/ if in policed area.

bool justice.arrested (object who)

is /who/ under arrest internationally, or within the current jurisdiction?

void justice.fine (object who, int amount, string why, object jur)

place a fine on /who/, value of /amount/ ICUs, with /why/ on their record in /jur/ if specified, otherwise the jurisdiction of the room they are in.

object justice.interviewroom (object where)

find the police interview room associated with /where/

object justice.jurisdiction (object where)

return the jurisdiction that applies in /where/

string justice.jurisdiction_name (object where)

returns the name of the jurisdiction that applies in /where/

object justice.police_station (object where)

returns the police room associated with /where/

make

object make.autoclone (object what, object where, zonetag zone)

clones a /what/ and places it in /where/. creates auto objects too. everything'll be part of /zone/

nilstring make.cantedit (object who, object what)

if /who/ is not allowed to alter the properties of /what/, return a string detailing the reason. Returns nil if there are no permissions problems

nilstring make.cantexec (object who, object what)

if /who/ is not allowed to make /what/ run commands, return a string detailing the reason. Returns nil if there are no permissions problems

nilstring make.cantstat (object who, object what)

if /who/ is not allowed to view the properties of /what/, return a string detailing the reason. Returns nil if there are no permissions problems

nilstring make.canttouch (object who, object what)

if /who/ is not allowed to alter temporary properties of /what/, return a string detailing the reason. Returns nil if there are no permissions problems

object make.clone (object what, object where, object mis)

clones a /what/ and places it in /where/

object make.clone_ship (object what, object mission, zonetag zone)

clones ship template /what/ for /mission/

object make.copy_object (object what, object where, string newid, nilstring newzone)

copies /what/ and places it /where/. By default it will be in the same zone as /what/, unless you specify otherwise. WARNING! This is a *permanent* object, and will remain after the zone is reset.

object make.create_exit (object from, string dir, object dest, bool create_reverse)

object make.create_temporary (string id)

Creates a temporary object with the supplied ID. Object will cease to exist when it is no longer referenced by your script.

void make.debug (bool dstate)

set detailed debugging to be on or off

bool make.debugging ()

are we doing a detailed lua debug right now?

object make.deserialise (string text, nilstring id)

deserialises /text/ into a temporary object that isn't accessible via the main mudobject index, and will be automatically deleted when the last reference to it is removed. If /id/ is set, overrides any id specificied in /text/.

void make.index (object o)

Inserts temporary object /o/ (eg. created bu make.create_temporary or make.deserialise) into the global MudObject index. Will error if the id of /o/ already exists in the index.

bool make.isdirty (object what)

returns true if /what/ has unsaved changes

void make.log (string msg)

generate a "fiddle" logmessage, only shown to those with the "SeeEditSpam" flag

string make.opposite_direction (string orig)

void make.reset (object what)

resets /what/ to its starting conditions

string make.serialise (object what)

returns the serialised form of /what/

nilstring make.validate_identifier (string what)

checks if /what/ is a reserved word, zone, object, player or verb ID. Returns null if not, or an error message if it is.

mission

bool mission.accepted (object who, object mission)

return true if /who/ has accepted /mission/

void mission.clearmini (object obj)

makes /obj/ a freestanding object that isn't associated with a mission

bool mission.done (object who, object what)

return true if /who/ has done mission, minimission or simulation /what/

void mission.fail (object who, object mis, nilstring why)

mark /who/ as having failed mission or minimission /mis/, with optional logmessage /why/

object mission.find (string what)

returns the mission object for the mission /what/

object mission.get (object o)

return the mission object for mission with id /o/

object mission.getmini (object blah)

returns the minimission that owns /blah/

void mission.give (object who, object what)

grant /who/ mission, minimission or simulation /what/ with a cash reward, if one was set

void mission.grudge (object who, object what)

grant /who/ mission, minimission or simulation /what/ with no cash reward

bool mission.ismission (object what)

returns true if /what/ is a mission, minimission or simulation which will be listed under the 'sims' command and is a valid argument for mission::done

vector mission.mini_instances (object mission)

returns all the instances of minimission /mission/.

int mission.mpoints_rank (int mpoints)

returns the rank granted to a player with /mpoints/ mission points.

int mission.mpoints_required (int rank)

returns the number of mission points required to reach rank /rank/

set mission.objects (object what)

returns all the objects belonging to minimission instance /what/, or the minimission instance that owns /what/.

int mission.reward (object who, object mission)

returns the reward value for /mission/ adjusted for the rank of /who/

object mission.runner (object mission)

return the player who has currently accepted /mission/, if any. Only works on full missions, not minis.

void mission.setmini (object obj, object mis)

associates the object /obj/ with the minimission /mis/. The object will be destroyed with the minimission.

mud

int mud.abv (object what)

the amount of alcohol by volume in /what/. 100% alcohol means an abv level of 10000

bool mud.actionverb (string vn)

returns true if the string /vn/ corresponds to a currently existing action

vector mud.all_worn_or_implant_with_flag (object o, flag f)

return all objects worn by or implants installed in /o/ which have the flag /f/.

vector mud.allholdsclone (object o, object f)

return all objects recursively in /o/ which are /f/ or are clones of /f/

vector mud.allholdsflag (object o, flag f)

return all objects recursively in /o/ which have the flag /f/. includes /o/ if applicable.

vector mud.allobjects ()

returns all objects in the mud

vector mud.alltreatas (object o, object f)

return all objects recursively in /o/ which are /f/ or inherit from /f/

vector mud.allzones ()

returns all the zones in the mud

object mud.anychildfrom (object blah)

return a random object/player/room etc from /blah/

object mud.anychildwithflag (object blah, flag flag)

return a random object from /blah/ with /flag/

object mud.anyobjectfrom (object blah)

return a random object from /blah/

object mud.anyplayerfrom (object blah)

return a random player from /blah/

object mud.anyroominzone (zonetag zone)

returns a random room from /blah/

object mud.archetype (object o)

returns the racial or national archetype object for o

bool mud.can_fly (object who)

return true if /who/ can fly (is an avian or has CanFly)

bool mud.can_see_in (object who, object where)

can /who/ see in /where/? takes into account nightvision, etc

bool mud.canattack (object who, object what)

return true if /who/ can attack /what/ without getting arrested

bool mud.cansee (object who, object whoelse)

can /who/ see /whoelse/? takes into account privs and invisibility levels, etc

bool mud.check_for_blocking (object who, object where, object dir, bool incombat)

triggers blocking behavious of mobiles in /where/ when /who/ tries to go /dir/. Returns false if blocking occurred.

bool mud.contains (object o, object w)

returns true if /w/ is in /o/ either directly or via other objects, otherwise false.

int mud.damage (object who)

returns the total amount of damage that can be done by /who/, including their current weapon

bool mud.dead (object what)

return true if /what/ is dead

string mud.defaultrank (int level)

returns the default rank corresponding to /level/

string mud.describe (objvector o)

return a string describing the objects in /o/, for example "two trees, eleven jellybabies and a helicopter"

string mud.describe_for (objvector ow, object who)

return a string describing the objects in /o/, for example "two trees, eleven jellybabies and a helicopter"

string mud.describe_location_of (object what)

says the name of /what/s owner, and if what is being worn, wielded, etc

void mud.dismount (object o)

makes /o/ stop riding anything

void mud.do_arrival (object who, object from, object dest)

do all the after-room-change trap triggering at /dest/ and state fixing on /who/, as if they'd just come from /from/

int mud.empty_ship (object o)

empties the ship /o/ of all players. returns how many there were.

object mud.find_object (object forwho, string what, bool wantreal)

try to match /what/ as an object from /forwho/s point of view. Will not return objects by ID for mortals, or objects that /forwho/ cannot see, or any exits.

vector mud.find_route (object who, object from, object to)

Finds a route from /from/ to /to/ for object /who/

object mud.findpit (object in)

Find a pit object inside object /in/

bool mud.forced (object o)

returns true if /o/ is being forced to do whatever calls this lua

string mud.format_mass (int mass, player p)

return a nicely formatted string describing mass /mass/ grammes in playter /p/s preferred units

string mud.format_roomname (object room, object play, nilstring ic, nilstring oc, nilstring sin)

return preposition-prefixed form of /room/'s name, from the pov of /play/. The room name will be wrapped with /ic/ and /oc/ (eg, to colour it), if set. If /sin/ is set to "to", the preposition will be changed to a "to" form, eg "in" will become "into".

object mud.freequarters (object of)

find out whether there are any free quarters referred to by the quarters office /of/

char mud.gender (object o)

returns a one-char string which is 'm', 'f', 'n', 'a', etc, or '?'

object mud.getfloor (object o)

returns the floor of given room

object mud.getmount (object o)

returns the thing /o/ is riding, if any

void mud.give (object from, object what, object dest)

makes /from/ give /what/ to /dest/

vector mud.globalwithflag (flag f)

returns all objects in the mud which have flag /f/ set.

void mud.harm (object who, int amount)

remove /amount/ health points from /who/

bool mud.has_commbadge (object o)

returns true if /o/ is wearing a commbadge, has a commbadge implant, has commbadge prives or is in a commbadge-enabled zone

bool mud.has_vision (object who)

can /who/ see anything at all?

void mud.heal (object who, int amount)

heal /who/ up to /amount/ health points (which may be negative, which may cause death).

int mud.health (object who)

return the amount of health /who/ has. Will return simulated health if they are in a simulation.

object mud.holdsclone (object o, object c)

if /o/ holds any clones of /c/, return one of them. recurses into containers.

object mud.holdsflag (object o, flag f)

returns true if /o/ holds any object with flag /f/

object mud.holdszone (object o, string z)

returns any object held by /o/ with zone /z/

bool mud.is_drink (object what)

whether /what/ is drinkable

bool mud.is_food (object what)

whether /what/ is edible

bool mud.is_jammed (object o)

return true is /o/ is within the area of effect of a jammer

bool mud.is_zone (string zn)

returns true if /zn/ is the id of a zone

bool mud.isverb (string vn)

return true if the string /vn/ corresponds to a currently existing command, alias or action

object mud.kill (object who, nilstring msg, nilobject source, nilstring type)

make /blah/ die, with log message /source/ (/cause/) /msg/ (each of which can be nil). returns the corpse if any, which you should set a cause of death on.

object mud.leader (object o)

returns the object /o/ is following

bool mud.linked (object from, object dest)

are /from/ and /dest/ linked?

void mud.long_drop (object who, object ground, nilstring logmsg, nilobject paraground, bool silent)

move /who/ to /ground/, as if they have fallen a very long way. Tests for parachuting (to /paraground/ if set) and death. /silent/ suppresses messaging and /logmsg/ overrides default death log.

string mud.longdefaultrank (int level)

returns the long default rank corresponding to /level/

int mud.mass_within (object o)

return the mass of the children of /o/ recursively, in grams

vector mud.match_opt (object who, table arg, int options, objset from, filter filter_fn)

try to match /arg/ from the point of view of /who/, given the matcher flags /options/. Matcher flags look like match.LookBoth. If you set /options/ to match.LookSpecial and supply a table of objects to /from/, match_opt will try to match an object in that table.

object mud.matchplayer (object who, string str)

try to match /str/ to a person, from the point of view of /who/

vector mud.matchprep_opt (object who, table arg, int options, string prep, objset from, filter filter_fn)

try to match /arg/ from the point of view of /who/, looking for /prep/, applying match options as described under match_opt

int mud.max_health (object who)

returns the maximum amount of health /who/ could have.

int mud.maxlevel (object what)

the maxlevel on the specified object, converted to a rank number if necessary

int mud.minlevel (object what)

the minlevel on the specified object, converted to a rank number if necessary

bool mud.mobile (object o)

returns true if /o/ a mobile

object mud.mount (object who, object what)

makes /who/ mount /what/. No sanity checking is done whatsoever! Terminates existing mount with no messaging.

bool mud.naked (object who)

returns true if /who/ is naked

void mud.name_mobile (object mob)

give /mob/ a random human name

string mud.nation (object what)

returns the nation of /what/

string mud.parse_emote (object o, string a)

parse an emote string for @targets.

bool mud.person (object o)

returns true if /o/ is a player or a mobile

bool mud.player (object o)

returns true if /o/ a player

string mud.player_name (string id)

returns the colour and capitalised name of the player with /id/, who need not be logged in

int mud.privs (object who)

returns the effective level that /who/ is at, taking into account remort

object mud.quarters (object of, string area)

return the quarters belonging to /of/, if any

string mud.randomname (string section, nilstring nation)

generic random name. returns a name from the /section/ array on the names object /nation/

string mud.rankname (object who)

returns the full form of /who/'s rank as a string

object mud.rankobj (object who)

returns the rank object associated with /who/s service and nationality

int mud.rankprivs (string rankname)

returns the privs level associated with rank /rankname/

vector mud.realobjects ()

returns all non-destroy-on-reset, non-wilderness, non-transient, non-exit objects in the mud

set mud.riders (object o)

get the riders of the mount /o/

int mud.serving (object what)

the serving size of /what/, or the serving size of it's empty object

void mud.set_health (object who, int new_value)

return the amount of health /who/ has. Will return simulated health if they are in a simulation.

void mud.setfloor (object where, object newfloor)

If /where/ has a floor, swaps the old floor with /newfloor/ and moves everything that was upon it onto the new floor. Otherwise simply adds the floor and rectifies the state of all the children of /where/.

object mud.ship (object of)

return the spaceship belonging to /of/, if any

string mud.short_rank (object who)

returns the short form of /who/'s rank as a string

bool mud.traverse (object who, object link, nilstring motionverb)

makes /who/ traverse the exit /link/

bool mud.wearsclone (object o, object c)

returns true if /o/ wears any clones of /c/

object mud.wearsflag (object o, flag f)

if /o/ wears any objects or has any implants with flag /f/ return one of them. otherwise return nil.

bool mud.zone_getflag (object where, flag f)

int mud.zone_getint (object where, key prop, int def)

attempt to get an int property /prop/ from /where/, and recursing upwards through its parents folloing fwd links. Returns /default/ if no property is found.

nilstring mud.zone_getstr (object where, key prop, nilstring def)

attempt to get a string property /prop/ from /where/, and recursing upwards through its parents folloing fwd links. Returns /default/ if no property is found.

nations

bool nations.match (object a, object b)

returns true if the nation strings of /a/ and /b/ intersect

obj

void obj.attributes (object what, string pref)

returns a table with all the attributes on /what/ (only those starting with /pref/ if specified). Unlike getprops, attribute values are not returned.

string obj.brief_state (object what)

returns a short descriptive string decribing the state of /what/, eg. on fire.

void obj.cancel_plan (object what)

immediately cancels any pending plans on /what/.

void obj.close (object o)

closes door or container /o/ with no messaging. Does not check if there is an 'other' object to close.

bool obj.closed (object o)

returns true if /o/ is closed (applies to containers and doors)

set obj.components (object what)

gets the components of composite object /what/, if any

object obj.composite_parent (object what)

gets the parent composite object of which /what/ is a component, if any

void obj.do_tell (object who, object to, string msg)

tell /to/ /msg/ from /who/

void obj.drop (object o, objset items)

drop all the objects in items

void obj.file_plan (object what, nilstring plan)

makes /what/ file plan /plan/, or the default plan if no plan attribute is given.

vector obj.find_treatas (object what)

returns an ordered list of objects representing the C3 method resolution order for /what/

string obj.get_external_desc (object o)

returns the external description of the object if present, according to the object's state or description inheritance. Note: no examine or room_desc traps will be triggered by this action!

string obj.get_internal_desc (object o)

returns the internal description of the object if present, according to the object's state or description inheritance. Note: no examine or room_desc traps will be triggered by this action!

string obj.get_long (object o)

returns the long name of the object if present, otherwise "???" (can also be long.%i if the object has stated longs, and is in a suitable state)

string obj.get_name (object o)

returns the name of the object if present, otherwise "???" (name could be from name.0 or name.1 if they exist and that is the current state)

string obj.get_plural_long (object what)

returns the long plural name of the object if present, otherwise "???" (can also be long.%i.plural if the object has stated longs, and is in a suitable state)

string obj.get_plural_name (object what)

returns the plural form of /what/'s name (can also return stated plurals, if such attributes exist and the object is in a suitable state)

bool obj.interpret (object what, untainted cmd, bool allowalias, string err)

does /cmd/ as /what/, with optional error string /err/ if /what/ does not evaluate to a command. returns false if command interpretation failed.

void obj.interpretf (object what, untainted fmt, object varargs)

processess /fmt/ according to internal mud printf rules, and makes /what/ do it as if it were a command

bool obj.is_temporary (object what)

returns true if /what/ is a temporary object that the mud will automatically erase at some point in the future, eg. a clone.

bool obj.isa (object o, object c)

returns true if /o/ is /c/ or has treatas set to /c/

void obj.lock (object o)

locks door or container /o/ with no messaging. Does not check if there is an 'other' object to lock.

bool obj.locked (object o)

returns true if /o/ is locked (applies to containers and doors, implies item is closed)

void obj.move (object what, object where)

moves /what/ to be in /where/

object obj.next_treatas (object what, object current)

Finds the next object in the C3 method resolution order for /what/ after /current/

set obj.objects_upon (object what)

returns all the objects that are upon /what/

bool obj.once (object o)

first time it is run on /o/ it will return 1, from then on it will return 0 until the object is reset

void obj.open (object o)

opens door or container /o/ with no messaging. Does not check if there is an 'other' object to open.

bool obj.opened (object o)

returns true if /o/ is open (applies to containers and doors)

void obj.respond (object who, string msg)

Send message /msg/ to /who/'s last interlocutor in the same way as they last communicated with /who/, eg. a tell or sayto, etc.

void obj.say (object who, string msg)

makes /who/ say /msg/

void obj.set_upon (object what, nilobject onto)

places object /what/ onto /onto/, eg. makes people stand upon it, etc. If /onto/ is nil, remove /what/ from whatever it is currently upon.

void obj.setstance (object who, int pose, nilobject on)

make /who/ be in stance /pose/, (from the stance table, eg. standing, sitting, etc). Optionally supply an object for them to perform the stance upon.

void obj.smash (object smasher, object what)

smashes /what/ and handles its contents.

int obj.stance (object who)

gets the stance that /who/ is in: standing, sitting, etc

void obj.swap (object a, object b)

swap /a/ and /b/'s owners.

object obj.treatas_ancestor (object what)

Returns the highest priority object at the deepest point in the breadth-first traversal of /what/s treatas hierarchy

int obj.treatas_get_int (object what, key attr, int def)

Returns the value of /attr/ from the first object in /what/s C3 method resolution order which cas /attr/ set, or /def/ if none have it.

nilstring obj.treatas_get_str (object what, key attr)

Returns the value of /attr/ from the first object in /what/s C3 method resolution order which cas /attr/ set.

bool obj.treatas_has_flag (object what, flag f, bool s)

Returns true if /what/ or one of /what/'s ancestors has flag /f/ set to /s/

bool obj.treatas_has_str (object what, key attr, string val)

Returns true if /what/ or one of /what/'s ancestors has /attr/ equal to /val/

bool obj.try_smash (object smasher, object what)

let /smasher/ try to smash /what/. If the function returns true, you should generate some suitable messaging and call smash(), below.

void obj.unlock (object o)

unlocks door or container /o/ with no messaging. Does not check if there is an 'other' object to unlock.

object obj.upon (object what)

returns the object, if any, that /what/ is upon (eg. standing, sitting, sleeping, whatever).

void obj.vanish (object o)

if /o/ is a clone, delete, if not move to "empty"

void obj.vanish_all (object o)

vanish /o/ and all objects in it, recursively

int obj.volume_of (object what)

gets the volume of space /what/ takes up, in millilitres.

person

void person.follow (object who, nilobject leader)

makes /who/ follow /leader/, or stop following someone if /leader/ is nil

object person.following (object who)

returns the person that /who/ is following, or nil if they aren't in a group

pontoon

int pontoon.addplayer (object dealer, object who)

void pontoon.firstdeal (object who)

bool pontoon.nextturn (object who)

int pontoon.nonplayers (object who)

int pontoon.pontoon (object who)

void pontoon.results (object who)

ship

returns the ship docked at /where/, if any.

returns the ship docked at /where/, if any.

simulation

void simulation.start (object who, object where, object what)

starts simulation /what/ in simulator /where/ for /who/

object simulation.storage (object where, object who)

void simulation.vanish (object what, object who)

When used in a running simulation, the item will dissapear as if vanished. It will return to player when the holo ends. When used outside a holo it is the same as vanish.

state

object state.get (player p)

returns the lua state object /p/ is currently in, if any

string state.getstr (player p, key prop)

reads the /prop/ property of /p/'s current lua state

void state.pop (player p)

makes /p/ return to his previous state.

void state.push (player p, object s)

puts /p/ into lua state /o/.

void state.set (player p, object s)

replaces /p/'s current lua state with /s/.

void state.setstr (player p, key prop, string val)

stores /val/ in the /prop/ property on the current instance of /p/'s lua state

system

stringvector system.all_players ()

returns a list of all player IDs, offline or connected.

stringvector system.help_files ()

returns a list of all help files

stringvector system.info_files ()

returns a list of all info files

nilstring system.last_verb ()

returns the highest "verb" entry in the command stack, or nil if no verb has been executed

void system.log_stacktrace (priv pfl, string cat)

generate a log of the current command stack, in category /cat/, displayed to those with pflag /pfl/

stringvector system.policy_files ()

returns a list of all policy files

int system.relations (object what)

returns the number of relations that /what/ is currently participating in.

term

bool term.can_mplex (player p)

does /player/'s mudclient support multiplexing?

int term.columns (player p)

returns the number of columns /p/ wants in their screen

void term.flush (player o)

cause current buffer of /o/ to be sent to them.

void term.mplex_choose (player p, int i)

sends the code to choose multiplexed connection /i/ on /o/ for any output. 1 is subwindow for games, 0 is main window.

void term.mplex_flush (player p)

flush data for the purposes of mplexing

void term.mplex_hide (player p, int i)

hide the multiplexed window /i/ from player /p/

void term.mplex_roomupdate (object o)

call the 'mplex' trap on the room for everyone in it who has mplex support.

void term.mplex_setsize (player p, int i, int cols, int rows)

sets the size of the subwindow /i/ on /o/ to /cols/ by /rows/.

void term.mplex_show (player p, int i)

show the multiplexed window /i/ to player /p/

string term.player_colour_mode (player p)

returns a string representing the colour mode that player is in

int term.player_connected_since (player p)

returns the time that /p/ logged on

int term.player_fd (player p)

returns the file descriptor number associated with /p/'s socket, if they're connected

string term.player_host (player p)

returns /p/'s hostname, if known

string term.player_ip (player p)

returns /p/'s ip address, or - is /p/is linkdead

string term.player_ipv (player p)

return the ip version used by /p/, either v4 or v6

bool term.player_is_unicode (player p)

returns true if /p/ has unicode turned on somehow

int term.player_last_active (player p)

returns the time at which /p/ last executed a command

bool term.player_linkdead (player p)

is player /p/ linkdead?

string term.player_locality (player p)

returns the physical location associated with /p/'s ip address, if known

string term.player_mccp (player p)

returns the version and compression factor of MCCP /p/ is using, if any

string term.player_port (player p)

returns the name of the port that /p/ originall connected to: main, mono, ssl, webmake or unknown.

string term.player_protocol (player p)

returns the protocol /p/'s client is using

string term.player_state_id (player p)

returns the id of the interpreter state /p/ is currently in

string term.player_terminal (player p)

returns /p/'s terminal, if their client has identified itself

string term.player_termsize (player p)

returns the size of /p/'s terminal window, if their client supports NAWS

int term.rows (player p)

returns the number of rows /p/ wants in their screen

void term.send_data (object p)

void term.send_gmcp_table (player p, string data)

bool term.wants_gmcp_table (player p)

trap

[[noreturn]] void trap.abort ()

abort the current script execution without raising an error.

void trap.backtrace ()

returns a table containing the current lua stack of line numbers and chunknames in human readable(ish) form.

any trap.const_exec (eventname a, object pl, object o1, nilobject o2, nilobject treatas, nilobject o3, nilstring txt)

as per trap.exec, except operations that have side effects are explicitly forbidden and will result in errors.

int trap.elapsed ()

return the number of milliseconds that have elapsed since the chain of lua executions leading up to this function call began.

any trap.exec (eventname a, object pl, object o1, nilobject o2, nilobject treatas, nilobject o3, nilstring txt, table extra)

call the lua trap /a/ on /o1/ with o1 /o1/, o2 /o2/ (optional; if not then NULL) and pl /pl/. If /treatas/ is specified, the trap is loaded from that object but run on /o1/. Returns all the non-table values returned by the called trap. Example: trap.exec("foo", obj, obj) will execute the lua script "lua.foo" on object obj.

bool trap.get_trace ()

Get the current lua tracing mode

bool trap.is_const ()

are we operating in immutable object mode?

void trap.set_trace (bool state)

Set the current lua tracing mode

void trap.super ()

call the trap on the treatas that this trap has overridden. Returns all the same values as the called trap returns.

util

string util.build_plural_action (string stem, bool as_subject)

Turns /stem/ into an pluralisable action string such as "dance%[s]". If /as_subject/ is set to true, returns strings like "dance%<s>" instead.

string util.capitalise (string what)

capitalise the first letter of the given string

stringvector util.check_spelling (string w)

If /w/ appears to be misspelled, return a table of suggested spellings. Otherwise returns an empty table.

string util.escape_colour (string what)

returns /what/ with all escape codes escaped.

vector util.filter (objvector w, filter fn)

return only the objects of /w/ for which filter /fn/ returns true

vector util.filter_flag (objvector w, flag f)

returns all objects in /w/ which have flag /f/ set

vector util.filter_int (objvector w, key prop)

returns all objects in /w/ which have integer attribute /prop/

vector util.filter_out_flag (objvector w, flag f)

returns all objects in /w/ which don't have flag /f/ set

vector util.filter_out_int (objvector w, key prop)

returns all objects in /w/ which don't have integer attribute /prop/

vector util.filter_out_str (objvector w, key prop)

returns all objects in /w/ which don't have string attribute /prop/

vector util.filter_out_temporary (objvector w)

returns only the objects of /w/ which would not be marked is_temporary

vector util.filter_str (objvector w, key prop)

returns all objects in /w/ which have string attribute /prop/

void util.filterprops (object what, string filter)

returns a table with all the string properties on /what/ where the value contains the string /filter/.

string util.formatduration (int dur, bool nosecs)

converts a duration in seconds to a string: "x days x hours x minutes x seconds". If nosecs is true, seconds will not be returned.

string util.formattime (nilobject who, string format, int when)

format /when/ (a time_t value) with string /format/ (same as strftime uses) using timezone that /who/ has asked for. If /who/ is nil, the default mud timezone is used.

bool util.id_sort (string a, string b)

Our internal string comparison algorithm, which returns 1 < 2 < 10

bool util.in_list (string what, string list)

return true if /what/ is in the comma-separated list /list/

string util.infotext_parse (object who, string what)

Processes special $ escape codes in /what/, such as for helpfiles. If /who/ has a client that supports it, appropriate links will be generated.

bool util.inlist (object who, string list)

return true if /who/'s id is in the comma-separated list /list/

string util.lpad (string what, int width)

left-pad the given string to /width/ spaces. bear in mind colourcodes and doublewidth characters, etc.

int util.measure_width (string what, object who)

returns the length of string /what/ accounting for colour and other escape codes.

int util.mudhour (object room)

returns mud-time hour between 0 and 23 for /room/

int util.mudminute (object room)

returns mud-time minute between 0 and 59 for /room/

int util.now ()

returns the current time, in seconds, since 1970

string util.pad (string what, int width)

pad the given string to /width/ spaces. bear in mind colourcodes and doublewidth characters, etc.

int util.parsetime (string what, string format)

parse /what/ according to string /format/ (same as strptime uses) and returns a time_t value. Due to limitations of our internal storage format, this is limited in range, so be aware that dates a long time in the past or future will not parse correctly!

string util.plural_phrase (string w)

attempts to pluralise phrase /w/

bool util.prep (string cand)

eturns true if /cand/ is in the valid prepositions list.

string util.remove_articles (string txt)

eturns /txt/, minus leading articles

string util.rev (string what)

reverse /what/

string util.strip_colour (string what)

returns /what/ with all colour codes removed.

string util.toascii (string w)

strip colour codes and latin1 or unicode characters from /w/, making is plain ascii

set util.where (player p, string what, bool rooms, bool clones, bool exact)

returns all objects findable by /p/ matching the name /what/. If /rooms/ is true, return only rooms. If /clones/ is true, inlcude clones in list. If /exact/ is true, don't use the matcher; check only short and altshort of objects instead.

string util.wordwrap (object forwho, string s, int width, string prefix)

if /s/ is longer than /width/, linewrap it by inserting newlines and padding each new line with /prefix/.