Global Procs

These procs are globally accessible, and can be called from anywhere in the code.

Arguments:
msg: The message to be included in the stack trace.

Immediately terminates the running procedure, providing a stack trace with the given message, output to the /world/var/Log.

Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/alert(Usr, Message, Title, Button1, Button2, Button3)
Arguments:
Usr: The user,
Message,
Title,
Button1 = 0,
Button2,
Button3
Returns:
text

Displays a customizable alert message to a user (either a /mob or /client). It accepts a title, message, and up to three buttons as text. If no buttons are specified, the first defaults to "Ok".

If no user is explicitly provided, the current user is used and arguments are shifted. The function checks for a valid connection; if none exists, it returns "OK". Otherwise, it sends the alert and returns the user's interaction.

Arguments:
Object,
time,
loop,
easing,
flags,
delay,
pixel_x,
pixel_y,
pixel_z,
maptext,
maptext_width,
maptext_height,
maptext_x,
maptext_y,
dir,
alpha,
transform,
color,
luminosity,
infra_luminosity,
layer,
glide_size,
icon,
icon_state,
invisibility,
suffix
Returns:
null
Arguments:
N: number, character code
Returns:
text: The converted character

Returns the character corresponding to a UTF-32 character code - despite the name of this proc, it is not limited to ASCII characters.

world.log << ascii2text(5660) //
/proc/block(/atom/Start, /atom/End, StartZ, EndX, EndY, EndZ)
Usage:
block(/atom/Start, /atom/End)
Start: The lower left corner of the block.
End: The upper right corner of the block.
block(StartX, StartY, StartZ, EndX, EndY, EndZ)
Returns:
/list: A list of turfs in a 3D block

This proc allows for us to get a list of the turfs within a specified area.

for(var/turf/my_turf in block(1, 1, 1, 10, 10, 10))
    my_turf.icon_state = "green"

This will change the /atom/var/icon_state of every turf, beginning at the turf located at X = 1, Y = 1, Z = 1 and finishing at the turf located at X = 10, Y = 10 and Z = 10, to "green". This list is inclusive of the Start and End turfs.

/proc/bounds(Ref, Dist)
Arguments:
Ref,
Dist = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/bounds_dist(Ref, Target)
Arguments:
Ref,
Target
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
A: Number
Returns:
num: The ceiling of the provided number.

The ceiling is the largest integer greater than or equal to the provided number.

world.log << ceil(1.00001) // 2
world.log << ceil(-0.00001) // 0
Arguments:
Key: The string to canonicalize
Returns:
null, text: The canonical form of the provided string

The canonical form of a given key is composed of lowercase letters between A-Z, numbers between 0-9 and the @ symbol. This is pre-generated on both /mob/var/ckey and /client/var/ckey, based on the user's /client/var/key.

var/my_evil_key = "W0w!!IGotLots-ofFunCharacters!!!InHere@@"

world.log << ckey(my_evil_key) // w0wigotlotsoffuncharactersinhere@@
Arguments:
Text
Returns:
null, text

This is similar to ckey(), however, case is preserved, along with - and _ characters. All other special characters (apart from the @ symbol, as with ckey()) will be removed.

world.log << ckeyEx("OhSoWe'ReKeeping!MyCapitalLetters?Now") // OhSoWeReKeepingMyCapitalLettersNow
/proc/clamp(Value, Low, High)
Usage:
clamp(Number, Low, High)
Number: A number.
Low: The lowest number that can be returned.
High: The highest number that can be returned.
clamp(/list/List, Low, High)
List: A list of numbers.
Returns:
null, num, /list: The provided number, kept between the Low and High values.
The original list, with the numeric contents kept between the Low and High values.

Constricts a number between the Low and High values provided. If the number is between those values, it is unchanged. If it exceeds the Low or High values, those will be returned.

world.log << clamp(5, 1, 10) // 5
world.log << clamp(1, 5, 10) // 5
world.log << clamp(15, 1, 10) // 10

When operating on a list, this functions as if clamp() has been run on each entry in the list.

