DM Class #10

Parent #9Owner #10Flags player, programmer, wizard, fertileSource MurpgCore-0.4/MurpgCore-0.4.db

22 verbs · 73 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
addp*ropany any anyrwd#1070
createany out of/from inside/from anyrwd#1032
#*any any anyrwd#1050
dmany any anyrwd#1015
che*ckpointnone none nonerwd#104
showlogany none nonerwd#1012
shutdownany none nonerwd#1028
taillogany any anyrwd#1018
for*kedany none nonerwd#1013
timenone none nonerwd#102
allobj*ectsnone none nonerwd#1013
msg_allthis none thisrwxd#1021
force_channelthis none thisrwxd#1031
homeany none nonerwd#1012
mkcorenone none nonerwd#1049
who_stringthis none thisrwxd#1029
resetany none nonerwd#1018
missingnone none nonerwd#1030
auditany none nonerwd#1032
chownany none nonerwd#1018
trunclogany any anyrwd#1019
matchthis none thisrwxd#1058

Properties

PropertyDefinerFlagsOwnerValue
show_obj_nums#10rw#101
owned_objects#8rw#10
list of 78{#3, #16, #18, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54, #55, #56, #58, #61, #64, #65, #66, #67, #68, #69, #70, #71, #73, #74, #76, #77, #78, #79, #80, #81, #82, #84, #85, #86, #87, #89, #90, #91, #0, #1, #2, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #19, #20, #21}
editing_prop#8rw#10<clear>
editing_obj#8rw#10<clear>
editing_loc#8rw#10<clear>
insert_point#8rw#10<clear>
prompt_on#6rw#10<clear>
color#3rw#10<clear>
base_hear#3rw#10<clear>
base_see#3rw#10<clear>
base_smell#3rw#10<clear>
prompt_string#3rw#10<clear>
base_hp#3rw#10<clear>
cur_hp#3rw#10<clear>
password#3rw#10<clear>
messages#3rw#10<clear>
base_feel#3rw#10<clear>
base_taste#3rw#10<clear>
known_languages#3rw#10<clear>
current_language#3rw#10<clear>
gender#3rw#10<clear>
afk#3rw#10<clear>
base_str#3rw#10<clear>
base_int#3rw#10<clear>
base_hea#3rw#10<clear>
base_spd#3rw#10<clear>
base_cnc#3rw#10<clear>
held#3rw#10<clear>
help_db#3rw#10#31
wielded#3rw#10<clear>
worn#3rw#10<clear>
species#3rw#10<clear>
height#3rw#10<clear>
current_channels#3rw#10{"admin", "design", "dm"}
position#3rw#10<clear>
consciousness#3rw#10<clear>
base_ac#3rw#10<clear>
skills#3rw#10<clear>
base_dex#3rw#10<clear>
base_con#3rw#10<clear>
combat_stance#3rw#10<clear>
known_players#3rw#10<clear>
targets#3rw#10<clear>
last_connected#3rw#10<clear>
combat_init#3rw#10<clear>
combat_weapon#3rw#10<clear>
base_endurance#3rw#10<clear>
cur_endurance#3rw#10<clear>
base_focus#3rw#10<clear>
cur_focus#3rw#10<clear>
current_spell#3rw#10<clear>
paths#3rw#10<clear>
prompt_colors#3rw#10<clear>
finished#3rw#10<clear>
full_name#3rw#10<clear>
total_points#3rw#10<clear>
form_members#3rw#10<clear>
leader#3rw#10<clear>
start_location#3rw#10<clear>
description#1rw#10<clear>
aliases#1rw#10<clear>
home#1rw#10<clear>
short_desc#1rw#10<clear>
core#1rw#101
handedness#1rw#10<clear>
base_enc#1rw#10<clear>
base_weight#1rw#10<clear>
capacity#1rw#10<clear>
max_fit#1rw#10<clear>
pprep#1rw#10<clear>
gprep#1rw#10<clear>
generic_name#1rw#10<clear>
age#1rw#10<clear>

Ancestry

Ancestors (nearest first): #9 Coder Class#8 Architect Class#6 Player Class#3 Animate Class#11 Game Class#1 Root Class

Children: #4 admintoo, #5 Admin

Call graph

calls n10_0 #10:addp*rop n3_2 #3:tell n10_0->n3_2 n20_0 #20:parse_prop_ref n10_0->n20_0 n10_1 #10:create n10_1->n3_2 n10_2 #10:#* n10_2->n3_2 n10_3 #10:dm n10_3->n3_2 n1_6 #1:descendants n10_3->n1_6 n10_4 #10:che*ckpoint n43_0 #43:add_entry n10_4->n43_0 n10_5 #10:showlog n10_5->n3_2 n10_6 #10:shutdown n10_6->n3_2 n10_7 #10:taillog n10_7->n3_2 n10_8 #10:for*ked n10_8->n3_2 n10_9 #10:time n10_9->n3_2 n20_13 #20:ftime n10_9->n20_13 n10_10 #10:allobj*ects n10_10->n3_2 n10_11 #10:msg_all n10_11->n3_2 n10_12 #10:force_channel n10_12->n3_2 n10_13 #10:home n10_13->n3_2 n1_4 #1:move_to n10_13->n1_4 n10_14 #10:mkcore n10_14->n3_2 n10_14->n43_0 n10_17 #10:missing n10_17->n3_2 n10_17->n1_6 n20_6 #20:sort n10_17->n20_6 n10_18 #10:audit n10_18->n3_2 n10_19 #10:chown n10_19->n3_2 n10_20 #10:trunclog n10_20->n3_2 n10_21 #10:match n10_21->n1_6 n20_19 #20:match_dollar_ref n10_21->n20_19 n20_8 #20:parse_dot_ref n10_21->n20_8

Source

addp*rop

Spec any any anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1{?init_string, ?value_one = $nothing, ?value_two = $nothing} = args;
2person = player;
3target = property = "";
4"";
5syntax = "SYNTAX:  <object_name/object_number>.<new_prop_name> [[=] <value>]";
6example1 = "For example:  addprop #556.rank = 35";
7example2 = "For example:  addprop here.rank";
8"";
9" The following :tell() is for formatting purposes only. ";
10person:tell();
11if (!args)
12person:tell(syntax);
13person:tell(example1);
14" Add this back in once string matching has been coded. ";
15"person:tell(example2);";
16return 0;
17else
18" Ok, going to call $utils:parse_prop_ref here...  If the object ";
19" string it returns can't be changed to an OBJ, just return SYNTAX.  ";
20" String matching has not been coded yet. ";
21if (!(obj_and_prop = $utils:parse_prop_ref(init_string)))
22person:tell(syntax);
23person:tell(example1);
24else
25target = obj_and_prop[1];
26property = obj_and_prop[2];
27if (target[1] != "#")
28" No string matching yet. ";
29person:tell();
30person:tell("String matching has not been coded yet.  Please use an object number.");
31person:tell(example1);
32return 0;
33else
34object = toobj(target);
35if (!valid(object))
36" The object is not a valid object number. ";
37person:tell("That is not a valid object.");
38else
39" Make sure the property does not already exist. ";
40if (object:has_prop(property))
41person:tell("That property already exists: ", object, ".", property, " = ", toliteral(object.(property)));
42return 0;
43else
44" All syntax checks ok.  Determine if an initial value was given. ";
45" Actually, no.  I'm tired of coding this function.  Let them eat cake. ";
46if (value_one)
47person:tell("Default values not enabled yet.  Sorry!");
48person:tell();
49endif
50value = 0;
51perms = "rw";
52owner = $dm;
53" The following code is taken from LambdaMOO $programmer:@property with minor adjustments. ";
54try
55add_property(object, property, value, {owner, perms});
56person:tell(tostr("Property added: ", object, "(", object.name, ").", property, " = ", toliteral(object.(property))));
57except (E_INVARG)
58" Property exists on a descendant. ";
59person:tell("Property is already defined on one or more descendants.");
60person:tell("Someday in the technologically-advanced future there will be a utility to check for this.");
61except e (ANY)
62" Parse the error and return it. ";
63person:tell("The built-in function add_property returned the following error: ");
64person:tell(e[2]);
65endtry
66endif
67endif
68endif
69endif
70endif

create

Spec any out of/from inside/from anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"#10:create (str objName, from, str parent)";
2"creates new object with name objName and parent parent.";
3"if iobj is not valid will match iobjstr to a valid object.";
4"will reference a form on the form object for that parent";
5"and prompt the player to set default property values. if";
6"no template is available, no questions are asked. objects";
7"that wizards create will prompt for fertility; architects";
8"(programmer/builders) will not be able to create fertile";
9"objects. new classes can only be implemented by wizards.";
10if ((dobjstr == "") || (iobjstr == ""))
11player:tell("Not enough arguments.");
12player:tell("Syntax:  create <newname> from <class>");
13return 0;
14elseif (!valid(iobj))
15player:tell("Class must be a valid object.");
16player:tell("Syntax:  create <newname> from <class>");
17return 0;
18elseif (iobj.f == 0)
19player:tell(("Class object '" + iobj.name) + "' is not fertile. Change its 'f' bit to 1 and try again.");
20return 0;
21endif
22new_object_num = iobj:_create(player);
23if (!valid(new_object_num))
24player:tell("Object number returned from call to :create is invalid.  Check your code.  It is fucked up.");
25return 0;
26endif
27new_object_num.name = dobjstr;
28new_object_num.f = 0;
29new_object_num.r = 1;
30new_object_num.w = 1;
31player:tell(new_object_num:move_to(player)[2]);
32player:tell(((((((("You have just created object " + tostr(new_object_num)) + " named ") + new_object_num.name) + " as a child of ") + iobj.name) + "(") + tostr(iobj)) + ").");

#*

Spec any any anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1" #10:#*(STR) none none none ";
2"";
3" *:  The object whose name you are looking for. ";
4"     At this time it must be a number (no string matching). ";
5"";
6" Returns:  STR ";
7" STR:  The name of the OBJ. ";
8"";
9" Modifies:  none ";
10" Owner:  $dm ";
11" Perms:  owner ";
12" Called by:  DMs ";
13"";
14" Description:  Temporary functionality because I'm tired of having ";
15"               to type  ;#4.name when all I really want to do is type ";
16"               #4 and get the object's name.  I may get rid of this ";
17"               function later, replace it or give it more functionality. ";
18"";
19" NOTE:  When string matching has been completed I will allow for such ";
20"        matching within this function as well. ";
21"";
22" Example:  #4   =>  \"Finder\"  ";
23" Example:  #me  =>  \"Finder\"  ";
24"";
25syntax = "SYNTAX:  #<number of the object you are referencing>";
26example1 = "For example:  #4";
27example2 = "For example:  #me";
28"";
29person = player;
30what = tostr(verb);
31" The following :tell() is for formatting purposes only. ";
32person:tell();
33if (what == "#")
34person:tell(syntax);
35person:tell(example1);
36else
37" NOTE:  I won't have to use this awkward if-statement once string matching ";
38"        has been completed. ";
39"";
40if (!(what[2] in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}))
41person:tell("String matching has not been completed yet.  Please use a number instead.");
42else
43what = toobj(what);
44try
45person:tell(toliteral(what.name));
46except (E_INVIND)
47person:tell("That object does not exist.");
48endtry
49endif
50endif

