These constants can be used anywhere in a program.
Type Name Description
char NULLCHAR A placeholder for a character.
obj NULLOBJ A placeholder for an object.
bool TRUE A true value.
bool FALSE A false value.


function int abs (int value)
Returns the absolute value of a given number.

function act (string string, char ch, obj obj, char ch2, int type)
Sends an action string out. This string does text replacements on the following codes:
  • $n - first character's name
  • $N - second character's name
  • $p - object's short description
  • $e/E - He/She/It - for first or second character
  • $s/S - His/Her/Its - for first or second character
  • $m/M - Him/Her/Its - for first or second character
The first character must be valid. The object and second character are not required to be valid unless a code refers to them. To indicate an unused character or object, use the NULLOBJ or NULLCHAR constants.
(Show Constants)

function bool add_achievement (char ch, int id)
This function records that the player has achieved this achievement specified by the achievement id. It returns FALSE if it is not a valid achievement, if the character is not a player, or if the achievement cannot be set (for instance, if it's an invalid ID, or if the player already has that achievement.

function add_cash (char ch, int silver, int gold, int plat)
This adds the specified amount of money to the character. The amounts may be negative, but the character may never have less than zero in any coin denomination.

function bool affect_add (char ch, string spellname, int level, int where, int location, int modifier, int bitvector, int duration)

This attempts to add an affect to a character. The name must be an existing spell or skillname, although "reserved" will work if it needs to. The level is the affect level.

WHERE refers to which type of flags are being used, the TO variables.

Location is which stat to modify, one of the APPLY variables.

Modifier is the amount to modify the named stat by, which can be positive or negative. Flags are the specific flags to set, determined by the WHERE setting. The available flags follow, and multiple flags of the same type can be selected using the bitwise OR operator. Duration is how long the affect will remain with the character. It returns TRUE if successful, FALSE if not. It can fail if the victim already has the named affect, or if any of the parameters are invalid.

Flags: These are the assorted flags. They can have bitwise operators performed against them.

(Show Constants)

function string affect_get_first (char ch)
This returns the name of the first affect on the character.

function string affect_get_next (char ch, string name)
This returns the name of the next affect on the character, after the one named.

function int affect_getval (char ch, string name, int value)
This returns information about an affect on a character. If there is no such affect, the return is 0.
(Show Constants)

function bool affect_has (char ch, string name)
This returns TRUE if the character has the named affect, or FALSE otherwise.

function bool affect_remove (char ch, string name)
This function removes the named affect from a character, returning TRUE if successful, and FALSE if not. Please use can_remove_affect where appropriate to determine is this is an affect tthat should be removed.

function char area_first_char (area area, bool pc)
This returns the first character in the area specified. This may return an invalid handle, if there are no characters in the area.

function string area_getstring (area area, int val)
This function returns information about an area. It can also be accessed via the dot syntax (area.name)
(Show Constants)

function int area_getval (area area, int val)
This function returns information about an area. It can also be accessed via the . syntax (area.level)
(Show Constants)

function char area_next_char (area area, char ach, bool pc)
This returns the next character in the area specified. This may return an invalid handle, if there are no more characters in the area.

function int area_next_shop (area area, int last_shop)
Returns the vnum of the next mob shop after last_shop, in the area, or 0. This function will find the first shop if last_shop is set to 0.

function int area_setval (area area, int val, int newvalue)
This function sets non-persistant data on an area. It returns the newly set value, or a -1 on failure.
(Show Constants)

function bool areaquest (char ch, room room, int cstate, int nstate)
This function sets a character's areaquest state. The area is the area that the room is part of. The current state must be equal to the character's progress on this quest, or the function returns FALSE. If successful, it returns TRUE and sets the character's quest state to the newstate value. If the newstate is -1, the function rewards the character for completing the quest.

function int atoi (string string)
Returns the integer that corresponds to a text string. If the string is not a number, it returns 0.



function special call (int vnum, int type, special caller, string argument, int ret_type)
This function executes another lensc program, and waits for that program to finish executing before continuing. The caller must match the expected caller type that the called program expects (char or obj). The argument is the string argument passed to the second program, and the vnum is the vnum of the program to call. The called program may specify a value to return to the calling program with the END keyword. The returned value's type must match the RETURNTYPE variable. In the case that the called program fails to specify a return value, or the called program fails unexepectedly, or that the called program returns a value of the wrong type, a 0 will be returned, which is treated as an invalid value for type other than int or bool. See also: Launch
(Show Constants)

function bool can_move_vehicle (vehicle veh, int dir)
This function returns TRUE if the vehicle can move in the specified direction, and FALSE otherwise.
(Show Constants)

function bool can_remove_affect (string name)
Returns TRUE or FALSE based on whether the named affect can normally be dispelled. For mobs that provide named affect removal, this should be used to ensure that players don't get around internal limits.

function bool ch_can_specialize (char ch, int spec)
Returs TRUE if the character is qualified to use the specialization, FALSE for mobs and if the character does not have the prerequisites.
(Show Constants)

function bool ch_check_morale (char ch)
Checks the character's morale, returns TRUE if they should be fleeing.

function ch_clear_memory (char ch, int id)
This function clears a memory that was set with the ch_set_memory function. It is important to clean up memory data that you no longer need, so, for example, if you are remembering the state of a quest, and the quest is completed, clear that memory.

function bool ch_deduct (char ch, int type, int amount)
Deducts some number of points from a PC's account. Either deducts the whole amount, or none at all (no partials). Returns TRUE if deducted, FALSE if not deducted (or used on an NPC).
(Show Constants)

function obj ch_first_carrying (char ch)
This returns the first object in the list of character's possessions. No checks are made for whether it is inventory or worn, visible or not.

function int ch_get_hero_level (char ch)
Returns the character's hero or sage level. Returns 0 for mobs, non-heros.

function char ch_get_master (char ch)
Returns the character that this character is charmed to obey. Can return an invalid handle if the character is not charmed, or has no master.

function string ch_get_memory_string (char ch, int id)
This function retrieves the string stored with the designated ID, or an empty string if no memory exists with that ID.

function int ch_get_memory_value (char ch, int id)
This function retrieves the number stored with the designated ID, or 0 if no memory exists with that ID.

function char ch_get_mount (char ch)
Returns a handle to the character this character is riding. May return an invalid handle.

function char ch_get_pet (char ch)
Returns the pet of the character. Not necessarily a valid char.

function int ch_getareaquest (char ch, room room)
This function returns the character's areaquest state for the given room. Mob's and invalid rooms return -1.

function string ch_getextra (char ch, string keyword)
This function returns the extra data string associated with the given keyword. For players, or non-existant keyword matches, it returns an invalid handle.

function string ch_getstring (char ch, int string)
This function is used to retreive a string from a character. It can also be accessed via the dot syntax (ch.name)
(Show Constants)

function int ch_getval (char ch, int val)
This function is used to retreive a value from a character. It can also be accessed via the dot syntax (ch.willpower) The following constants are used to specify which value is desired:
(Show Constants)

function bool ch_grant_xp (char ch, int amount)
Grants XP to a character. Wiznet logged. Returns TRUE if grant is successful, FALSE otherwise.

function int ch_has_advantage (char ch, int ad)
This function is used to query whether a character has a certain advantage. NPC's always return FALSE. The following constants are used to specify which advantage is being queried:
(Show Constants)

function bool ch_heal (char ch, int type, int amount)
Heals the specific attribute by amount specified. Cannot take negative values. Returns TRUE if character is at max value. Can query if character is maxed by using amount of 0, and checking return value.
(Show Constants)

function room ch_in_room (char ch)
This function returns the room that the character is in.

function bool ch_is_defending (char ch)
Returns TRUE if character is in defend mode.

function char ch_is_fighting (char ch)
Returns a handle to whoever this character is fighting. The handle is invalid if the character is not fighting.

function bool ch_is_flying (char ch, bool ride)
Returns TRUE if the character is flying, FALSE if not. Ride variable specifies if you want to know whether they're flying on their own, or if they're riding a flying mount.

function char ch_is_following (char ch)
Returns a handle to whoever this character is following. The handle is invalid if the character is not following anyone.

function bool ch_is_fpk (char ch)
Returns TRUE if the player is FPK. FALSE otherwise.

function bool ch_is_hero (char ch)
Returns TRUE if the character is a HERO, FALSE otherwise.

function bool ch_is_mob (char ch)
Returns TRUE if the character is a mob, FALSE if the character is a player.

function bool ch_is_pet (char ch)
Returns TRUE if the character is a 'pet' and FALSE otherwise.

function bool ch_is_pk (char ch)
Returns TRUE if the player is PK. FALSE otherwise.

function bool ch_is_remort (char ch)
Returns TRUE if the player is a remort. FALSE otherwise.

function bool ch_is_sage (char ch)
Returns TRUE if the character is a SAGE, FALSE otherwise.

function bool ch_is_subduing (char ch)
Returns TRUE if character is in subdue mode.

function ch_modify_morale (char ch, int mod)
Changes the character's morale by the set amount, paying attention to maximums and minimums.

function obj ch_on_obj (char ch)
This returns the handle to the object the character is currently on (furniture), or an invalid handle if not on anything.

function ch_set_memory (char ch, int id, int value, string string)
This function sets a memory on a character. This memory will remain on the character until explicitly cleared with ch_clear_memory. The ID specified is a unique identifier that will be used to reference this memory. You should use a number that would be a valid vnum in the zone you are working with. The memory will remember both a number and a string. If you do not need to use a string, set the string variable to "". If you do not need to use a number, use a 0. If the character already has a memory with the specified ID, it will be overwritten with the new value.

function bool ch_setstring (char ch, int string, string text)
This function is used to set a string on a mob. This returns TRUE if the string was successfully set, and FALSE if it was not (including if the character was a player).
(Show Constants)

function int ch_skill_taught_cost (char ch, int sk)
Returns the base cost to teach a given skill. Returns -1 if ch is not a mob, does not teach the specified skill.

function int ch_skill_taught_first (char ch)
Returns skill number of first skill this mob teaches. Returns -1 if checking PCs, or non-teacher NPCs.

function int ch_skill_taught_next (char ch, int sk_last)
Returns skill number of next skill this mob teaches, after the one specified. Returns -1 if checking PCs, non-teacher NPCs, sk_last is not taught, or no more skills are taught.

function ch_skip_attack (char ch, int num_attacks)
Forces the character so lose attacks as if using a powerful spell. Has no effect if character is not currently in combat.

function bool ch_to_obj (char ch, obj obj, int pos)
This function is used to place characters on furniture, or in specific positions. The item, which may be NULLOBJ, must be either furniture or furncont if provided. Positions possible are: This returns TRUE if the position was set, and FALSE if it was not (for any reason).
(Show Constants)

function change_align (char ch, int change)
Alters the character's alignment by the specified amount. This amount should be unmodified - as internal code handles adjusting it for the character's current alignment. Internal code will also force any results of an alignment change to occur.

function int clan_getval (string clanname, int val)
Gets info about a clan. Returns -1 for invalid requests.
(Show Constants)

function char create_mob (int vnum, room room)
This creates a new mob with the given vnum, in the specified room. The mob runs its INIT action, if any. No message is generated by this function.

function obj create_obj (int vnum, room room)
This creates the object with the given vnum in the room specified. No messages are presented, so the object can be moved to a character or container after creation. The function returns a handle to the new object.

function vehicle create_vehicle (int vnum, room room)
This creates a new vehicle with the given vnum, in the specified room. If the vehicle is set for random movement, it will be started. A handle to the vehicle is returned, but can be invalid if the vehicle fails to create.


function bool dam_mana (char ch, int dam)
Subtracts amount from player's mana. Will not go below zero mana, and cannot use negative amounts. Returns TRUE if successful, FALSE otherwise.

function bool dam_will (char ch, int dam)
This function lowers the character's willpower by the amount specified.

function bool deduct_money (char ch, int cost)
This function removes the amount of money, specified in silver, from the character. It returns TRUE if successful. If it returns FALSE, the character did not have enough. Before using this function, you should make sure the character has enough cash on them with the ch_get_value (CHAR_VALUE_CASH) function.

function disturb (char ch)
This disturbs the character, interrupting any continued actions they may be working on.


function bool equip_char (char ch, obj obj, int wear_loc)
This takes an item in a character's inventory and equips it to a wear location. The item must be in the character's inventory, and they may not have anything else equipped to that location, or this function will fail. Try checking get_obj_worn to ensure that the wear location is available prior to calling this function. Wear locations are: Returns TRUE if successful, FALSE otherwise.
(Show Constants)

function bool exit_closed (exit ext)
Returns TRUE if the exit is closed, FALSE otherwise.

function exit exit_exist (room pRoom, int dir)
This function returns the exit in the specified direction in the given room. The return is invalid if no exit is available in that direction. Exit directions are: DIR_NORTH - north DIR_EAST - east DIR_SOUTH - south DIR_WEST - west DIR_UP - up DIR_DOWN - down

function string exit_getstring (exit exit, int val)
Returns exit strings.
(Show Constants)

function int exit_getval (exit ext, int val)
Returns exit information. 0 If no information is available.
(Show Constants)

function bool exit_locked (exit ext)
Returns TRUE if the exit is locked, FALSE otherwise.

function room exit_to (exit ext)
This function returns the room where the exit leads to. Any valid exit is defined to have a valid room associated with it, however, exits to the wilderness should be used as soon as found, as wilderness rooms can shift.

function obj extract_object (obj obj)
This function removes an object from the game. It returns the handle to the removed object so that it can be invalidated. If it is not invalidated, the program will terminate abnormally as there is a broken handle. invalidate extract_object(object);


function bool fatigue (char ch, int dam)
This function lowers the character's vitality by the amount specified.

function string first_word (string p, int first)
This function takes a string and removes the first word (space or quote separated). The constant determies what is returned:
(Show Constants)


function game_clear_memory (int id)
This function clears a memory that was set with the game_set_memory function. It is important to clean up memory data that you no longer need, so, for example, if you are remembering the state of a quest, and the quest is completed, clear that memory.

function string game_get_memory_string (int id)
This function retrieves the string stored with the designated ID, or an empty string if no memory exists with that ID.

function int game_get_memory_value (int id)
This function retrieves the number stored with the designated ID, or 0 if no memory exists with that ID.

function game_set_memory (int id, int value, string string)
This function sets a memory on the game. This memory will remain on the game until explicitly cleared with game_clear_memory. The ID specified is a unique identifier that will be used to reference this memory. You should use a number that would be a valid vnum in the zone you are working with. The memory will remember both a number and a string. If you do not need to use a string, set the string variable to "". If you do not need to use a number, use a 0. If the game already has a memory with the specified ID, it will be overwritten with the new value.

function string get_achievement_string (int id)
This function returns the achievement string associated with the achievement ID specified. It returns an invalid string if there is no such achievement.

function area get_area_by_name (string string)
Returns a handle to the area specified by the string. May return an invalid handle. This function will check both the area name, and the area's filename.

function area get_area_by_vnum (int vnum)
This returns a handle to an area based on a vnum.

function int get_base_skill (char ch, string skillname)
This returns the character's current skill (0 to 100) rating in the named skill.

function char get_char_in_room (room room, string string)
This function looks for a character in the specified room, which has keywords matching name. This function can return an invalid character, if none are found, so your program should check for that before using that value.

function char get_char_room (char ch, string arg)
This function looks for a character in the same room as ch, which has keywords matching name. This function can return an invalid character, if none are found, so your program should check for that before using that value. It does not find characters that ch cannot see.

function char get_char_world (char ch, string arg)
This function looks for a character anywhere in the world, which has keywords matching name. This function can return an invalid character, if none are found, so your program should check for that before using that value. It does not find characters that ch cannot see.

function string get_line (char ch, string prompt)
This puts the character in the editor and prompts them to enter a line of text. The program suspends while waiting for input. If used on a mob, or in the debugger, a substitute result string is used, as the editor is unusable. There is a 2 minute timeout on responses allowed.

function string get_line_timeout (char ch, string prompt, int timeout)
This puts the character in the editor and prompts them to enter a line of text. The program suspends while waiting for input. If used on a mob, or in the debugger, a substitute result string is used, as the editor is unusable. You can specify, in seconds, how long before the input times out.

function obj get_obj_carry (char ch, string str)
This functions finds an item in a character's inventory that matches the name provided. It will not find items the character cannot see.

function obj get_obj_in_obj (char ch, string str, obj cont)
This functions finds an item in a container that matches the name provided. It will not find items the character cannot see.

function obj get_obj_room (char ch, string str)
This function returns the item in the room that the character is in, that the character can see, and that matches the given keyword(s). The returned object may be invalid, indicating nothing was found.

function obj get_obj_world (char ch, string argument)
This returns a handle to an area based on a vnum.

function obj get_obj_worn (char ch, int wear_loc)
This functions finds an item worn in the specified position.
(Show Constants)

function char get_oif_ch ()
Don't use this, it is only for enabling the object version of lif.

function room get_random_room_area (char ch, area pArea, bool noport)
This function returns a room handle to a random room to a area specified by pArea, that the character can see. The handle returned is guaranteed to be a valid room, but may be Limbo if no valid room is found. If no area is specified (using a null handle), then the area that the character is currently in will be used. If noport is FALSE, any non mob-chute room is a possible choice. If TRUE, only rooms that aren't teleport safe will be returned.

function int get_reaction (char ch, char victim)
This function will return the numerical reaction (-100 to 100, where -100 is want to kill, and 100 is love) that the ch has towards the victim.

function room get_room_by_vnum (int vnum)
This returns the room refered to by the given vnum. It can return an invalid room, so this must be checked.

function int get_skill (char ch, string skillname)
This returns the character's current skill (0 to 100) rating in the named skill.

function string get_skill_by_sn (int sn)
Returns a string that is the name of the skill with the specified number. Will return an empty string if the specified number is too low or too high, or if there is no skill with that number.
(Show Constants)

function int get_systime ()
Returns current system timestamp.

function string get_text (char ch)
This puts the character in the editor, and returns the edited text block. As with get_line, this doesn't work for mobs, or for the debugger.

function string get_text_ext (char ch, string init_text)
This puts the character in the editor, and returns the edited text block. As with get_line, this doesn't work for mobs, or for the debugger.

function vehicle get_vehicle_from_room (room pRoom)
This function returns a handle to the vehicle associated with the room specified. This will return an invalid handle if the room is not associated with the vehicle as either a default room, or the entry or bridge room of a ROOMS vehicle.

function vehicle get_vehicle_in_room (char ch, string argument)
This function returns a handle to a vehicle that the character can see in the room. It can return an invalid handle.

function room get_wilderness_room (int x, int y, int z)
Returns the wilderness room at the specified coordinates. Use this fairly quickly, as the Wilderness shifts based on usage, and if you get a room, and don't use it, the room won't be invalid, but it won't be where you expect it to be. This can return an invalid room handle if the coordinates supplied are invalid.

function char group_first_char (int group_id)
Returns the leader of the group, or an invalid handle if no group is found or no leader exists.

function int group_get_info (int group_id, int query)
Returns info about the group. Returns -1 if no such group, or an invalid request.
(Show Constants)

function char group_next_char (int group_id, char group_member)
Returns the next member of the group, or an invalid handle if no group is found or no more characters are in the group.


function bool has_achievement (char ch, int id)
This function checks to see if the player in question has accomplished the specified achievement.

function bool has_mastered (char ch, int spec)
This function returns TRUE if a character has mastered the named spec, and FALSE otherwise. Specs are:
(Show Constants)

function heal_effect (char ch, char caster, int level, int potency)
Invokes the heal code. This includes position updates, combat damage removal where appropriate, and messages about changed status. ch is the character to be healer, caster is the character doing the healing (can be the same as ch). Level is the level of the healing, potency equates to how powerful the effect is: Cure Light: 1 Cure Serious: 2 Cure Critical: 3 Heal: 4 True Heal: 5

function char hurt (char ch, int dam, int dt, bool safe)
This function deals dam hitpoints of damage to ch, of a specified type of damage. It returns the character, so that they can be invalidated. If they're not invalidated, and this function kills them, the program execution will stop. The safe parameter will ensure that they are not killed. Example: invalidate hurt(ch,50,DAM_FIRE,FALSE);
(Show Constants)


function bool interpret (char ch, string text)
This function makes a character perform the command listed as if they had typed it. It returns TRUE if the action was successful, and FALSE if not. This function always results in the lensc program suspending until the next pulse in case a character died as a result of the action.

function char is_bound (char ch)
Returns the handle to the character this character is bound to, or an invalid handle if not bound.

function bool is_disabled (char ch1, char ch2)
Checks to see if ch1 is disabled by ch2. Returns TRUE if disabled, FALSE if not. Mob's are never disabled, and never disable anyone.

function bool is_enabled (char ch1, char ch2)
Checks to see if ch1 is enabled by ch2. Returns TRUE if enabled, FALSE if not. Mob's are never enabled, and never enable anyone.

function int is_immune (char ch, int dam_type, obj weapon, bool spell)
This function tests whether a character is immune, resistant, or vulnerable to a certain damage type. If an object is specified, immunity to weapons, and the object's material will be checked. If spell is TRUE, immunity to magic will also be checked.
(Show Constants)

function int is_immune2 (char ch, int dam_type, int material, bool spell)
This function tests whether a character is immune, resistant, or vulnerable to a certain damage type. If an object is specified, immunity to weapons, and the object's material will be checked. If spell is TRUE, immunity to magic will also be checked.
(Show Constants)

function int is_immune3 (char ch, int dam_type, obj weapon, bool spell, int dam_loc)
This function tests whether a character is immune, resistant, or vulnerable to a certain damage type. If an object is specified, immunity to weapons, and the object's material will be checked. If spell is TRUE, immunity to magic will also be checked. It also allows you to specify a location.
(Show Constants)

function bool is_name (string str, string namelist)
This returns TRUE if name is found in the keyword list. This is standard keyword matching as used by the rest of the mud.

function bool is_safe (char ch, char victim, int flags)
Checks to see if victim is safe from ch. TRUE means that ch is not allowed to attack victim for some reason. The flags can be OR'ed together if needed, or left 0 if none are required.
(Show Constants)

function bool is_valid_area (area p)
Checks validity of an area variable. Returns TRUE is valid, FALSE otherwise.

function bool is_valid_char (char p)
Checks validity of a char. Returns TRUE is valid, FALSE otherwise.

function bool is_valid_exit (exit p)
Checks validity of an exit. Returns TRUE is valid, FALSE otherwise.

function bool is_valid_obj (obj p)
Checks validity of an obj variable. Returns TRUE is valid, FALSE otherwise.

function bool is_valid_room (room p)
Checks validity of a room. Returns TRUE is valid, FALSE otherwise.

function bool is_valid_vehicle (obj p)
Checks validity of a vehicle variable. Returns TRUE is valid, FALSE otherwise.




function bool language_known (char ch, int lang)
Returns TRUE if the characters knows the language, FALSE if not. Languages are:
(Show Constants)

function bool launch (int vnum, int type, special caller, string argument)
This function executes another lensc program, and then continues execution of the current program immediately. The caller must match the expected caller type that the called program expects (char or obj). The argument is the string argument passed to the second program, and the vnum is the vnum of the program to launch.
(Show Constants)

function int lensc_is_ch_run (char target, int vnum)
This function returns a count of how many times this character is running a program with the specified vnum. This can be useful in restricting the number of simultaneous runnings of the same program.

function int lensc_is_obj_run (obj target, int vnum)
This function returns a count of how many times this object is running a program with the specified vnum. This can be useful in restricting the number of simultaneous runnings of the same program.


function string map_at (int x, int y, int z)
Returns a string that holds the map at the requested coordinates in the wilderness.

function int max (int n1, int n2)
This function returns the larger of two numbers.

function int min (int n1, int n2)
This function returns the smaller of two numbers.

function string mob_first_extra (char ch)
This returns the keyword for the first extra description for the mob prototype. An empty string is returned if there are no extra descriptions, or for PCs.

function bool mob_has_shop (char ch)
Returns TRUE if the mob owns a shop (not a spec_ type shop), FALSE if not (or if the 'mob' is actually a player).

function string mob_next_extra (char ch, string last_keyword)
This returns the next available keyword for extra descriptions on the mob's prototype. An empty string is returned if there are no extra descriptions, or if a PC is used.

function int mob_setval (char ch, int val, int setto)
This function is used to set a value on a mob. The setto variable holds the desired value for the specified variable. The function returns the new value for the specified stat. This may not be what you requested, as some internal limits apply. In case of an invalid request, the return value will be 0. The following constants are used to specify which value is desired:
(Show Constants)

function string mobchat (char ch, char victim, string phrase)
This returns what a mob would say to the person they are speaking to, given a specific input.

function int modify_reaction (char ch, char victim, int amount)
This function will modify the numerical reaction (-100 to 100) that the ch has towards the target. It will return the resulting reaction.

function bool move_char (char ch, int dir)
This uses the mud's internal character movement code to move a character in a direction. It returns TRUE if succesful (the char moved) and FALSE otherwise. All move costs, movement verbs and messages, and validity-of-move are handled. Exit directions are:
(Show Constants)

function move_char_to_room (char ch, room room)
This function moves the specified character to the specified room. No messages are created for those in the room newly entered, or left. The character does not auto-look either, if you want them to see the new room, you need to do an interpret(ch,"look auto"). Used on a mounted character, this moves the mount too.

function move_obj_to_char (obj obj, char ch)
This function moves the specified item to the specified character's inventory.

function move_obj_to_obj (obj obj, obj cont)
This function moves the specified item to the specified container.

function move_obj_to_room (obj obj, room room)
This function moves the specified item to the specified room.

function bool move_vehicle (vehicle vehicle, int door)
This function moves the vehicle in the direction specified. It returns TRUE if the move was successful, and FALSE if it was not.
(Show Constants)



function char obj_carried_by (obj obj)
Returns the character carrying the item. If the item is not in an inventory, the returned value is invalid. Does not check nested contents of containers.

function obj obj_first_content (obj obj)
This returns the first object located inside the calling object. If the calling object contains nothing, it is an invalid object.

function string obj_first_extra (obj obj, bool proto)
This returns the keyword for the first extra description on the object. If proto is set, it will look at the object definition, otherwise it will look at the specific object. An empty string is returned if there are no extra descriptions.

function string obj_getextra (obj obj, string keyword)
This function returns the extra description string associated with the given keyword. For non-existant keyword matches, it returns an invalid handle.

function string obj_getstring (obj obj, int val)
A function to return a string from an item. It can also be accessed via the dot syntax (obj.name)
(Show Constants)

function int obj_getval (obj obj, int val)
A function to return a value from an object. It can also be accessed via the dot syntax (obj.vnum)
(Show Constants)

function obj obj_in_obj (obj obj)
This returns the object that contains the calling object. If the object is not in a container, the return value is invalid.

function room obj_in_room (obj obj)
This returns the room that the object is in. If the object isn't in a room (in inventory or a container) it is an invalid room.

function bool obj_interpret (obj obj, string argument, char ch)
This forces the object to interpret the string as if in an obj action. Returns TRUE if successful, FALSE otherwise. The ch parameter is optional, but required by some interpreted object commands. Supply an invalid character if not using.

function obj obj_next_content (obj obj)
This returns the next object in whichever list the calling object is in. For instance, if the object is in a room, this function will return the next thing in the room. If the object is in a container, it will return the next item in the container. This will return an invalid value if there is nothing else in the list.

function string obj_next_extra (obj obj, string last_keyword, bool proto)
This returns the next available keyword for extra descriptions on the object. If proto is set, it will look at the object definition, otherwise, it will look at the item specified. An empty string is returned if there are no extra descriptions.

function int obj_queryaffect (obj obj, int querytype, int query_subtype)
This returns information about affects on an item. These queries require a subtype parameter, to specify which affect to return information about, if possible.
(Show Constants)

function bool obj_setextra (obj obj, string keyword, string desc, bool replace)
This sets a descriptive keyword on an item. If replace is TRUE, it will overwrite any current description using that keyword. If replace is FALSE, it will not set the new data. The function returns TRUE if the extra description is set, and FALSE if it is not. If replace is TRUE, and the string is empty (""), the extra will be removed from the object, although not from the object's prototype.

function bool obj_setstring (obj obj, int val, string text)
A function to set a string for an item. The string set is based on the constant input value: The function returns TRUE if the string is set successfully, FALSE otherwise.
(Show Constants)

function bool obj_setval (obj obj, int val, int nv)
A function to set a value for an item. The value to set is specified by the constant input. The new Value to set is specified as NewValue. Possible values to set are:
(Show Constants)

function string ocean_name (int x, int y)
Returns the name for the body of water at the coordinate specified.


function pause (int delay)
This function pauses execution for the specified amount of seconds, before executing the next command.


function bool quest_award (char ch, int amount)
This gives the player some quest points. Any award over 10 points will be trigger a BUG message - be reasonable. It returns FALSE if it fails for some reason, TRUE normally.


function int random (int from, int to)
This function returns an integer value between low and high inclusive.

function int random_curve (int avg, int curve)
Returns a random number with the specified average value, based on a probability curve from 0 to 10. 0 is a flat curve (will always return the average), while 10 is any number from 1 to 2*average. The intermediate values create random distributions that (from 1 to 9) get progressively more diverse.

function int range (int min, int num, int max)
Returns a number in the range from low to high. If value falls between low and high, value is returned, otherwise the upper or lower limit specified is returned.

function bool remove_achievement (char ch, int id)
This function removes the specified achievement from the player. It returns FALSE if the player does not have the achievement set, or if the character is not a player.

function restore_char (char ch)
Performs a restore on the character.

function int rev_dir (int dir)
This function returns the opposite direction from the input.
(Show Constants)

function bool reward_player (char ch, int type, int amount)
This function will award a number of Questpoints, trains, or practices to the specified player. Will return TRUE if successful, FALSE if not (if ch is a mob, for example)
(Show Constants)

function bool room_damage_all (room room, int dam_amount, int dam_type, bool killable)
This function will deal damage to everyone in the specified room. Returns TRUE if anyone died (causing potentially invalid handles), FALSE otherwise.
(Show Constants)

function char room_first_char (room room)
This returns the first character in the room. It is not required to be a valid character.

function obj room_first_content (room room)
This returns the first object in the list of objects in the room. It is not required to be a valid object.

function string room_first_extra (room room, bool proto)
This returns the keyword for the first extra description in the room. If proto is set, it will look only at extras on the room definition, otherwise it will look at the active room only. An empty string is returned if there are no extra descriptions.

function area room_getarea (room room)
This returns the area that the room is located in.

function string room_getextra (room room, string keyword)
This function returns the extra description string associated with the given keyword. For non-existant keyword matches, it returns an invalid handle.

function string room_getstring (room room, int val)
This returns a text string from the room. It can also be accessed via the dot syntax (room.name)
(Show Constants)

function int room_getval (room room, int val)
This returns a value about the room. It can also be accessed via the dot syntax (room.vnum) Room values accessible are:
(Show Constants)

function char room_next_char (char ch)
This returns the next char in the room. This is not required to be a valid character. The current character being evaluated must be passed to this function.

function string room_next_extra (room room, string last_keyword, bool proto)
This returns the next available keyword for extra descriptions in the room. An empty string is returned if there are no extra descriptions.

function room_sendtext (room room, string text)
This sends the specified string to all characters in the room.

function bool room_setextra (room room, string keyword, string desc, bool replace)
This sets a descriptive keyword on a room. If replace is TRUE, it will overwrite any current description using that keyword. If replace is FALSE, it will not set the new data. The function returns TRUE if the extra description is set, and FALSE if it is not. If replace is TRUE, and the string is empty (""), the extra will be removed from the object, although not from the object's prototype.

function string room_setstring (room room, int val, string new_string, int duration)
This sets a text string in a room. It returns the new string. Duration is in minutes. Room strings accessible are:
(Show Constants)

function int room_setval (room room, int val, int new_value)
This sets a value about the room, and returns the new value. Modifiable room values are:
(Show Constants)

function int round (int numerator, int denomenator)
This function divides the numerator by the denomenator, rounding fractions 1/2 or greater up.


function bool saving_throw (int level, char caster, char victim, int dam_type)
This gives a character a saving throw, returning TRUE if they successfully save, and FALSE if they do not. The CASTER can be invalid in cases where no one is creating the attack. LEVEL is the level of the attack. DAM_TYPE can be one of:
(Show Constants)

function send_channel (string text, int chan)
Sends the string to one of the game's automated channels:
(Show Constants)

function send_note (string to, string from, string subject, string text, int type)
Posts a note to the specified board.
(Show Constants)

function sendt (char ch, string txt)
This sends the string of text to the character.

function bool set_busy (char ch, int delay)
Sets a character as busy for the specified amount of time (seconds). The function returns TRUE if the full time was spent busy, or FALSE if the character is disturbed.

function int shop_getval (int vnum, int type)
Gets values related to a shop owned by mob with stated vnum. -1 is returned for any non-shop vnum queried.
(Show Constants)

function bool skill_check (char ch, string skillname)
This checks a character's skill, returning TRUE on successful skill use, and FALSE otherwise. Unknown skills return FALSE always.

function string skill_getname (int sn)
Returns the name of the skill with specified id, or "reserved" if no such skill.

function int skill_getval (int sn, int val)
Returns information about a skill. Returns -1 if an invalid option is selected, or the skill does not exist.
(Show Constants)

function int spec_get_next_skill (int spec, int last_sn)
Returns the next skill number in a specialization. Use -1 as a last_sn to get the first skill in the spec. Returns -1 when there are no more skills.
(Show Constants)

function start_vehicle (vehicle vehicle)
This function starts a vehicle moving on its own. If the vehicle is not set as either Random, or Path (or if there is no path defined), this function will fail, and produce a bug warning on wiznet.

function bool stat_check (char ch, int st)
This checks a character's stat, returning TRUE if it passes the check, and FALSE otherwise.
(Show Constants)

function string string_in_string (string instring, string target)
Returns the string that starts at the first occurance of target in instring.

function int string_index_of (string instring, string target, int start_offset)
Returns the character position (as a 0-based index) of the target string within the input string. If not found, returns -1. Start_offset can be used to specify a starting position to begin looking from. Use 0 to start at the beginning of the string.

function bool string_is_empty (string p)
Checks to see if there are any characters in a string variable. Returns TRUE if there are not, FALSE otherwise;

function int string_length (string string)
Returns the number of characters in a string.

function string string_pad (string input_string, int padwidth, string padchar, int padtype, bool color)
Takes the input string and pads it to the desired width with the padchar. If input_string is longer than padwidth, simply returns input string. Padchar must be a single character. If padchar is more than one character, this function will return an empty string. If color is TRUE, then padding will be done ignoring color codes. If color is FALSe, padding will count color codes in the final total.
(Show Constants)

function string string_prefix (string string, int count)
Returns the string composing the first count characters in the input string.

function string string_replace (string instring, string target, string replacement)
Returns a string where every occurance of 'target' in the original string is replaced with the replacement string.

function string string_substring (string instring, int start, int end)
Returns the substring from characters start to end. If either are out of the string's bounds, returns an empty string. Start and End are 0-based indexes.

function string string_suffix (string string, int count)
Returns the string composing the last count characters in the input string.

function int string_to_lensc_const (string string)
This function will return the INT value that matches the lensc constant specified in the string. If none matches, it will return 0.

function string strip_colour (string string)
Returns a new string that contains the input string, minus any colour codes.


function string translate (string text, int language)
Returns a string that contains the specified text converted into what someone who doesn't know that language would see. Languages are:
(Show Constants)


function bool unequip_char (char ch, obj obj)
"This function takes an item that a character is currently wearing and returns it to their inventory. Try checking get_obj_worn to get the object handle for the object at the required location. Returns TRUE if successful, FALSE otherwise."

function update_last_quest_time ()
Sets the Last Quest Ended time to the current time. This is the field displayed in Quest Info.


function room vehicle_bridge_room (vehicle veh)
This returns the bridge room for the vehicle. This will be a NULL handle if the vehicle is not set for DRIVEing.

function room vehicle_entry_room (vehicle veh)
This returns the entry room for the vehicle.

function string vehicle_getstring (vehicle veh, int val)
This function returns information about a vehicle. It can also be accessed via the dot syntax (vehicle.name)
(Show Constants)

function int vehicle_getval (vehicle veh, int val)
This function returns information about a vehicle. It can also be accessed via the dot syntax (vehicle.type)
(Show Constants)

function room vehicle_in_room (vehicle veh)
This returns the room that the vehicle is in.

function bool vehicle_setstring (vehicle veh, int val, string new_string)
This function sets one or more of the vehicle's strings. It returns TRUE if the string was successfully changed, or FALSE if not.
(Show Constants)

function int vehicle_setval (vehicle veh, int val, int new_value)
This function sets information about a vehicle. It will return the new value of the specified field.
(Show Constants)


function wait ()
This function suspends program execution until the next pulse.

function string wordwrap (string text, int mode)
This function wraps a block of text, according to the wrap mode selected. The wrapped text is returned as a new string. Wrap modes are:
(Show Constants)

function char world_first_char (bool pc)
This function returns the first character in the world. If pc is TRUE, it returns the first player, otherwise, mobs are included in the list. This function can - but it is very unlikely - return an invalid handle.

function char world_next_char (char ch, bool pc)
This function returns the next character in the world, based on the character passed to this function. If pc is TRUE, it returns only PC's, otherwise, mobs are included in the list. This function can return an invalid handle.




Special Functions
function string instring (int timeout)
This function allows a mobact or an objact to send text to the program. This text is then treated as a string in the program, as the return value for this function. If no input is found before the timeout expires (in seconds) then the function returns an empty string.