var/my_list = list(1, 2, 3, 4, 5, 6, 7, 8, 9)
for(var/num in clamp(my_list, 1, 5))
    world.log << num // 1, 2, 3, 4, 5, 5, 5, 5, 5
Parity Issue ⚠️
In the OpenDream implementation of DreamMaker, this feature differs in implementation:
A new list will always be returned from the clamp() proc, it does not operate in place.
Usage:
cmptext(string1, string2, ...)
Returns:
num: 1 if all the provided arguments are the same, 0 otherwise

This proc is case insensitive, unlike cmpTextEx(). Any number of arguments can be given to this proc, and it will return 1 if they are all the same.

if(cmptext("letsplayagame", "LETSPLAYAGAME", "letsPlayAGame"))
    world.log << "Yay!" // "Yay!" is printed
Arguments:
T1
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/copytext(T, Start, End)
Arguments:
T: The text string to copy from,
Start = 1: The position in the string to start the copy,
End = 0: The position in the string to finish the copy, exclusive
Returns:
null, text: A new string copied from the provided points

Copies characters in the provided string between the Start and End position. By default, the End value will copy the remainder of the string. You can also specify negative positions for the Start or End, which will cause it to work backwards.

world.log << copytext("Foo Bar", 5) // Bar
world.log << copytext("Foo Bar", 1, 4) // Foo

world.log << copytext("Foo Bar", -3) // Bar
world.log << copytext("Foo Bar", -7, -3) // Foo

For non-ASCII strings, where the string position does not necessarily correlate to character position, you will need the _char variant of this proc. copytext_char() works in text elements, and otherwise functions identically.