dm

Spec any any anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:dm any any any";
2if (player in $dm:descendants())
3if (!("dm" in player.current_channels))
4player:tell("%WYour channel has been turned on.%w");
5player.current_channels = setadd(player.current_channels, "dm");
6endif
7for dm in ($channels.dm_channel)
8if ("dm" in dm.current_channels)
9dm:tell();
10dm:tell((((($channels.dm_prefix + " ") + player.name) + ": ") + argstr) + "%w");
11endif
12endfor
13else
14player:tell($bad_command);
15endif

che*ckpoint

Spec none none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:checkpoint none none none";
2msg = player.name + ": checkpoint...";
3$log:add_entry("system", "[INFO]", msg);
4dump_database();

showlog

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"#10:showlog any any any";
2{?logname = ""} = args;
3if (logname == "")
4player:tell("Specify a log to show:%W");
5player:tell($log.logs);
6elseif (!(logname in $log.logs))
7player:tell("No such log exists.");
8else
9for each in ($log.(logname))
10player:tell("%W", ctime(each[1]), " ", $log.level_colors[is_member(each[2], $log.log_levels)], each[2], " %w", each[3]);
11endfor
12endif

shutdown

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:shutdown any none none";
2if (argstr == "")
3player:tell("Specify when to shut down.");
4elseif (argstr == "cancel")
5if ($shutdown_pid != 0)
6player:tell("System Shutdown cancelled.");
7kill_task($shutdown_pid);
8$shutdown_pid = 0;
9else
10player:tell("No shutdown task queued.");
11endif
12else
13when = args[1];
14why = $utils:triml($utils:trimr(argstr[length(args[1]) + 1..length(argstr)]));
15if (tonum(when) == 0)
16player:tell("Specify a valid time to shutdown.");
17else
18if ($shutdown_pid != 0)
19kill_task($shutdown_pid);
20$shutdown_pid = 0;
21endif
22if ((when == "now") || (when == "0"))
23$shutdown(0, why);
24else
25$shutdown(tonum(when), why);
26endif
27endif
28endif

