Lulz, super under construction..
When you’re trying to do something tricky it helps to know what tools are available to you.
This page is intended to be a coding reference portal page to provide fast access to major object and module function lists / descriptions, efuns and simulated efuns.
Efuns & Simulated Efuns
These are functions that you should be able to call from any piece of code. Generally efuns are used to simplify the use of data types like strings, arrays, maps, etc and they can be really quite powerful.
Efuns are implemented directly in the driver and so should be pretty fast, while simulated efuns are part of the mudlib and are run as any other code.
Fast or not, as a general rule be particularly wary of nesting loops with calls to functions that operate on variable length data types like arrays, maps or whatever. It should be fine if you really know what you’re doing, but if your code ends up shooting off to some exponential order of complexity and the MUD grinds to a halt.. well.. don’t say you weren’t warned.
Efuns (External Functions)
string
| Case Manipulation | Comparison | To/From Array | Encryption | Search/Replace |
|---|---|---|---|---|
| Capitalize | Strcmp | Explode | Crypt | Replace string |
| Lower case | Implode | Strsrch | ||
| Upper case | ||||
| Length | stdio-alike | Regular Expressions | Bit Strings | Duplication |
| Strlen | Sprintf | Reg assoc | Clear bit | Repeat string |
| Sscanf | Regexp | Set bit | ||
| Test bit | ||||
array
| Creation | Searching | Culling | To Map |
|---|---|---|---|
| allocate | member_array | filter_array | map_array |
- map_array - modify an array of elements via application of a function
- member_array - returns index of an occurrence of a given item in an array or string
- sort_array - sort an array
- unique_array - partitions an array of objects into groups
mapping
object
- all_inventory
- children
- clone_object
- clonep
- deep_inventory
- destruct
- environment
- file_name
- find_object
- first_inventory
- load_object
- master
- move_object
- new
- next_inventory
- objects
- present
- query_heart_beat -query the status of an object’s heartbeat
- reload_object
- restore_object
- save_object
- set_heart_beat -enable or disable an object’s heartbeat
- set_hide
- tell_object
- tell_room
- virtualp
filesystem
float
buffer
- allocate_buffer - Allocate a buffer of ‘size’ elements.
- bufferp - determine whether or not a given variable is a buffer
- crc32 - compute the cycle redundancy code for a buffer or string
- free_buffer - Destroys the buffer
- read_buffer - read from a file and return a buffer
- write_buffer - write a buffer to a file
calls
- call_other
- call_out
- catch
- origin
- previous_object
- query_shadowing
- remove_call_out
- remove_shadow
- shadow
- this_object
- throw
compile
db
functions
- bind - change the owner of a function pointer
- evaluate - evaluate a function pointer
- function_owner - return the owner of a given function.
general
- filter
- map - modify an mapping
- restore_variable
- save_variable
- sizeof
- store_variable
- typeof
interactive
- add_action
- command
- commands
- disable_commands
- disable_wizard
- ed
- enable_commands
- enable_wizard
- exec
- find_player
- get_char
- in_edit
- in_input
- input_to
- interactive
- message
- notify_fail
- printf
- query_host_name
- query_idle
- query_ip_name
- query_ip_number
- query_ip_port
- query_notify_fail
- query_snoop
- query_snooping
- receive
- remove_action
- remove_interactive
- resolve
- say
- set_this_player
- shout
- snoop
- this_interactive
- this_player
- this_user
- userp
- users - returns an array of all the connected player user objects
- wizardp
- write
internals
- cache_stats - report various driver and mudlib statistics
- debug_info - display debuf info
- debugmalloc - dumps information on malloc’d memory to a file
- dump_file_descriptors - dump the MudOS process file descriptor table
- dump_prog - dump/disassemble an LPC object
- dump_socket_status - display the status of each LPC socket
- dumpallobj - report various statistics on all objects that have been loaded
- get_config - query various driver config settings
- malloc_status - report various statistics related to memory usage.
- memory_info - obtain info on object/overall memory usage
- mud_status - report various driver and mudlib statistics
- opcprof - reports statistics on calling frequencies of various efuns
- query_load_average - returns user commands/sec, lines compiled/sec
- refs - return the number of references to a data structure
- rusage - reports information gathered by the getrusage() system call
- set_debug_level -sets the debug level used by the driver’s debug() macro
- set_malloc_mask-sets the mask controlling display of malloc debug info
- swap - swap out a file explicitly
- time_expression - return the amount of real time that an expression took
- trace - sets trace flags and returns the old ones
- traceprefix - sets the prefix determining which objects to trace
mixed
mudlib
- author_stats
- domain_stats
- export_uid
- find_living
- geteuid
- getuid
- living
- livings
- query_privs
- set_author
- set_light
- set_living_name
- set_privs
- seteuid
numbers
parsing
sockets
- socket_accept
- socket_acquire
- socket_address
- socket_bind
- socket_close
- socket_connect
- socket_create
- socket_error
- socket_listen
- socket_release
- socket_write
system
- all_previous_objects
- call_out_info
- ctime
- deep_inherit_list
- error
- eval_cost
- find_call_out
- function_exists
- function_profile
- inherit_list
- inherits
- localtime
- max_eval_cost
- reclaim_objects
- replace_program
- replaceable
- reset_eval_cost
- set_eval_limit
- set_reset
- shallow_inherit_list
- shutdown
- time
- uptime
- variables
Simul_Efuns
Simul_Efuns are “simulated external functions”. Basically this means that they can be called from any code run on the mud driver, but they are written in LPC rather than in C. They are contained in included files in /secure/simul_efun.c Some of these are typical to the Lima Mudlib, some have been imported from the Nightmare IV mudlib, and some of them are custom only to Desolation MUD. When adding a simul_efun you must reboot the mud for functions to be recognized.
censor
format_rpg_damage
identify
misc
- absolute_value
- call_out_chain
- call_trace
- cardinal - Accepts 1977 and returns “one thousand nine hundred seventy-seven”
- choice - Returns a random element of the structure passed
- clean_array
- cmp
- convert_time
- dump_socket_status
- eval - evaluates the string s as an LPC value
- exec_code
- fibonacci - This returns the fibonacci sequence. 1,1,2,3,5,8,13 etc.
- fuzzy_divide
- give_new_obj
- implode_by_arr
- insert
- is_normal_direction
- min -Returns the smallest element of an aggregate type (string, array, or mapping)
- more
- more_file
- my_call_outs
- parse_ref
- parse_ref_into_obj
- rev_explode
- rnd
- sort_by_value
- sum
- xcost - formula used for exponential advancement costs
- xcost2
objcalls
- base_name
- compare_objects
- count
- deep_useful_inv
- deep_useful_inv_parser_formatted
- duplicatep
- get_object
- immediately_accessible
- inv_list
- object_event_message
- objet_event
- owner
- parser_root_environment
- query_object_id
- query_string_object_id
- root_environment
- target
- usable
overrides
- debug_info
- destruct
- ed
- exec
- find_player
- input_to
- printf
- query_snoop
- query_snooping
- say
- shout
- shutdown
- snoop
- tell_object
- tell_room
- write
path
- absolute_path
- base_path
- canonical_path
- depath
- evaluate_path
- is_directory
- is_file
- join_path
- map_paths
- path_exists
- split_path
- walk_dir
- wiz_dir
security
string
- arrange_string
- center
- chr - Returns the character value of a number
- comma_number - converts 3000 to “3,000”
- count_substrings
- expand_range
- find
- format_list -Accepts a string array, and returns the items in that string array as a list
- format_page
- is_letter - Returns whether or not the ordinal value of a character
- iwrap - wrap with default indent
- ljust - Left justifies text in a given length.
- ord -Returns the ordinal (number) value of a character
- power_str - Given a string, and a length, creates a longer string.
- rfind
- rjust - Right justifies text in a given length.
- strip_color - removes ansi color from a string
- strstr
- swapcase - when passed “tESTing” returns “TestING”
- truncate - Truncates a string if it is too long…
- wrap - wraps a string