/proc/copytext_char(T, Start, End)
Arguments:
T,
Start = 1,
End = 0
Returns:
null, text
/proc/eval(script)
Arguments:
script
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/fcopy(Src, Dst)
Arguments:
Src,
Dst
Returns:
num
Arguments:
File: The file to copy into the cache
Returns:
null, num
Arguments:
File
Returns:
num
Arguments:
File
Returns:
num
Arguments:
Path
Arguments:
File
Returns:
null, text
Arguments:
type
/proc/findlasttext(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Returns:
num
/proc/findlasttextEx(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Returns:
num
/proc/findlasttextEx_char(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/findlasttext_char(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 0,
End = 1
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/findtext(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Returns:
num
/proc/findtextEx(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Returns:
num
/proc/findtextEx_char(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/findtext_char(Haystack, Needle, Start, End)
Arguments:
Haystack,
Needle,
Start = 1,
End = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/flick(Icon, Object)
Arguments:
Icon,
Object
Arguments:
Path
Returns:
/list
Arguments:
A
Returns:
num
Arguments:
n
Returns:
num
/proc/ftime(File, IsCreationTime)
Arguments:
File,
IsCreationTime = 0
Returns:
num
/proc/generator(type, A, B, rand)
Arguments:
type,
A,
B,
rand
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
Loc1 (/atom),
Loc2 (/atom)
Returns:
num
Arguments:
Trg (/atom),
Max = 5
/proc/get_step_to(Ref, Trg, Min)
Arguments:
Ref,
Trg,
Min = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/get_steps_to(Ref, Trg, Min)
Arguments:
Ref,
Trg,
Min = 0
Returns:
/list
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/gradient(A, index)
Arguments:
A,
index
/proc/hascall(Object, ProcName)
Arguments:
Object,
ProcName
Returns:
num
/proc/hearers(Depth, Center)
Arguments:
Depth,
Center
Returns:
/list
Arguments:
HtmlText
Returns:
text
Arguments:
PlainText
Returns:
text
/proc/icon(icon, icon_state, dir, frame, moving)
Arguments:
icon,
icon_state,
dir,
frame,
moving
/proc/icon_states(Icon, mode)
Arguments:
Icon,
mode = 0
Returns:
null, text
/proc/image(icon, loc, icon_state, layer, dir, pixel_x, pixel_y)
Arguments:
icon,
loc,
icon_state,
layer,
dir,
pixel_x,
pixel_y
Arguments:
Loc1
Returns:
num
Arguments:
File
Returns:
num
Arguments:
Icon
Returns:
num
Arguments:
n
Returns:
num
/proc/islist(Object)
Arguments:
Object
Returns:
num
Arguments:
Loc1
Returns:
num
Arguments:
Loc1
Returns:
num
Arguments:
Loc1
Returns:
num
Arguments:
n
Returns:
num
Arguments:
Val
Returns:
num
Arguments:
Val
Returns:
num
Arguments:
Loc1
Returns:
num
/proc/ispath(Val, Type)
Arguments:
Val,
Type
Returns:
num
Arguments:
v
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
Val
Returns:
num
Arguments:
Loc1
Returns:
num
/proc/jointext(/list/List, Glue, Start, End)
Arguments:
List (/list),
Glue,
Start = 1,
End = 0
Returns:
text
Arguments:
JSON
/proc/json_encode(Value, flags)
Arguments:
Value,
flags
Arguments:
E
Returns:
num
Arguments:
T
Returns:
num
Arguments:
url
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
List
Returns:
text
Arguments:
File
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
T
Returns:
text
/proc/matrix(a, b, c, d, e, f)
Arguments:
a,
b,
c,
d,
e,
f
Arguments:
A
Returns:
null, text, num
Arguments:
T
Returns:
null, text
Arguments:
A
Returns:
null, text, num
/proc/missile(Type, Start, End)
Arguments:
Type,
Start,
End
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Returns:
num
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/nonspantext(Haystack, Needles, Start)
Arguments:
Haystack,
Needles,
Start = 1
Returns:
num
/proc/nonspantext_char(Haystack, Needles, Start)
Arguments:
Haystack,
Needles,
Start = 1
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
Arguments:
N,
A,
B
Returns:
text
/proc/obounds(Ref, Dist)
Arguments:
Ref,
Dist = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/ohearers(Depth, Center)
Arguments:
Depth,
Center
Returns:
/list
/proc/orange(Dist, Center)
Arguments:
Dist = 5,
Center
Returns:
null, /list
/proc/oview(Dist, Center)
Arguments:
Dist = 5,
Center
Returns:
/list
/proc/oviewers(Depth, Center)
Arguments:
Depth = 5,
Center
Returns:
/list
Arguments:
Params
Returns:
/list
Arguments:
L,
H
Returns:
num
Arguments:
Seed
Returns:
null
/proc/range(Dist, Center)
Arguments:
Dist,
Center
Returns:
null, /list
/proc/ref(Object)
Arguments:
Object
Returns:
text
Arguments:
Object
Returns:
num
/proc/regex(pattern, flags)
Arguments:
pattern,
flags
/proc/replacetext(Haystack, Needle, Replacement, Start, End)
Arguments:
Haystack,
Needle,
Replacement,
Start = 1,
End = 0
Returns:
null, text
/proc/replacetextEx(Haystack, Needle, Replacement, Start, End)
Arguments:
Haystack,
Needle,
Replacement,
Start = 1,
End = 0
Returns:
null, text
/proc/replacetextEx_char(Haystack, Needle, Replacement, Start, End)
Arguments:
Haystack,
Needle,
Replacement,
Start = 1,
End = 0
Returns:
text
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/replacetext_char(Haystack, Needle, Replacement, Start, End)
Arguments:
Haystack,
Needle,
Replacement,
Start = 1,
End = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/rgb(R, G, B, A, space)
Arguments:
R,
G,
B,
A,
space
Returns:
null, text
/proc/rgb2num(color, space)
Arguments:
color,
space
Returns:
/list
/proc/roll(ndice, sides)
Arguments:
ndice = 1,
sides
Returns:
num
Arguments:
A,
B
Returns:
num
/proc/run(File)
Arguments:
File
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/sha1(input)
Arguments:
input
Returns:
null, text
/proc/shell(command)
Arguments:
command
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/shutdown(Addr, Natural)
Arguments:
Addr,
Natural = 0
Arguments:
Delay
Arguments:
T1,
T2
Returns:
num
Arguments:
T1,
T2
Returns:
num
/proc/sound(file, repeat, wait, channel, volume)
Arguments:
file,
repeat = 0,
wait,
channel,
volume
/proc/spantext(Haystack, Needles, Start)
Arguments:
Haystack,
Needles,
Start = 1
Returns:
num
/proc/spantext_char(Haystack, Needles, Start)
Arguments:
Haystack,
Needles,
Start = 1
Returns:
num
/proc/splicetext(Text, Start, End, Insert)
Arguments:
Text,
Start = 1,
End = 0,
Insert
Returns:
null, text
/proc/splicetext_char(Text, Start, End, Insert)
Arguments:
Text,
Start = 1,
End = 0,
Insert
Returns:
null, text
/proc/splittext(Text, Delimiter)
Arguments:
Text,
Delimiter
Returns:
/list
/proc/splittext_char(Text, Start, End, Insert)
Arguments:
Text,
Start = 1,
End = 0,
Insert
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/stat(Name, Value)
Arguments:
Name,
Value
/proc/statpanel(Panel, Name, Value)
Arguments:
Panel,
Name,
Value
/proc/step(/atom/movable/Ref, Dir, Speed)
Arguments:
Ref (/atom/movable): The thing to be moved.,
Dir: The direction to attempt to move it in, must be one of the 8 valid directions (NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST).,
Speed = 0: The speed to move, in pixels.
Unimplemented 🏗️
Returns:
num: Returns 1 on success (successfully moved) and 0 on failure (was blocked by something).

Moves Ref in direction Dir, respecting collision defined by /atom/var/density and /atom/proc/Cross().

/proc/step_away(/atom/movable/Ref, /atom/Trg, Max, Speed)
Arguments:
Trg (/atom),
Max = 5,
Speed = 0
Returns:
num
Arguments:
Speed = 0
/proc/step_to(/atom/movable/Ref, /atom/Trg, Min, Speed)
Arguments:
Trg (/atom),
Min = 0,
Speed = 0
Returns:
num
Arguments:
Trg (/atom),
Speed
Returns:
num
Arguments:
T,
pos = 1
Returns:
text
Arguments:
T,
pos = 1
Returns:
text
/proc/text2file(Text, File)
Arguments:
Text,
File
/proc/text2num(T, radix)
Arguments:
T,
radix = 10
Returns:
null, num
Arguments:
T
/proc/time2text(timestamp, format)
Arguments:
timestamp,
format
Returns:
text
Arguments:
Text
Returns:
null, text
Arguments:
n
Returns:
num
/proc/turn(Dir, Angle)
Arguments:
Dir,
Angle
Arguments:
Item1
Returns:
/list
Arguments:
T
Returns:
text
Arguments:
UrlText
Returns:
text
/proc/url_encode(PlainText, format)
Arguments:
PlainText,
format = 0
Returns:
text
/proc/view(Dist, Center)
Arguments:
Dist = 5,
Center
Returns:
/list
/proc/viewers(Depth, Center)
Arguments:
Depth,
Center
Returns:
/list
/proc/walk(Ref, Dir, Lag, Speed)
Arguments:
Ref,
Dir,
Lag = 0,
Speed = 0
/proc/walk_away(Ref, Trg, Max, Lag, Speed)
Arguments:
Ref,
Trg,
Max = 5,
Lag = 0,
Speed = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/walk_rand(Ref, Lag, Speed)
Arguments:
Ref,
Lag = 0,
Speed = 0
/proc/walk_to(Ref, Trg, Min, Lag, Speed)
Arguments:
Ref,
Trg,
Min = 0,
Lag = 0,
Speed = 0
Unimplemented 🏗️
In the OpenDream implementation of DreamMaker, this proc is marked as unimplemented.
/proc/walk_towards(Ref, Trg, Lag, Speed)
Arguments:
Ref,
Trg,
Lag = 0,
Speed = 0
/proc/winclone(player, window_name, clone_name)
Arguments:
player,
window_name,
clone_name
/proc/winexists(player, control_id)
Arguments:
player,
control_id
Returns:
text
/proc/winget(player, control_id, params)
Arguments:
player,
control_id,
params
/proc/winset(player, control_id, params)
Arguments:
player,
control_id,
params
/proc/winshow(player, window, show)
Arguments:
player,
window,
show = 1