taillog

Spec any any anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"#10:taillog any any any";
2{?logname = "", ?numlines = 0} = args;
3numlines = tonum(numlines);
4numlines = numlines ? numlines | 25;
5if (logname == "")
6player:tell("Specify a log to tail:%W");
7player:tell($log.logs);
8elseif (!(logname in $log.logs))
9player:tell("No such log exists.");
10else
11loglength = length($log.(logname));
12numlines = (numlines < loglength) ? numlines | loglength;
13start = (loglength - numlines) + 1;
14messages = {@$log.(logname)[start..$]};
15for each in (messages)
16player:tell("%W", ctime(each[1]), " ", $log.level_colors[is_member(each[2], $log.log_levels)], each[2], " %w", each[3]);
17endfor
18endif

for*ked

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:for*ked any none none";
2qtasks = queued_tasks();
3player:tell("%WTasks queued for execution:%w");
4for task in (qtasks)
5taskid = task[1];
6exectime = task[2];
7owner = task[5];
8verbloc = task[6];
9verbname = task[7];
10linenum = task[8];
11thisobj = task[9];
12player:tell("%W  ", taskid, "%w with owner ", owner, "  ", ctime(exectime), "%Y   ", thisobj, ":", verbname, " at line ", linenum, ".%w  Defined on ", verbloc, ".");
13endfor

time

Spec none none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:time none none none";
2player:tell("%W", $utils:ftime(ctime()), "%w");

allobj*ects

Spec none none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:allobj*ects none none none";
2for each in [1..tonum(max_object())]
3targ = toobj(each);
4if (valid(targ))
5if (targ.core == 1)
6player:tell(((("%Y" + tostr(targ)) + "  %w[ ") + targ.name) + " ]");
7else
8player:tell((("%W" + tostr(targ)) + "  %w") + targ.name);
9endif
10else
11player:tell(("%R" + tostr(targ)) + "  < Invalid Object Number >%w");
12endif
13endfor

msg_all

Spec this none thisFlags rwxdOwner #10Definer #10

Referenced by

none

Source

1"$DM:msg_all this none this.  Called by $animate:msg.";
2"Global messaging function only usable by Dungeon Masters.";
3"To be used SPARINGLY since the message is sent to ALL connected players.";
4message_raw = argstr;
5if (message_raw in {"all", "global"})
6"no message was sent with the command";
7player:tell("%BSend what message to all connected players?%w");
8else
9if (message_raw[1] == "a")
10"message all";
11message = message_raw[5..$];
12else
13"message global";
14message = message_raw[8..$];
15endif
16players = connected_players();
17for each in (players)
18each:tell();
19each:tell("%W<< Global Message from ", player.name, " >> ", message, "%w");
20endfor
21endif

force_channel

Spec this none thisFlags rwxdOwner #10Definer #10

Referenced by

none

Source

1"$dm:force_channel this none this";
2chan = args[1];
3if (chan in {"admin", "design", "dm"})
4full_list = $channels.(chan + "_channel");
5listeners = {};
6for x in (full_list)
7if (x in connected_players())
8listeners = {@listeners, x};
9x.current_channels = setadd(x.current_channels, chan);
10endif
11endfor
12others = setremove(listeners, player);
13names = {};
14for y in (others)
15names = {@names, y.name};
16endfor
17for z in (others)
18z:tell("");
19z:tell((($channels.(chan + "_prefix") + " %R") + player.name) + " would like your attention.%w");
20z:tell("%WYour channel has been turned on.%w");
21endfor
22player:tell("");
23player:tell($channels.(chan + "_prefix") + " %RYou now have the attention of everyone on this channel.%w");
24if (names)
25player:tell(("%cListeners:%C " + $utils:list_to_string(names, ", ")) + "%w");
26else
27player:tell("%cUnfortunately, you are the only one logged in who can listen to this channel...%w");
28endif
29else
30player:tell("%WThere is no such channel.%w");
31endif

home

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:home any none none";
2"send either yourself (default) or named object home";
3{?targ = ""} = args;
4if (targ == "")
5if (valid(this.home))
6this:move_to(this.home);
7else
8this:tell("%wYou do not have a valid %Whome%w set.");
9endif
10else
11this:tell("Cannot send items home just yet...");
12endif

mkcore

Spec none none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:mkcore() none none none";
2"deletes all non-core objects, resets passwords, logs";
3if ($safety_lock == 1)
4player:tell("You cannot make this db a core!");
5$log:add_entry("system", "[WARNING]", "Failed mkcore attempt by " + player.name);
6else
7player:tell("Do you want to convert this database into a core? WARNING: this will delete all items except core items!");
8answer = read(player, 0);
9if (answer != "YES")
10player:tell("Ok, aborting.");
11$log:add_entry("system", "[WARNING]", "Aborted mkcore attempt by " + player.name);
12else
13player:tell("Enter your password for confirmation:");
14typedpass = read(player, 0);
15auth = crypt(typedpass, player.password[1..2]) == player.password;
16if (auth == 0)
17player:tell("Wrong password. Aborting.");
18$log:add_entry("system", "[WARNING]", "Incorrect password on mkcore attempt by " + player.name);
19else
20"set $recycler.recycle_time_limit to 10";
21current_recycle_time_limit = $recycler.recycle_time_limit;
22$recycler.recycle_time_limit = 10;
23"recycle all non-core objects";
24for x in [0..tonum(max_object())]
25xobj = toobj(x);
26if (valid(xobj) && (xobj.core == 0))
27if (is_player(xobj))
28set_player_flag(xobj, 0);
29endif
30xobj:recycle();
31endif
32endfor
33"rename ixion to admin";
34#5.name = "Admin";
35"set password to admin";
36#5.password = crypt("admin");
37"finders password change";
38#4.password = crypt("admin");
39"reset recycle_time_limit";
40$recycler.recycle_time_limit = current_recycle_time_limit;
41"zero out logs";
42for each in ($log.logs)
43$log.(each) = {};
44endfor
45$safety_lock = 1;
46player:tell("corified.");
47endif
48endif
49endif

who_string

Spec this none thisFlags rwxdOwner #10Definer #10

Referenced by

none

Source

1"$dm:who_string() this none this";
2viewer = args[1];
3gender = {"N", "B", "F", "M"}[this.gender in {"neither", "both", "female", "male"}];
4"afk";
5if (this.afk)
6afk = $who.afk + "  ";
7else
8afk = "       ";
9endif
10"editing";
11if (this.location:is_a($editor))
12edit = $who.editing + "  ";
13else
14edit = "           ";
15endif
16"idle";
17idle = idle_seconds(this);
18if (idle > 3600)
19idle = $who.dormant + "  ";
20elseif (idle > 1800)
21idle = $who.vegetating + "  ";
22elseif (idle >= 600)
23idle = $who.idle + "  ";
24else
25idle = "        ";
26endif
27name_string = $utils:padr(this.name, 16, " ");
28who_string = (((((((("%Y[" + "%yDM   ") + gender) + "%Y] ") + name_string) + afk) + edit) + idle) + $who.admin) + "%w";
29return who_string;

reset

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:reset any none none";
2"resets shit so I don't have to manually change props during testing";
3if (argstr == "here")
4player.location.combatants = {};
5for each in (player.location.contents)
6if (each:is_a($animate))
7each.targets = {};
8each.position = "standing";
9each.consciousness = "awake";
10each.cur_hp = each:max_hp();
11each:set_combat_stance("attack");
12each.current_spell = 0;
13each.cur_endurance = each:max_endurance();
14each.cur_focus = each:max_focus();
15endif
16endfor
17player.location.combat_pid = 0;
18endif

missing

Spec none none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:missing() none none none";
2"shows verbs with no associated help files";
3"create list of verbs";
4verblist = {};
5verbnames = {};
6allobjs = #1:descendants();
7for each in (allobjs)
8verblist = {@verblist, @verbs(each)};
9endfor
10"get rid of asterisks";
11for each in (verblist)
12verbnames = {@verbnames, strsub(each, "*", "")};
13endfor
14verbnames = $utils:sort(verbnames);
15"create list of help topics";
16index = {};
17topics = {};
18helpobjs = #15:descendants();
19for each in (helpobjs)
20index = {@index, @each.index};
21endfor
22for each in (index)
23topics = {@topics, each[1]};
24endfor
25"find verbnames that aren't in the topic list";
26for each in (verbnames)
27if (!(each in topics))
28player:tell(each);
29endif
30endfor

audit

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:audit any none none";
2"various options to get info on objects in database";
3"audit owners - shows ownership of all objs, verbs, props that arent owned by #10";
4arg1 = args[1];
5maxobj = tonum(max_object());
6if (arg1 == "owners")
7for x in [0..maxobj]
8xobj = toobj(x);
9if (!valid(xobj))
10player:tell(("#" + tostr(x)) + " --> invalid object");
11else
12obj_owner = xobj.owner;
13if (obj_owner != #10)
14player:tell((("#" + tostr(x)) + " --> ") + tostr(obj_owner));
15endif
16props = properties(xobj);
17for prop in (props)
18prop_owner = property_info(xobj, prop)[1];
19if (prop_owner != #10)
20player:tell((((("  " + tostr(xobj)) + ".") + prop) + " -> ") + tostr(prop_owner));
21endif
22endfor
23verblist = verbs(xobj);
24for xverb in (verblist)
25verb_owner = verb_info(xobj, is_member(xverb, verbs(xobj)))[1];
26if (verb_owner != #10)
27player:tell((((("  " + tostr(xobj)) + ":") + xverb) + " -> ") + tostr(verb_owner));
28endif
29endfor
30endif
31endfor
32endif

chown

Spec any none noneFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"$dm:chown any none none";
2"change ownership of an object, prop, or verb, or do mass changes";
3"chown allobjs -- mass change all objects to be owned by #10";
4arg1 = args[1];
5maxobj = tonum(max_object());
6if (arg1 == "allobjs")
7for x in [0..maxobj]
8xobj = toobj(x);
9if (!valid(xobj))
10player:tell(("#" + tostr(x)) + " --> invalid object");
11else
12if (xobj.owner != #10)
13newowner = xobj:chown(#10);
14player:tell((("#" + tostr(x)) + " --> ") + tostr(newowner));
15endif
16endif
17endfor
18endif

trunclog

Spec any any anyFlags rwdOwner #10Definer #10

Referenced by

none

Source

1"#10:trunclog any any any";
2{?logname = "", ?lines = "0"} = args;
3if (logname == "")
4player:tell("Specify a log to truncate:%W");
5player:tell($log.logs);
6elseif (!(logname in $log.logs))
7player:tell("No such log exists.");
8else
9loglen = length($log.(logname));
10if (lines == "0")
11$log.(logname) = {};
12player:tell(((logname + " truncated to ") + tostr(lines)) + " lines.");
13elseif (loglen < tonum(lines))
14player:tell(("Log is only " + tostr(loglen)) + " lines long.");
15else
16$log.(logname) = {@$log.(logname)[(loglen - tonum(lines)) + 1..$]};
17player:tell(((logname + " truncated to ") + tostr(lines)) + " lines.");
18endif
19endif

match

Spec this none thisFlags rwxdOwner #10Definer #10

Referenced by

none

Source

1"#10:match(str, objlist) - returns a list of objs from args[2] that";
2"are known to this or aliased to args[1]. if no match, returns empty list.";
3"of no args[2], uses all objects.  yes, scary. note special case with $objref";
4"objnums are matched exactly.  no need for partials with them.";
5"also note special cases: here, me, any others?";
6{token, ?objlist = 0} = args;
7"here and me";
8if (token == "here")
9return {this.location};
10elseif (token == "me")
11return {this};
12else
13"check for dollar sign ref";
14if (token[1] == "$")
15dollar_obj = $utils:match_dollar_ref(token);
16"if dollar sign ref is valid";
17if (dollar_obj != 0)
18"set token to the objnum (in string form) to do normal matching below.";
19token = tostr(dollar_obj);
20endif
21endif
22if (objlist == 0)
23objlist = {#1, @#1:descendants()};
24endif
25count = 0;
26count_and_item = $utils:parse_dot_ref(token);
27if (count_and_item)
28{count, item} = count_and_item;
29endif
30if (count > 0)
31token = item;
32endif
33matchlist = {};
34for each in (objlist)
35if (!(each in matchlist))
36doesmatch = 0;
37names = {each:known_to(this)[2], @each.aliases, tostr(each)};
38for name in (names)
39"exact match the objnums";
40if (token[1] == "#")
41doesmatch = doesmatch || (token == name);
42else
43doesmatch = doesmatch || (index(name, token) == 1);
44endif
45endfor
46if (doesmatch)
47matchlist = {@matchlist, each};
48endif
49endif
50endfor
51if (count == 0)
52return matchlist;
53elseif (count <= length(matchlist))
54return {matchlist[count]};
55else
56return {};
57endif
58endif