generic programmer #58

Parent #4Owner #2Flags read, fertileSource QuestCore.db

Aliases: generic programmer, generic, programmer

43 verbs · 137 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
@prop*ertyany any anyrd#5869
@chmod*#any any anyrd#5896
@args*#any any anyrd#5849
eval*-dany any anyrd#5823
@rmprop*ertyany any anyrd#5818
@verbany any anyrd#5860
@rmverb*#any none nonerd#5849
@forkedany none nonerd#5843
@kill @killq*uietany none nonerd#58128
@copy @copy-x @copy-moveany at/to anyrd#5884
_kill_task_messagethis none thisrxd#583
@prog*ram @program#any any anyrd#58102
@setenvany any anyrd#5814
@pros*pectus pros*pectusany any anyrxd#5815
@d*isplayany none nonerd#58199
@db*sizenone none nonerd#5813
@gethelpany any anyrxd#5837
@grep @egrepany any anyrd#5829
@s*howany any anyrd#5825
@check-p*ropertyany none nonerd#5817
set_eval_envthis none thisrxd#5818
@clearp*roperty @clprop*ertyany none nonerd#5820
@disown @disinheritany any anyrd#5839
eval_cmd_stringthis none thisrxd#5822
@dumpany any anyrd#58168
#*any any anyrd#5866
eval_value_to_stringthis none thisrxd#588
@progo*ptions @prog-o*ptions @programmero*ptions @programmer-o*ptionsany any anyrd#5829
prog_optionthis none thisrxd#587
set_prog_optionthis none thisrxd#5819
@list*#any any anyrd#58140
set_eval_subsnone none nonerxd#5813
@verbs*any none nonerd#5823
@forked-v*erboseany none nonerd#5844
@properties* @props*any none noner#5812
@greprop*s @grepprop*sany any anyrd#5861
@coreany none nonerd#5844
@setl*earn @setk*nowledgeany none nonerxd#5821
@seek*nowledgeany none nonerxd#5827
@monscrany any anyrxd#5868
@scr*iptany any anyrxd#58126
&*any any anyrxd#5870
%*any none nonerxd#588

Properties

PropertyDefinerFlagsOwnerValue
eval_subs#58r#36{}
eval_ticks#58r#363
eval_env#58r#36"here=player.location;me=player"
prog_options#58rc#2{}
bot#58rc#2#-1
build_options#4rc#2<clear>
at_room_width#90rc#2<clear>
at_number#90rc#2<clear>
join_msg#90rc#2<clear>
object_port_msg#90rc#2<clear>
victim_port_msg#90rc#2<clear>
thing_arrive_msg#90rc#2<clear>
othing_port_msg#90rc#2<clear>
thing_port_msg#90rc#2<clear>
player_arrive_msg#90rc#2<clear>
oplayer_port_msg#90rc#2<clear>
player_port_msg#90rc#2<clear>
self_arrive_msg#90rc#2<clear>
oself_port_msg#90rc#2<clear>
self_port_msg#90rc#2<clear>
rooms#90r#36<clear>
refused_origins#90r#36<clear>
refused_extra#90r#36<clear>
default_refusal_time#90r#36<clear>
report_refusal#90r#36<clear>
refused_actions#90r#36<clear>
refused_until#90r#36<clear>
page_refused#90r#36<clear>
page_refused_msg#90rc#2<clear>
whisper_refused_msg#90rc#2<clear>
mail_refused_msg#90rc#2<clear>
death_msg#91rc#2<clear>
alive#91r#36<clear>
alert#91r#36<clear>
mobile#91r#36<clear>
wielded#91r#36<clear>
last_paged#91r#36<clear>
last_healed#91r#36<clear>
followed_by#91r#36<clear>
following#91r#36<clear>
free_points#91r#361.36499999999999
stats#91r#36<clear>
stats_current#91r#36<clear>
skills#91r#36<clear>
race#91r#36<clear>
org#91r#36<clear>
money#91r#36<clear>
follow_msg#91rc#2<clear>
stopfollow_msg#91rc#2<clear>
searching#91r#36<clear>
languages#91r#36{{#142}, {2.0}}
speaking#91r#36<clear>
remembered_names#91r#36{}
short_desc_msg#91r#36""
knowledge#91rc#2<clear>
magic_immunity#91rc#2<clear>
roomnum#91rwc#2<clear>
killcount#91rc#2<clear>
pkill#91rc#2<clear>
level#91rc#2<clear>
experience#91rc#2<clear>
adv_points#91rc#2<clear>
resets#91rc#2<clear>
exp#91rc#2<clear>
class#91rc#2<clear>
map#91rc#2<clear>
used_spells#91rc#2<clear>
_mail_task#40rc#2<clear>
messages_going#40c#2<clear>
mail_lists#40rc#2<clear>
mail_notify#40rc#2<clear>
mail_forward#40rc#2<clear>
mail_options#40rc#2{}
message_keep_date#40rc#2<clear>
messages_kept#40rc#2<clear>
current_message#40c#2{0, -1300000000}
messages#40c#2<clear>
ansi_options#95r#36<clear>
replace_codes#95r#36<clear>
features#6r#36<clear>
previous_connection#6#2<clear>
email_address#6#2<clear>
last_disconnect_time#6r#2<clear>
help#6rc#2{#22, #28, #18, #19}
more_msg#6rc#2<clear>
linetask#6r#36<clear>
linesleft#6r#36<clear>
linebuffer#6#36<clear>
pagelen#6r#36<clear>
owned_objects#6r#2<clear>
linelen#6r#36<clear>
current_folder#6c#2<clear>
all_connect_places#6#2<clear>
last_connect_place#6#2<clear>
brief#6rc#2<clear>
lines#6c#2<clear>
page_absent_msg#6rc#2<clear>
pq#6rc#2<clear>
pqc#6rc#2<clear>
page_origin_msg#6rc#2<clear>
page_echo_msg#6rc#2<clear>
edit_options#6rc#2<clear>
last_connect_time#6r#2<clear>
ownership_quota#6#360
gender#6rc#2<clear>
prc#6rc#2<clear>
ppc#6rc#2<clear>
poc#6rc#2<clear>
psc#6rc#2<clear>
pr#6rc#2<clear>
pp#6rc#2<clear>
po#6rc#2<clear>
ps#6rc#2<clear>
home#6rc#2#62
password#6#2<clear>
gaglist#6rc#2<clear>
paranoid#6rc#2<clear>
display_options#6rc#2<clear>
verb_subs#6rc#2<clear>
first_connect_time#6r#2<clear>
size_quota#6#36<clear>
last_password_time#6#2<clear>
last_connect_attempt#6#2<clear>
page_count_start_time#6r#2<clear>
ping_task#6r#36<clear>
infobar#6rc#2<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#2<clear>
key#1c#2<clear>
aliases#1r#2{"generic programmer", "generic", "programmer"}
description#1rc#2"You see a player who is too experienced to have any excuse for not having a description."
object_size#1r#36{79731, 1539462952}

Ancestry

Ancestors (nearest first): #4 generic builder#90 Frand's administrator class#91 generic gamer#40 Generic Mail Receiving Player#95 ANSI PC#6 generic player#102 subthing#1 Root Class

Children: #36 Hacker, #57 generic wizard, #71 housekeeper

Call graph

calls n58_0 #58:@prop*erty n6_10 #6:notify n58_0->n6_10 n80_7 #80:creation_permitted n58_0->n80_7 n6_18 #6:tell n58_0->n6_18 n59_13 #59:parse_propref n58_0->n59_13 n6_7 #6:my_match_object n58_0->n6_7 n56_0 #56:object_match_failed n58_0->n56_0 n20_42 #20:prefix_to_value n58_0->n20_42 n20_40 #20:word_start n58_0->n20_40 n20_39 #20:words n58_0->n20_39 n42_1 #42:apply n58_0->n42_1 n20_20 #20:match_player n58_0->n20_20 n56_1 #56:player_match_result n58_0->n56_1 n52_0 #52:has_property n58_0->n52_0 n58_1 #58:@chmod*# n58_1->n6_10 n58_1->n59_13 n58_1->n6_7 n58_1->n56_0 n58_1->n42_1 n59_14 #59:parse_verbref n58_1->n59_14 n59_1 #59:toint n58_1->n59_1 n58_2 #58:@args*# n58_2->n6_10 n58_2->n6_7 n58_2->n56_0 n58_2->n59_14 n58_2->n59_1 n59_15 #59:parse_argspec n58_2->n59_15 n20_5 #20:from_list n58_2->n20_5 n58_3 #58:eval*-d n58_3->n6_10 n58_3->n6_18 n58_26 #58:eval_value_to_string n58_3->n58_26 n6_11 #6:notify_lines n58_3->n6_11 n58_4 #58:@rmprop*erty n58_4->n6_10 n58_4->n59_13 n58_4->n6_7 n58_4->n56_0 n58_5 #58:@verb n58_5->n6_10 n58_5->n80_7 n58_5->n6_18 n58_5->n6_7 n58_5->n56_0 n58_5->n42_1 n58_5->n20_20 n58_5->n56_1 n58_5->n59_14 n58_5->n59_15 n20_38 #20:explode n58_5->n20_38 n52_2 #52:has_verb n58_5->n52_2 n58_6 #58:@rmverb*# n58_6->n6_10 n58_6->n6_7 n58_6->n56_0 n58_6->n59_14 n58_6->n59_1 n58_6->n59_15 n58_6->n20_5 n59_22 #59:find_last_verb_named n58_6->n59_22 n59_18 #59:full_prep n58_6->n59_18 n58_7 #58:@forked n58_7->n6_10 n58_7->n20_20 n58_7->n56_1 n56_8 #56:suspend_if_needed n58_7->n56_8 n24_8 #24:queued_tasks n58_7->n24_8 n20_71 #20:redirect_ansi n58_7->n20_71 n58_8 #58:@kill n58_8->n6_10 n58_8->n6_7 n58_8->n20_20 n58_8->n56_1 n58_8->n6_11 n58_10 #58:_kill_task_message n58_8->n58_10 n58_10->n6_10 n58_10->n20_71 n58_9 #58:@copy n58_9->n6_10 n58_9->n80_7 n58_9->n6_7 n58_9->n56_0 n58_9->n59_14 n58_9->n52_2 n42_0 #42:controls n58_9->n42_0 n59_48 #59:move_verb n58_9->n59_48 n58_11 #58:@prog*ram n58_11->n6_10 n58_11->n6_7 n58_11->n56_0 n58_11->n59_14 n58_11->n59_1 n58_11->n59_15 n58_11->n20_5 n58_11->n6_11 n58_11->n59_18 n59_21 #59:find_verb_named n58_11->n59_21 n56_3 #56:read_lines n58_11->n56_3 n58_12 #58:@setenv n58_12->n6_10 n58_13 #58:@pros*pectus n58_13->n6_10 n58_13->n20_39 n58_13->n20_20 n58_13->n56_1 n59_31 #59:_parse_audit_args n58_13->n59_31 n21_6 #21:do_audit n58_13->n21_6 n58_14 #58:@d*isplay n58_14->n6_10 n58_14->n56_0 n58_14->n52_0 n58_14->n20_5 n58_14->n52_2 n58_14->n56_8 n58_14->n20_71 n91_26 #91:title n58_14->n91_26

Showing 48 of 118 verbs; 70 not shown.

Source

@prop*erty

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (!player.programmer)
3player:notify("You need to be a programmer to do this.");
4player:notify("If you want to become a programmer, talk to a wizard.");
5return;
6elseif (!$quota_utils:property_addition_permitted(player))
7player:tell("Property addition not permitted because quota exceeded.");
8return;
9endif
10nargs = length(args);
11usage = tostr("Usage:  ", verb, " <object>.<prop-name> [<init_value> [<perms> [<owner>]]]");
12if ((nargs < 1) || (!(spec = $code_utils:parse_propref(args[1]))))
13player:notify(usage);
14return;
15endif
16object = player:my_match_object(spec[1]);
17name = spec[2];
18if ($command_utils:object_match_failed(object, spec[1]))
19return;
20endif
21if (nargs < 2)
22value = 0;
23else
24q = $string_utils:prefix_to_value(argstr[$string_utils:word_start(argstr)[2][1]..$]);
25if (q[1] == 0)
26player:notify(tostr("Syntax error in initial value:  ", q[2]));
27return;
28endif
29value = q[2];
30args = {args[1], value, @$string_utils:words(q[1])};
31nargs = length(args);
32endif
33default = player:prog_option("@prop_flags");
34if (!default)
35default = "rc";
36endif
37perms = (nargs < 3) ? default | $perm_utils:apply(default, args[3]);
38if (nargs < 4)
39owner = player;
40else
41owner = $string_utils:match_player(args[4]);
42if ($command_utils:player_match_result(owner, args[4])[1])
43return;
44endif
45endif
46if (nargs > 4)
47player:notify(usage);
48return;
49endif
50try
51add_property(object, name, value, {owner, perms});
52player:notify(tostr("Property added with value ", toliteral(object.(name)), "."));
53except (E_INVARG)
54if ($object_utils:has_property(object, name))
55player:notify(tostr("Property ", object, ".", name, " already exists."));
56else
57for i in [1..length(perms)]
58if (!index("rcw", perms[i]))
59player:notify(tostr("Unknown permission bit:  ", perms[i]));
60return;
61endif
62endfor
63"...the only other possibility...";
64player:notify("Property is already defined on one or more descendents.");
65player:notify(tostr("Try @check-prop ", args[1]));
66endif
67except e (ANY)
68player:notify(e[2]);
69endtry

@chmod*#

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2bynumber = verb == "@chmod#";
3if (length(args) != 2)
4player:notify(tostr("Usage:  ", verb, " <object-or-property-or-verb> <permissions>"));
5return;
6endif
7{what, perms} = args;
8if (spec = $code_utils:parse_verbref(what))
9if (!player.programmer)
10player:notify("You need to be a programmer to do this.");
11player:notify("If you want to become a programmer, talk to a wizard.");
12return;
13endif
14if (valid(object = player:my_match_object(spec[1])))
15vname = spec[2];
16if (bynumber)
17vname = $code_utils:toint(vname);
18if (vname == E_TYPE)
19return player:notify("Verb number expected.");
20elseif ((vname < 1) || `vname > length(verbs(object)) ! E_PERM => 0')
21return player:notify("Verb number out of range.");
22endif
23endif
24try
25info = verb_info(object, vname);
26if (!valid(owner = info[1]))
27player:notify(tostr("That verb is owned by an invalid object (", owner, "); it needs to be @chowned."));
28elseif (!is_player(owner))
29player:notify(tostr("That verb is owned by a non-player object (", owner.name, ", ", owner, "); it needs to be @chowned."));
30else
31info[2] = perms = $perm_utils:apply(info[2], perms);
32try
33result = set_verb_info(object, vname, info);
34player:notify(tostr("Verb permissions set to \"", perms, "\"."));
35except (E_INVARG)
36player:notify(tostr("\"", perms, "\" is not a valid permissions string for a verb."));
37except e (ANY)
38player:notify(e[2]);
39endtry
40endif
41except (E_VERBNF)
42player:notify("That object does not define that verb.");
43except error (ANY)
44player:notify(error[2]);
45endtry
46return;
47endif
48elseif (bynumber)
49return player:notify("@chmod# can only be used for verbs.");
50elseif (index(what, ".") && (spec = $code_utils:parse_propref(what)))
51if (valid(object = player:my_match_object(spec[1])))
52pname = spec[2];
53try
54info = property_info(object, pname);
55info[2] = perms = $perm_utils:apply(info[2], perms);
56try
57result = set_property_info(object, pname, info);
58player:notify(tostr("Property permissions set to \"", perms, "\"."));
59except (E_INVARG)
60player:notify(tostr("\"", perms, "\" is not a valid permissions string for a property."));
61except error (ANY)
62player:notify(error[2]);
63endtry
64except (E_PROPNF)
65player:notify("That object does not have that property.");
66except error (ANY)
67player:notify(error[2]);
68endtry
69return;
70endif
71elseif (valid(object = player:my_match_object(what)))
72perms = $perm_utils:apply(((object.r ? "r" | "") + (object.w ? "w" | "")) + (object.f ? "f" | ""), perms);
73r = w = f = 0;
74for i in [1..length(perms)]
75if (perms[i] == "r")
76r = 1;
77elseif (perms[i] == "w")
78w = 1;
79elseif (perms[i] == "f")
80f = 1;
81else
82player:notify(tostr("\"", perms, "\" is not a valid permissions string for an object."));
83return;
84endif
85endfor
86try
87object.r = r;
88object.w = w;
89object.f = f;
90player:notify(tostr("Object permissions set to \"", perms, "\"."));
91except (E_PERM)
92player:notify("Permission denied.");
93endtry
94return;
95endif
96$command_utils:object_match_failed(object, what);

@args*#

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1if (player != caller)
2return;
3endif
4set_task_perms(player);
5if (!player.programmer)
6player:notify("You need to be a programmer to do this.");
7player:notify("If you want to become a programmer, talk to a wizard.");
8return;
9endif
10if (!(args && (spec = $code_utils:parse_verbref(args[1]))))
11player:notify(tostr(args ? ("\"" + args[1]) + "\"?  " | "", "<object>:<verb>  expected."));
12elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
13"...can't find object...";
14else
15if (verb == "@args#")
16name = $code_utils:toint(spec[2]);
17if (name == E_TYPE)
18return player:notify("Verb number expected.");
19elseif ((name < 1) || `name > length(verbs(object)) ! E_PERM => 0')
20return player:notify("Verb number out of range.");
21endif
22endif
23try
24info = verb_args(object, name = spec[2]);
25if (typeof(pas = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST)
26"...arg spec is bogus...";
27player:notify(tostr(pas));
28elseif (!(newargs = pas[1]))
29player:notify($string_utils:from_list(info, " "));
30elseif (pas[2])
31player:notify(tostr("\"", pas[2][1], "\" unexpected."));
32else
33info[2] = info[2][1..index(info[2] + "/", "/") - 1];
34info = {@newargs, @info[length(newargs) + 1..$]};
35try
36result = set_verb_args(object, name, info);
37player:notify("Verb arguments changed.");
38except (E_INVARG)
39player:notify(tostr("\"", info[2], "\" is not a valid preposition (?)"));
40except error (ANY)
41player:notify(error[2]);
42endtry
43endif
44except (E_VERBNF)
45player:notify("That object does not have a verb with that name.");
46except error (ANY)
47player:notify(error[2]);
48endtry
49endif

eval*-d

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"A MOO-code evaluator.  Type `;CODE' or `eval CODE'.";
2"Calls player:eval_cmd_string to first transform CODE in any way appropriate (e.g., prefixing .eval_env) and then do the actual evaluation.  See documentation for this:eval_cmd_string";
3"If you set your .eval_time property to 1, you find out how many ticks and seconds you used.";
4"If eval-d is used, the evaluation is performed as if the debug flag were unset.";
5if (player != this)
6player:tell("I don't understand that.");
7return;
8elseif (!player.programmer)
9player:tell("You need to be a programmer to eval code.");
10return;
11endif
12set_task_perms(player);
13result = player:eval_cmd_string(argstr, verb != "eval-d");
14if (result[1])
15player:notify(this:eval_value_to_string(result[2]));
16if (player:prog_option("eval_time") && (!output_delimiters(player)[2]))
17player:notify(tostr("[used ", result[3], " tick", (result[3] != 1) ? "s, " | ", ", result[4], " second", (result[4] != 1) ? "s" | "", ".]"));
18endif
19else
20player:notify_lines(result[2]);
21nerrors = length(result[2]);
22player:notify(tostr(nerrors, " error", (nerrors == 1) ? "." | "s."));
23endif

@rmprop*erty

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if ((length(args) != 1) || (!(spec = $code_utils:parse_propref(args[1]))))
3player:notify(tostr("Usage:  ", verb, " <object>.<property>"));
4return;
5endif
6object = player:my_match_object(spec[1]);
7pname = spec[2];
8if ($command_utils:object_match_failed(object, spec[1]))
9return;
10endif
11try
12result = delete_property(object, pname);
13player:notify("Property removed.");
14except (E_PROPNF)
15player:notify("That object does not define that property.");
16except res (ANY)
17player:notify(res[2]);
18endtry

@verb

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (!player.programmer)
3player:notify("You need to be a programmer to do this.");
4player:notify("If you want to become a programmer, talk to a wizard.");
5return;
6elseif (!$quota_utils:verb_addition_permitted(player))
7player:tell("Verb addition not permitted because quota exceeded.");
8return;
9endif
10if (!(args && (spec = $code_utils:parse_verbref(args[1]))))
11player:notify(tostr("Usage:  ", verb, " <object>:<verb-name(s)> [<dobj> [<prep> [<iobj> [<permissions> [<owner>]]]]]"));
12return;
13elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
14return;
15endif
16name = spec[2];
17"...Adding another verb of the same name is often a mistake...";
18namelist = $string_utils:explode(name);
19for n in (namelist)
20if (i = index(n, "*"))
21n = n[1..i - 1] + n[i + 1..$];
22endif
23if ((hv = $object_utils:has_verb(object, n)) && (hv[1] == object))
24player:notify(tostr("Warning:  Verb `", n, "' already defined on that object."));
25endif
26endfor
27if (typeof(pas = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST)
28player:notify(tostr(pas));
29return;
30endif
31verbargs = pas[1] || (player:prog_option("verb_args") || {});
32verbargs = {@verbargs, "none", "none", "none"}[1..3];
33rest = pas[2];
34if (verbargs == {"this", "none", "this"})
35perms = "rxd";
36else
37perms = "rd";
38endif
39if (rest)
40perms = $perm_utils:apply(perms, rest[1]);
41endif
42if (length(rest) < 2)
43owner = player;
44elseif (length(rest) > 2)
45player:notify(tostr("\"", rest[3], "\" unexpected."));
46return;
47elseif ($command_utils:player_match_result(owner = $string_utils:match_player(rest[2]), rest[2])[1])
48return;
49elseif (owner == $nothing)
50player:notify("Verb can't be owned by no one!");
51return;
52endif
53try
54x = add_verb(object, {owner, perms, name}, verbargs);
55player:notify(tostr("Verb added (", length(verbs(object)), ")."));
56except (E_INVARG)
57player:notify(tostr(rest ? tostr("\"", perms, "\" is not a valid set of permissions.") | tostr("\"", verbargs[2], "\" is not a valid preposition (?)")));
58except e (ANY)
59player:notify(e[2]);
60endtry

@rmverb*#

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (!(args && (spec = $code_utils:parse_verbref(args[1]))))
3player:notify(tostr("Usage:  ", verb, " <object>:<verb>"));
4elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
5"...bogus object...";
6elseif (typeof(argspec = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST)
7player:notify(tostr(argspec));
8elseif (argspec[2])
9player:notify($string_utils:from_list(argspec[2], " ") + "??");
10elseif (length(argspec = argspec[1]) in {1, 2})
11player:notify({"Missing preposition", "Missing iobj specification"}[length(argspec)]);
12else
13verbname = spec[2];
14if (verb == "@rmverb#")
15loc = $code_utils:toint(verbname);
16if (loc == E_TYPE)
17return player:notify("Verb number expected.");
18elseif ((loc < 1) || (loc > `length(verbs(object)) ! E_PERM => 0'))
19return player:notify("Verb number out of range.");
20endif
21else
22if (index(verbname, "*") > 1)
23verbname = strsub(verbname, "*", "");
24endif
25loc = $code_utils:find_last_verb_named(object, verbname);
26if (argspec)
27argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2];
28while (loc && (`verb_args(object, loc) ! ANY' != argspec))
29loc = $code_utils:find_last_verb_named(object, verbname, loc - 1);
30endwhile
31endif
32if (!loc)
33player:notify(tostr("That object does not define that verb", argspec ? " with those args." | "."));
34return;
35endif
36endif
37info = `verb_info(object, loc) ! ANY';
38vargs = `verb_args(object, loc) ! ANY';
39try
40delete_verb(object, loc);
41if (info)
42player:notify(tostr("Verb ", object, ":", info[3], " (", loc, ") {", $string_utils:from_list(vargs, " "), "} removed."));
43else
44player:notify(tostr("Unreadable verb ", object, ":", loc, " removed."));
45endif
46except e (ANY)
47player:notify(e[2]);
48endtry
49endif

@forked

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Syntax:  @forked [player]";
2"         @forked all wizards";
3"";
4"For a normal player, shows all the tasks you have waiting in your queue, especially those forked or suspended. A wizard will see all the tasks of all the players unless the optional argument is provided.";
5"The second form is only usable by wizards and provides an output of all tasks owned by characters who are .wizard=1. Useful to find a task that may get put in a random queue due to $wiz_utils:random_wizard. Or even finding verbs that run with wizard permissions that shouldn't be.";
6set_task_perms(player);
7if (!dobjstr)
8tasks = queued_tasks();
9elseif ((dobjstr == "all wizards") && player.wizard)
10tasks = {};
11for t in (queued_tasks())
12if (t[5].wizard)
13tasks = {@tasks, t};
14endif
15$command_utils:suspend_if_needed(1);
16endfor
17elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr), dobjstr)[1])
18return;
19elseif (typeof(tasks = $wiz_utils:queued_tasks(dobj)) != LIST)
20player:notify(tostr(verb, " ", dobj.name, "(", dobj, "):  ", tasks));
21return;
22endif
23if (tasks)
24su = $string_utils;
25player:notify("Queue ID    Start Time            Owner         Verb (Line) [This]");
26player:notify("--------    ----------            -----         -----------------");
27now = time();
28for task in (tasks)
29$command_utils:suspend_if_needed(0);
30{q_id, start, nu, nu2, owner, vloc, vname, lineno, this} = task;
31time = (start >= now) ? ctime(start)[5..24] | su:left((start == -1) ? "Reading input ..." | tostr(now - start, " seconds ago..."), 20);
32owner_name = valid(owner) ? owner.name | tostr("Dead ", owner);
33player:notify(tostr(su:left(tostr(q_id), 10), "  ", time, "  ", su:left(owner_name, 12), "  ", vloc, ":", vname, " (", lineno, ")", (this != vloc) ? tostr(" [", this, "]") | ""));
34if (index(vname, "suspend") && (vloc == $command_utils))
35"Find out the first line of the callers() list from task_stack()";
36{sthis, svname, sprogger, svloc, splayer, slineno} = task_stack(q_id, 1)[2];
37player:notify(tostr("                    Called By...  ", su:left(valid(sprogger) ? sprogger.name | tostr("Dead ", sprogger), 12), "  ", svloc, ":", svname, (sthis != svloc) ? tostr(" [", sthis, "]") | "", " (", slineno, ")"));
38endif
39endfor
40player:notify("-----------------------------------------------------------------");
41else
42player:notify("No tasks.");
43endif

@kill @killq*uiet

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Kills one or more tasks.";
2"Arguments:";
3"   object:verb -- kills all tasks which were started from that object and verb.";
4"   all -- kills all tasks owned by invoker";
5"   all player-name -- wizard variant:  kills all tasks owned by player.";
6"   all everyone -- wizard variant:  really kills all tasks.";
7"   Integer taskid -- kills the specifically named task.";
8"   soon [integer] -- kills all tasks scheduled to run in the next [integer] seconds, which defaults to 60.";
9"   %integer -- kills all tasks which end in the digits contained in integer.";
10"   The @killquiet alias kills tasks without the pretty printout if more than one task is being killed.";
11set_task_perms(player);
12quiet = index(verb, "q");
13if (length(args) == 0)
14player:notify_lines({tostr("Usage:  ", verb, " [object]:[verb]"), tostr("        ", verb, " task_id"), tostr("        ", verb, " soon [number-of-seconds]", player.wizard ? " [everyone|<player name>]" | ""), tostr("        ", verb, " all", player.wizard ? " [everyone|<player name>]" | "")});
15return;
16elseif (taskid = toint(args[1]))
17elseif (all = args[1] == "all")
18everyone = 0;
19realplayer = player;
20if (player.wizard && (length(args) > 1))
21realplayer = $string_utils:match_player(args[2]);
22everyone = args[2] == "everyone";
23if ((!valid(realplayer)) && (!everyone))
24$command_utils:player_match_result(realplayer, args[2]);
25return;
26elseif (!everyone)
27set_task_perms(realplayer);
28endif
29endif
30elseif (soon = args[1] == "soon")
31realplayer = player;
32if (length(args) > 1)
33soon = toint(args[2]);
34if ((soon <= 0) && (!player.wizard))
35player:notify(tostr("Usage:  ", verb, " soon [positive-number-of-seconds]"));
36return;
37elseif (player.wizard)
38result = this:kill_aux_wizard_parse(@args[2..$]);
39soon = result[1];
40if (result[1] < 0)
41"already gave them an error message";
42return;
43elseif (result[2] == 1)
44everyone = 1;
45else
46everyone = 0;
47set_task_perms(result[2]);
48realplayer = result[2];
49endif
50endif
51else
52soon = 60;
53everyone = 0;
54endif
55elseif (percent = args[1][1] == "%")
56l = length(args[1]);
57digits = toint(args[1][2..l]);
58percent = toint("1" + "0000000000"[1..l - 1]);
59elseif (colon = index(argstr, ":"))
60whatstr = argstr[1..colon - 1];
61vrb = argstr[colon + 1..$];
62if (whatstr)
63what = player:my_match_object(whatstr);
64endif
65else
66player:notify_lines({tostr("Usage:  ", verb, " [object]:[verb]"), tostr("        ", verb, " task_id"), tostr("        ", verb, " soon [number-of-seconds]", player.wizard ? " [everyone|<player name>]" | ""), tostr("        ", verb, " all", player.wizard ? " [\"everyone\"|<player name>]" | "")});
67return;
68endif
69"OK, parsed the line, and punted them if it was bogus.  This verb could have been a bit shorter at the expense of readability.  I think it's getting towards unreadable as is.  At this point we've set_task_perms'd, and set up an enormous number of local variables.  Evaluate them in the order we set them, and we should never get var not found.";
70queued_tasks = queued_tasks();
71killed = 0;
72if (taskid)
73try
74kill_task(taskid);
75player:notify(tostr("Killed task ", taskid, "."));
76killed = 1;
77except error (ANY)
78player:notify(tostr("Can't kill task ", taskid, ": ", error[2]));
79endtry
80elseif (all)
81for task in (queued_tasks)
82if (everyone || (realplayer == task[5]))
83`kill_task(task[1]) ! ANY';
84killed = killed + 1;
85if (!quiet)
86this:_kill_task_message(task);
87endif
88endif
89endfor
90elseif (soon)
91now = time();
92for task in (queued_tasks)
93if (((task[2] - now) < soon) && ((!player.wizard) || (everyone || (realplayer == task[5]))))
94`kill_task(task[1]) ! ANY';
95killed = killed + 1;
96if (!quiet)
97this:_kill_task_message(task);
98endif
99endif
100endfor
101elseif (percent)
102for task in (queued_tasks)
103if (digits == (task[1] % percent))
104`kill_task(task[1]) ! ANY';
105killed = killed + 1;
106if (!quiet)
107this:_kill_task_message(task);
108endif
109endif
110endfor
111elseif ((colon || vrb) || whatstr)
112for task in (queued_tasks)
113if ((((((whatstr == "") || (valid(task[6]) && (index(task[6].name, whatstr) == 1))) || (valid(task[9]) && (index(task[9].name, whatstr) == 1))) || (task[9] == what)) || (task[6] == what)) && ((vrb == "") || (index(" " + strsub(task[7], "*", ""), " " + vrb) == 1)))
114`kill_task(task[1]) ! ANY';
115killed = killed + 1;
116if (!quiet)
117this:_kill_task_message(task);
118endif
119endif
120endfor
121else
122player:notify("Something is funny; I didn't understand your @kill command.  You shouldn't have gotten here.  Please send yduJ mail saying you got this message from @kill, and what you had typed to @kill.");
123endif
124if (!killed)
125player:notify("No tasks killed.");
126elseif (quiet)
127player:notify(tostr("Killed ", killed, " tasks."));
128endif

@copy @copy-x @copy-move

Spec any at/to anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Usage:  @copy source:verbname to target[:verbname]";
2"  the target verbname, if not given, defaults to that of the source.  If the target verb doesn't already exist, a new verb is installed with the same args, names, code, and permission flags as the source.  Otherwise, the existing target's verb code is overwritten and no other changes are made.";
3"This the poor man's version of multiple inheritance... the main problem is that someone may update the verb you're copying and you'd never know.";
4"  if @copy-x is used, makes an unusable copy (!x, this none this).  If @copy-move is used, deletes the source verb as well.";
5set_task_perms(player);
6if (!player.programmer)
7player:notify("You need to be a programmer to do this.");
8player:notify("If you want to become a programmer, talk to a wizard.");
9return;
10elseif ((verb != "@copy-move") && (!$quota_utils:verb_addition_permitted(player)))
11player:notify("Verb addition not permitted because quota exceeded.");
12return;
13elseif ((!(from = $code_utils:parse_verbref(dobjstr))) || (!iobjstr))
14player:notify(tostr("Usage:  ", verb, " obj:verb to obj:verb"));
15player:notify(tostr("        ", verb, " obj:verb to obj"));
16player:notify(tostr("        ", verb, " obj:verb to :verb"));
17return;
18elseif ($command_utils:object_match_failed(fobj = player:my_match_object(from[1]), from[1]))
19return;
20elseif (iobjstr[1] == ":")
21to = {fobj, iobjstr[2..$]};
22elseif (!(to = $code_utils:parse_verbref(iobjstr)))
23iobj = player:my_match_object(iobjstr);
24if ($command_utils:object_match_failed(iobj, iobjstr))
25return;
26endif
27to = {iobj, from[2]};
28elseif ($command_utils:object_match_failed(tobj = player:my_match_object(to[1]), to[1]))
29return;
30else
31to[1] = tobj;
32endif
33from[1] = fobj;
34if (verb == "@copy-move")
35if ((!$perm_utils:controls(player, fobj)) && (!$quota_utils:verb_addition_permitted(player)))
36player:notify("Won't be able to delete old verb.  Quota exceeded, so unable to continue.  Aborted.");
37return;
38elseif ($perm_utils:controls(player, fobj))
39"only try to move if the player controls the verb. Otherwise, skip and treat as regular @copy";
40if (typeof(result = $code_utils:move_verb(@from, @to)) == ERR)
41player:notify(tostr("Unable to move verb from ", from[1], ":", from[2], " to ", to[1], ":", to[2], " --> ", result));
42else
43player:notify(tostr("Moved verb from ", from[1], ":", from[2], " to ", result[1], ":", result[2]));
44endif
45return;
46else
47player:notify("Won't be able to delete old verb.  Treating this as regular @copy.");
48endif
49endif
50to_firstname = strsub(to[2][1..index(to[2] + " ", " ") - 1], "*", "") || "*";
51if ((!(hv = $object_utils:has_verb(to[1], to_firstname))) || (hv[1] != to[1]))
52if ((!(info = `verb_info(@from) ! ANY')) || (!(vargs = `verb_args(@from) ! ANY')))
53player:notify(tostr("Retrieving ", from[1], ":", from[2], " --> ", info && vargs));
54return;
55endif
56if (!player.wizard)
57info[1] = player;
58endif
59if (verb == "@copy-x")
60"... make sure this is an unusable copy...";
61info[2] = strsub(info[2], "x", "");
62vargs = {"this", "none", "this"};
63endif
64if (from[2] != to[2])
65info[3] = to[2];
66endif
67if (ERR == typeof(e = `add_verb(to[1], info, vargs) ! ANY'))
68player:notify(tostr("Adding ", to[1], ":", to[2], " --> ", e));
69return;
70endif
71endif
72code = `verb_code(@from) ! ANY';
73owner = `verb_info(@from)[1] ! ANY';
74if (owner != player)
75code = {tostr("\"Copied from ", from[1].name, " (", from[1], "):", from[2], (from[1] == owner) ? " " | tostr(" by ", owner.name, " (", owner, ") "), ctime(), "\";"), @code};
76if (!player:prog_option("copy_expert"))
77player:notify("Use of @copy is discouraged.  Please do not use @copy if you can use inheritance or features instead.  Use @copy carefully, and only when absolutely necessary, as it is wasteful of database space.");
78endif
79endif
80if (ERR == typeof(e = `set_verb_code(to[1], to_firstname, code) ! ANY'))
81player:notify(tostr("Copying ", from[1], ":", from[2], " to ", to[1], ":", to[2], " --> ", e));
82else
83player:notify(tostr(to[1], ":", to[2], " code set."));
84endif

_kill_task_message

Spec this none thisFlags rxdOwner #2Definer #58

Referenced by

Source

1set_task_perms(caller_perms());
2task = args[1];
3player:notify(tostr("Killed: ", $string_utils:right(tostr("task ", task[1]), 17), ", verb ", task[6], ":", task[7], ", line ", task[8], (task[9] != task[6]) ? ", this==" + tostr(task[9]) | ""));

@prog*ram @program#

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"This version of @program deals with multiple verbs having the same name.";
2"... @program <object>:<verbname> <dobj> <prep> <iobj>  picks the right one.";
3if (player != caller)
4return;
5endif
6set_task_perms(player);
7"...";
8"...catch usage errors first...";
9"...";
10punt = "...set punt to 0 only if everything works out...";
11if (!(args && (spec = $code_utils:parse_verbref(args[1]))))
12player:notify(tostr("Usage: ", verb, " <object>:<verb> [<dobj> <prep> <iobj>]"));
13elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
14"...bogus object...";
15elseif (typeof(argspec = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST)
16player:notify(tostr(argspec));
17elseif (verb == "@program#")
18verbname = $code_utils:toint(spec[2]);
19if (verbname == E_TYPE)
20player:notify("Verb number expected.");
21elseif (length(args) > 1)
22player:notify("Don't give args for @program#.");
23elseif ((verbname < 1) || `verbname > length(verbs(object)) ! E_PERM')
24player:notify("Verb number out of range.");
25else
26argspec = 0;
27punt = 0;
28endif
29elseif (argspec[2])
30player:notify($string_utils:from_list(argspec[2], " ") + "??");
31elseif (length(argspec = argspec[1]) in {1, 2})
32player:notify({"Missing preposition", "Missing iobj specification"}[length(argspec)]);
33else
34punt = 0;
35verbname = spec[2];
36if (index(verbname, "*") > 1)
37verbname = strsub(verbname, "*", "");
38endif
39endif
40"...";
41"...if we have an argspec, we'll need to reset verbname...";
42"...";
43if (punt)
44elseif (argspec)
45if (!(argspec[2] in {"none", "any"}))
46argspec[2] = $code_utils:full_prep(argspec[2]);
47endif
48loc = $code_utils:find_verb_named(object, verbname);
49while ((loc > 0) && (`verb_args(object, loc) ! ANY' != argspec))
50loc = $code_utils:find_verb_named(object, verbname, loc + 1);
51endwhile
52if (!loc)
53punt = "...can't find it....";
54player:notify("That object has no verb matching that name + args.");
55else
56verbname = loc;
57endif
58else
59loc = 0;
60endif
61"...";
62"...get verb info...";
63"...";
64if (punt || (!(punt = "...reset punt to TRUE...")))
65else
66try
67info = verb_info(object, verbname);
68punt = 0;
69aliases = info[3];
70if (!loc)
71loc = aliases in (verbs(object) || {});
72endif
73except (E_VERBNF)
74player:notify("That object does not have that verb definition.");
75except error (ANY)
76player:notify(error[2]);
77endtry
78endif
79"...";
80"...read the code...";
81"...";
82if (punt)
83player:notify(tostr("Now ignoring code for ", args ? args[1] | "nothing in particular", "."));
84$command_utils:read_lines();
85player:notify("Verb code ignored.");
86else
87player:notify(tostr("Now programming ", object.name, ":", aliases, "(", (!loc) ? "??" | loc, ")."));
88lines = $command_utils:read_lines();
89try
90if (result = set_verb_code(object, verbname, lines))
91player:notify_lines(result);
92player:notify(tostr(length(result), " error(s)."));
93player:notify("Verb not programmed.");
94else
95player:notify("0 errors.");
96player:notify("Verb programmed.");
97endif
98except error (ANY)
99player:notify(error[2]);
100player:notify("Verb not programmed.");
101endtry
102endif

@setenv

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Usage: @setenv <environment string>";
2"Set your .eval_env property.";
3set_task_perms(player);
4if (!argstr)
5player:notify(tostr("Usage:  ", verb, " <environment string>"));
6return;
7endif
8player:notify(tostr("Current eval environment is: ", player.eval_env));
9result = player:set_eval_env(argstr);
10if (typeof(result) == ERR)
11player:notify(tostr(result));
12return;
13endif
14player:notify(tostr(".eval_env set to \"", player.eval_env, "\" (", player.eval_ticks, " ticks)."));

@pros*pectus pros*pectus

Spec any any anyFlags rxdOwner #2Definer #58

Referenced by

none

Source

1"Usage: @prospectus <player> [from <start>] [to <end>]";
2set_task_perms((caller_perms() == $nothing) ? player | caller_perms());
3dobj = dobjstr ? $string_utils:match_player(dobjstr) | player;
4if ($command_utils:player_match_result(dobj, dobjstr)[1])
5return;
6endif
7dobjwords = $string_utils:words(dobjstr);
8if (args[1..length(dobjwords)] == dobjwords)
9args = args[length(dobjwords) + 1..$];
10endif
11if (!(parse_result = $code_utils:_parse_audit_args(@args)))
12player:notify(tostr("Usage:  ", verb, " player [from <start>] [to <end>]"));
13return;
14endif
15return $building_utils:do_prospectus(dobj, @parse_result);

@d*isplay

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@display <object>[.[property]]*[,[inherited_property]]*[:[verb]]*[;[inherited_verb]]*";
2if (player != this)
3player:notify(tostr("Sorry, you can't use ", this:title(), "'s `", verb, "' command."));
4return E_PERM;
5endif
6"null names for properties and verbs are interpreted as meaning all of them.";
7opivu = {{}, {}, {}, {}, {}};
8string = "";
9punc = 1;
10literal = 0;
11for jj in [1..length(argstr)]
12j = argstr[jj];
13if (literal)
14string = string + j;
15literal = 0;
16elseif (j == "\\")
17literal = 1;
18elseif (y = index(".,:;", j))
19opivu[punc] = {@opivu[punc], string};
20punc = 1 + y;
21string = "";
22else
23string = string + j;
24endif
25endfor
26opivu[punc] = {@opivu[punc], string};
27objname = opivu[1][1];
28it = this:my_match_object(objname);
29if ($command_utils:object_match_failed(it, objname))
30return;
31endif
32readable = (it.owner == this) || (it.r || this.wizard);
33cant = {};
34if ("" in opivu[2])
35if (readable)
36prop = properties(it);
37else
38prop = {};
39cant = setadd(cant, it);
40endif
41if (!this:display_option("thisonly"))
42what = it;
43while ((!prop) && valid(what = parent(what)))
44if ((what.owner == this) || (what.r || this.wizard))
45prop = properties(what);
46else
47cant = setadd(cant, what);
48endif
49endwhile
50endif
51else
52prop = opivu[2];
53endif
54if ("" in opivu[3])
55inh = {};
56for what in ({it, @$object_utils:ancestors(it)})
57if (((what.owner == this) || what.r) || this.wizard)
58inh = {@inh, @properties(what)};
59else
60cant = setadd(cant, what);
61endif
62endfor
63else
64inh = opivu[3];
65endif
66for q in (inh)
67if (q in `properties(it) ! ANY => {}')
68prop = setadd(prop, q);
69inh = setremove(inh, q);
70endif
71endfor
72vrb = {};
73if ("" in opivu[4])
74if (readable)
75vrbs = verbs(it);
76else
77vrbs = {};
78cant = setadd(cant, it);
79endif
80what = it;
81if (!this:display_option("thisonly"))
82while ((!vrbs) && valid(what = parent(what)))
83if ((what.owner == this) || (what.r || this.wizard))
84vrbs = verbs(what);
85else
86cant = setadd(cant, what);
87endif
88endwhile
89endif
90for n in [1..length(vrbs)]
91vrb = setadd(vrb, {what, n});
92endfor
93else
94for w in (opivu[4])
95if (y = $object_utils:has_verb(it, w))
96vrb = setadd(vrb, {y[1], w});
97else
98this:notify(tostr("No such verb, \"", w, "\""));
99endif
100endfor
101endif
102if ("" in opivu[5])
103for z in ({it, @$object_utils:ancestors(it)})
104if (((this == z.owner) || z.r) || this.wizard)
105for n in [1..length(verbs(z))]
106vrb = setadd(vrb, {z, n});
107endfor
108else
109cant = setadd(cant, z);
110endif
111endfor
112else
113for w in (opivu[5])
114if (typeof(y = $object_utils:has_verb(it, w)) == LIST)
115vrb = setadd(vrb, {y[1], w});
116else
117this:notify(tostr("No such verb, \"", w, "\""));
118endif
119endfor
120endif
121if (({""} in opivu) || (opivu[2..5] == {{}, {}, {}, {}}))
122this:notify(tostr(it.name, " (", it, ") [ ", it.r ? "readable " | "", it.w ? "writeable " | "", it.f ? "fertile " | "", is_player(it) ? "(player) " | "", it.programmer ? "programmer " | "", it.wizard ? "wizard " | "", "]"));
123if (it.owner != (is_player(it) ? it | this))
124this:notify(tostr("  Owned by ", valid(p = it.owner) ? p.name | "** extinct **", " (", p, ")."));
125endif
126this:notify(tostr("  Child of ", valid(p = parent(it)) ? p.name | "** none **", " (", p, ")."));
127if (it.location != $nothing)
128this:notify(tostr("  Location ", valid(p = it.location) ? p.name | "** unplace (tell a wizard, fast!) **", " (", p, ")."));
129endif
130if ($quota_utils.byte_based && $object_utils:has_property(it, "object_size"))
131this:notify(tostr("  Size: ", $string_utils:group_number(it.object_size[1]), " bytes at ", this:ctime(it.object_size[2])));
132endif
133endif
134set_task_perms(this.owner);
135blankargs = this:display_option("blank_tnt") ? {"this", "none", "this"} | #-1;
136for b in (vrb)
137$command_utils:suspend_if_needed(0);
138where = b[1];
139q = b[2];
140short = (typeof(q) == INT) ? q | strsub(y = index(q, " ") ? q[1..y - 1] | q, "*", "");
141inf = `verb_info(where, short) ! ANY';
142if ((typeof(inf) == LIST) || (inf == E_PERM))
143name = (typeof(inf) == LIST) ? index(inf[3], " ") ? ("\"" + inf[3]) + "\"" | inf[3] | q;
144line = $string_utils:left(tostr($string_utils:right(tostr(where), 6), ":", name, " "), 32);
145if (inf == E_PERM)
146line = line + "   ** unreadable **";
147else
148line = $string_utils:left(tostr(line, inf[1].name, " (", inf[1], ") "), 53) + ((i = inf[2] in {"x", "xd", "d", "rd"}) ? {" x", " xd", "  d", "r d"}[i] | inf[2]);
149vargs = `verb_args(where, short) ! ANY';
150if (vargs != blankargs)
151if (this:display_option("shortprep") && (!(vargs[2] in {"any", "none"})))
152vargs[2] = $code_utils:short_prep(vargs[2]);
153endif
154line = $string_utils:left(line + " ", 60) + $string_utils:from_list(vargs, " ");
155endif
156endif
157this:notify(line);
158elseif (inf == E_VERBNF)
159this:notify(tostr(inf));
160this:notify(tostr("  ** no such verb, \"", short, "\" **"));
161else
162this:notify("This shouldn't ever happen. @display is buggy.");
163endif
164endfor
165all = {@prop, @inh};
166max = (length(all) < 4) ? 999 | (this:linelen() - 56);
167depth = (length(all) < 4) ? -1 | 1;
168truncate_owner_names = length(all) > 1;
169for q in (all)
170$command_utils:suspend_if_needed(0);
171inf = `property_info(it, q) ! ANY';
172if (inf == E_PROPNF)
173if (q in $code_utils.builtin_props)
174this:notify(tostr($string_utils:left("," + q, 25), "Built in property            ", $string_utils:abbreviated_value(it.(q), max, depth)));
175else
176this:notify(tostr("  ** property not found, \"", q, "\" **"));
177endif
178else
179pname = $string_utils:left(tostr((q in `properties(it) ! ANY => {}') ? "." | (`is_clear_property(it, q) ! ANY' ? " " | ","), q, " "), 25);
180if (inf == E_PERM)
181this:notify(pname + "   ** unreadable **");
182else
183oname = inf[1].name;
184truncate_owner_names && ((length(oname) > 12) && (oname = oname[1..12]));
185`inf[2][1] != "r" ! E_RANGE => 1' && (inf[2][1..0] = " ");
186`inf[2][2] != "w" ! E_RANGE => 1' && (inf[2][2..1] = " ");
187this:notify($string_utils:left(tostr($string_utils:left(tostr(pname, oname, " (", inf[1], ") "), 47), inf[2], " "), 54) + $string_utils:abbreviated_value(it.(q), max, depth));
188endif
189endif
190endfor
191if (cant)
192failed = {};
193for k in (cant)
194failed = listappend(failed, tostr(k.name, " (", k, ")"));
195endfor
196this:notify($string_utils:centre(tostr(" no permission to read ", $string_utils:english_list(failed, ", ", " or ", " or "), ". "), 75, "-"));
197else
198this:notify($string_utils:centre(" finished ", 75, "-"));
199endif

@db*size

Spec none none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2"Let 'em @kill it.";
3count = 0;
4for i in [#0..max_object()]
5if ($command_utils:running_out_of_time())
6player:notify(tostr("Counting... [", count, "/", i, "]"));
7suspend(0);
8endif
9if (valid(i))
10count = count + 1;
11endif
12endfor
13player:notify(tostr("There are ", count, " valid objects out of ", toint(max_object()) + 1, " allocated object numbers."));

@gethelp

Spec any any anyFlags rxdOwner #2Definer #58

Referenced by

none

Source

1"@gethelp [<topic>] [from <db or dblist>]";
2"  Prints the raw text of topic from the appropriate help db.";
3"  With no argument, gets the blank (\"\") topic from wherever it lives";
4"  Text is printed as a script for changing this help topic ";
5"  (somewhat like @dump...)";
6if (!prepstr)
7topic = argstr;
8dblist = $code_utils:help_db_list();
9elseif (prepstr != "from")
10player:notify("Usage:  ", verb, " [<topic>] [from <db>]");
11return;
12elseif (!(e = $no_one:eval_d(iobjstr = argstr[$string_utils:word_start(argstr)[(prepstr in args) + 1][1]..$])))
13player:notify(tostr(e));
14return;
15elseif (!e[1])
16player:notify_lines(e[2]);
17return;
18elseif (!(typeof(dblist = e[2]) in {OBJ, LIST}))
19player:notify(tostr(iobjstr, " => ", dblist, " -- not an object or a list"));
20return;
21else
22topic = dobjstr;
23if (typeof(dblist) == OBJ)
24dblist = {dblist};
25endif
26endif
27search = $code_utils:help_db_search(topic, dblist);
28if (!search)
29player:notify("Topic not found.");
30elseif (search[1] == $ambiguous_match)
31player:notify(tostr("Topic `", topic, "' ambiguous:  ", $string_utils:english_list(search[2], "none", " or ")));
32elseif (typeof(text = (db = search[1]):dump_topic(fulltopic = search[2])) == ERR)
33"...ok...shoot me.  This is a -d verb...";
34player:notify(tostr("Cannot retrieve `", fulltopic, "' on ", $code_utils:corify_object(db), ":  ", text));
35else
36player:notify_lines(text);
37endif

@grep @egrep

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (prepstr == "in")
3pattern = dobjstr;
4objlist = player:eval_cmd_string(iobjstr, 0);
5if (!objlist[1])
6player:notify(tostr("Had trouble reading `", iobjstr, "':  "));
7player:notify_lines(@objlist[2]);
8return;
9elseif (typeof(objlist[2]) == OBJ)
10objlist = {objlist[2..2]};
11elseif (typeof(objlist[2]) != LIST)
12player:notify(tostr("Value of `", iobjstr, "' is not an object or list:  ", toliteral(objlist[2])));
13return;
14else
15objlist = objlist[2..2];
16endif
17elseif ((prepstr == "from") && (player.wizard && (n = toint(toobj(iobjstr)))))
18pattern = dobjstr;
19objlist = {n};
20elseif (args && player.wizard)
21pattern = argstr;
22objlist = {};
23else
24player:notify(tostr("Usage:  ", verb, " <pattern> ", player.wizard ? "[in {<objectlist>} | from <number>]" | "in {<objectlist>}"));
25return;
26endif
27player:notify(tostr("Searching for verbs ", @prepstr ? {prepstr, " ", iobjstr, " "} | {}, (verb == "@egrep") ? "matching the pattern " | "containing the string ", toliteral(pattern), " ..."));
28player:notify("");
29$code_utils:((verb == "@egrep") ? "find_verbs_matching" | "find_verbs_containing")(pattern, @objlist);

@s*how

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (dobjstr == "")
3player:notify(tostr("Usage:  ", verb, " <object-or-property-or-verb>"));
4return;
5endif
6if (index(dobjstr, ".") && (spec = $code_utils:parse_propref(dobjstr)))
7if (valid(object = player:my_match_object(spec[1])))
8return $code_utils:show_property(object, spec[2]);
9endif
10elseif (spec = $code_utils:parse_verbref(dobjstr))
11if (valid(object = player:my_match_object(spec[1])))
12return $code_utils:show_verbdef(object, spec[2]);
13endif
14elseif (((dobjstr[1] == "$") && ((pname = dobjstr[2..$]) in properties(#0))) && (typeof(#0.(pname)) == OBJ))
15if (valid(object = #0.(pname)))
16return $code_utils:show_object(object);
17endif
18elseif ((dobjstr[1] == "$") && (spec = $code_utils:parse_propref(dobjstr)))
19return $code_utils:show_property(#0, spec[2]);
20else
21if (valid(object = player:my_match_object(dobjstr)))
22return $code_utils:show_object(object);
23endif
24endif
25$command_utils:object_match_failed(object, dobjstr);

@check-p*roperty

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@check-prop object.property";
2"  checks for descendents defining the given property.";
3set_task_perms(player);
4if (!(spec = $code_utils:parse_propref(dobjstr)))
5player:notify(tostr("Usage:  ", verb, " <object>.<prop-name>"));
6elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
7"...bogus object...";
8elseif (!($perm_utils:controls(player, object) || object.w))
9player:notify("You can't create a property on that object anyway.");
10elseif ($object_utils:has_property(object, prop = spec[2]))
11player:notify("That object already has that property.");
12elseif (olist = $object_utils:descendants_with_property_suspended(object, prop))
13player:notify("The following descendents have this property defined:");
14player:notify("  " + $string_utils:from_list(olist, " "));
15else
16player:notify("No property name conflicts found.");
17endif

set_eval_env

Spec this none thisFlags rxdOwner #36Definer #58

Referenced by

none

Source

1"set_eval_env(string);";
2"Run <string> through eval.  If it doesn't compile, return E_INVARG.  If it crashes, well, it crashes.  If it works okay, set .eval_env to it and set .eval_ticks to the amount of time it took.";
3if (is_player(this) && $perm_utils:controls(caller_perms(), this))
4program = args[1];
5value = $no_one:eval_d((";ticks = ticks_left();" + program) + ";return ticks - ticks_left() - 2;");
6if (!value[1])
7return E_INVARG;
8elseif (typeof(value[2]) == ERR)
9return value[2];
10endif
11try
12ok = this.eval_env = program;
13this.eval_ticks = value[2];
14return 1;
15except error (ANY)
16return error[1];
17endtry
18endif

@clearp*roperty @clprop*erty

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@clearproperty <obj>.<prop>";
2"Set the value of <obj>.<prop> to `clear', making it appear to be the same as the property on its parent.";
3set_task_perms(player);
4if (!(l = $code_utils:parse_propref(dobjstr)))
5player:notify(tostr("Usage:  ", verb, " <object>.<property>"));
6elseif ($command_utils:object_match_failed(dobj = player:my_match_object(l[1]), l[1]))
7"... bogus object...";
8endif
9try
10if (is_clear_property(dobj, prop = l[2]))
11player:notify(tostr("Property ", dobj, ".", prop, " is already clear!"));
12return;
13endif
14clear_property(dobj, prop);
15player:notify(tostr("Property ", dobj, ".", prop, " cleared; value is now ", toliteral(dobj.(prop)), "."));
16except (E_INVARG)
17player:notify(tostr("You can't clear ", dobj, ".", prop, "; none of the ancestors define that property."));
18except error (ANY)
19player:notify(error[2]);
20endtry

@disown @disinherit

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Syntax: @disown <object> [from <object>]";
2"This command is used to remove unwanted children of objects you control. If you control an object, and there is a child of that object you do not want, this command will chparent() the object to its grandparent.";
3if (prepstr)
4if (prepstr != "from")
5player:notify("Usage:  ", verb, " <object> [from <object>]");
6return;
7elseif ($command_utils:object_match_failed(iobj = player:my_match_object(iobjstr), iobjstr))
8"... from WHAT?..";
9return;
10elseif (valid(dobj = $string_utils:literal_object(dobjstr)))
11"... literal object number...";
12if (parent(dobj) != iobj)
13player:notify(tostr(dobj, " is not a child of ", iobj.name, " (", iobj, ")"));
14return;
15endif
16elseif ($command_utils:object_match_failed(dobj = $string_utils:match(dobjstr, children(iobj), "name", children(iobj), "aliases"), dobjstr))
17"... can't match dobjstr against any children of iobj";
18return;
19endif
20elseif ($command_utils:object_match_failed(dobj = player:my_match_object(dobjstr), dobjstr))
21"... can't match dobjstr...";
22return;
23endif
24victim = dobj;
25parent = parent(victim);
26if ($perm_utils:controls(player, victim))
27"... why is he using @disown?... probably by mistake...";
28player:notify(tostr(victim.name, " (", victim, ") is yours.  Use @chparent."));
29elseif (!valid(parent))
30player:notify(tostr(victim.name, " (", victim, ") is already an orphan."));
31elseif (!$perm_utils:controls(player, parent))
32player:notify(tostr(parent.name, " (", parent, "), the parent of ", victim.name, " (", victim, "), is not yours."));
33elseif (!valid(grandparent = parent(parent)))
34"... still not sure about this... do we care?  --Rog...";
35player:notify(tostr(victim.name, " (", victim, ") has no grandparent to take custody."));
36else
37chparent(victim, grandparent);
38player:notify(tostr(victim.name, " (", victim, ")'s parent is now ", grandparent.name, " (", grandparent, ")."));
39endif

eval_cmd_string

Spec this none thisFlags rxdOwner #2Definer #58

Referenced by

none

Source

1":eval_cmd_string(string[,debug])";
2"Evaluates the string the way this player would normally expect to see it evaluated if it were typed on the command line.  debug (defaults to 1) indicates how the debug flag should be set during the evaluation.";
3" => {@eval_result, ticks, seconds}";
4"where eval_result is the result of the actual eval() call.";
5"";
6"For the case where string is an expression, we need to prefix `return ' and append `;' to string before passing it to eval().  However this is not appropriate for statements, where it is assumed an explicit return will be provided somewhere or that the return value is irrelevant.  The code below assumes that string is an expression unless it either begins with a semicolon `;' or one of the MOO language statement keywords.";
7"Next, the substitutions described by this.eval_subs, which should be a list of pairs {string, sub}, are performed on string";
8"Finally, this.eval_env is prefixed to the beginning while this.eval_ticks is subtracted from the eventual tick count.  This allows string to refer to predefined variables like `here' and `me'.";
9set_task_perms(caller_perms());
10{program, ?debug = 1} = args;
11program = program + ";";
12debug = debug ? 33 | 0;
13if (!match(program, "^ *%(;%|%(if%|fork?%|return%|while%|try%)[^a-z0-9A-Z_]%)"))
14program = "return " + program;
15endif
16program = tostr(this.eval_env, ";", $code_utils:substitute(program, this.eval_subs));
17ticks = ((ticks_left() - 48) - this.eval_ticks) + debug;
18seconds = seconds_left();
19value = debug ? eval(program) | $code_utils:eval_d(program);
20seconds = seconds - seconds_left();
21ticks = ticks - ticks_left();
22return {@value, ticks, seconds};

@dump

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@dump something [with/as [id=...] [noprops] [noverbs] [create]]";
2"This spills out all properties and verbs on an object, calling suspend at appropriate intervals.";
3"   id=#nnn -- specifies an idnumber to use in place of the object's actual id (for porting to another MOO)";
4"   noprops -- don't show properties.";
5"   noverbs -- don't show verbs.";
6"   create  -- indicates that a @create command should be generated and all of the verbs be introduced with @verb rather than @args; the default assumption is that the object already exists and you're just doing this to have a look at it.";
7set_task_perms(player);
8dobj = player:my_match_object(dobjstr);
9if ($command_utils:object_match_failed(dobj, dobjstr))
10return;
11endif
12if (prepstr && (!(prepstr in {"with", "as"})))
13player:notify(tostr("Usage:  ", verb, " something [with/as [id=...] [noprops] [noverbs] [create]]"));
14return;
15endif
16targname = tostr(dobj);
17options = {"props", "verbs"};
18create = 0;
19if (iobjstr)
20for o in ($string_utils:explode(iobjstr))
21if (index(o, "id=") == 1)
22targname = o[4..$];
23elseif (o in {"noprops", "noverbs"})
24options = setremove(options, o[3..$]);
25elseif (o in {"create"})
26create = 1;
27if (dobj in $core_objects())
28targname = "";
29for p in (properties(#0))
30targname = `(dobj == #0.(p)) ? "$" + p | "" ! ANY => ""';
31if (targname)
32break;
33endif
34(ticks_left() < 5000) && suspend(0);
35endfor
36else
37targname = (length(parts = $string_utils:words(dobj.name)) < 2) ? dobj.name | parts[$];
38endif
39else
40player:notify(tostr("`", o, "' not understood as valid option."));
41player:notify(tostr("Usage:  ", verb, " something [with [id=...] [noprops] [noverbs] [create]]"));
42return;
43endif
44endfor
45endif
46if (create)
47parent = parent(dobj);
48pstring = tostr(parent);
49for p in (properties(#0))
50if (#0.(p) == parent)
51pstring = "$" + p;
52endif
53endfor
54aliai = setremove(dobj.aliases, dobj.name);
55aliai = setadd(aliai, $string_utils:strip_chars(targname, "$"));
56player:notify(tostr("@create ", pstring, " named ", dobj.name, ":", $string_utils:from_list(aliai, ",")));
57if (targname[1] == "$")
58player:notify(tostr("@corify ", dobj.name, " as ", aliai[$]));
59player:notify("n");
60endif
61player:notify(tostr("@chown ", targname, " to ", dobj.owner));
62dflags = "";
63dflags = dobj.r ? "r" | dflags;
64dflags = dobj.w ? dflags + "w" | dflags;
65dflags = dobj.f ? dflags + "f" | dflags;
66dflags && player:notify(tostr("@chmod ", targname, " ", dflags));
67endif
68for p in (("props" in options) ? `properties(dobj) ! ANY => {}' | {})
69pquoted = toliteral(p);
70try
71info = property_info(dobj, p);
72value = dobj.(p);
73except error (ANY)
74player:notify(tostr("\"", targname, ".(", pquoted, ") => ", toliteral(error[1]), " (", error[2], ")"));
75continue p;
76endtry
77if (create)
78uvalue = (typeof(value) == LIST) ? "{}" | 0;
79player:notify(tostr("@prop ", targname, ".", pquoted, " ", uvalue || toliteral(value), " ", info[2] || "\"\"", tostr(" ", info[1])));
80if (uvalue && value)
81player:notify(tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value)));
82endif
83else
84if (info[2] != "rc")
85player:notify(tostr("@chmod ", targname, ".", pquoted, " ", info[2]));
86endif
87if (info[1] != dobj.owner)
88player:notify(tostr("@chown ", targname, ".", pquoted, " ", info[1]));
89endif
90player:notify(tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value)));
91endif
92(ticks_left() < 5000) && suspend(0);
93endfor
94for a in (("props" in options) ? $object_utils:ancestors(dobj) | {})
95for p in (`properties(a) ! ANY => {}')
96(ticks_left() < 5000) && suspend(1);
97pquoted = toliteral(p);
98try
99value = dobj.(p);
100except error (ANY)
101player:notify(tostr("\"", targname, ".(", pquoted, ") => ", toliteral(error[1]), " (", error[2], ")"));
102continue p;
103endtry
104avalue = `a.(p) ! ANY';
105if ((typeof(avalue) == ERR) || (value != avalue))
106if ((!create) || (!(p in {"aliases", "object_size"})))
107player:notify(tostr(";;", targname, ".(", pquoted, ") = ", toliteral(value)));
108endif
109endif
110endfor
111(ticks_left() < 5000) && suspend(1);
112endfor
113if (!("verbs" in options))
114player:notify("\"***finished***");
115return;
116endif
117player:notify("");
118v = 1;
119while ((info = `verb_info(dobj, v) ! ANY') || (info == E_PERM))
120if (`index(info[3], "(old)") ! ANY' && 0)
121"Thought about skipping (old) verbs...";
122player:tell("Skipping ", dobj, ":\"", info[3], "\"...");
123else
124suspend(1);
125if (typeof(info) == ERR)
126player:notify(tostr("\"", dobj, ":", v, " --- ", info, "\";"));
127else
128if (i = index(vname = info[3], " "))
129vname = vname[1..i - 1];
130endif
131if (vname[1] != "*")
132vname = strsub(vname, "*", "");
133endif
134args = verb_args(dobj, v);
135prep = (args[2] in {"any", "none"}) ? args[2] | $code_utils:short_prep(args[2]);
136perms = (info[2] != ((args == {"this", "none", "this"}) ? "rxd" | "rd")) ? info[2] || "\"\"" | "";
137if (create)
138tail = tostr(" ", perms || info[2], " ", info[1]);
139player:notify(tostr("@verb ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3], tail));
140else
141player:notify(tostr("@args ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3]));
142if (info[1] != dobj.owner)
143player:notify(tostr("@chown ", targname, ":", vname, " to ", info[1]));
144endif
145if (perms)
146player:notify(tostr("@chmod ", targname, ":", vname, " ", perms));
147endif
148endif
149if (code = verb_code(dobj, v, 1, 1))
150player:notify(tostr("@program ", targname, ":", vname));
151for c in (code)
152player:notify(c);
153(ticks_left() < 5000) && suspend(0);
154endfor
155player:notify_lines({".", ""});
156endif
157endif
158endif
159if (`index(tostr(" ", info[3], " "), " * ") ! ANY')
160"... we have a * verb.  may as well forget trying to list...";
161"... the rest; they're invisible.  set v to something nonstring.";
162v = E_TYPE;
163else
164v = v + 1;
165endif
166(ticks_left() < 5000) && suspend(0);
167endwhile
168player:notify("\"***finished***");

#*

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Copied from Player Class hacked with eval that does substitutions and assorted stuff (#8855):# by Geust (#24442) Sun May  9 20:19:05 1993 PDT";
2"#<string>[.<property>|.parent] [exit|player|inventory] [for <code>] returns information about the object (we'll call it <thing>) named by string.  String is matched in the current room unless one of exit|player|inventory is given.";
3"If neither .<property>|.parent nor <code> is specified, just return <thing>.";
4"If .<property> is named, return <thing>.<property>.  .parent returns parent(<thing>).";
5"If <code> is given, it is evaluated, with the value returned by the first part being substituted for %# in <code>.";
6"For example, the command";
7"  #JoeFeedback.parent player for toint(%#)";
8"will return 26026 (unless Joe has chparented since writing this).";
9set_task_perms(player);
10if (!(whatstr = verb[2..dot = min(index(verb + ".", "."), index(verb + ":", ":")) - 1]))
11player:notify("Usage:  #string [exit|player|inventory]");
12return;
13elseif (!args)
14what = player:my_match_object(whatstr);
15elseif (index("exits", args[1]) == 1)
16what = player.location:match_exit(whatstr);
17elseif (index("inventory", args[1]) == 1)
18what = player:match(whatstr);
19elseif (index("players", args[1]) == 1)
20what = $string_utils:match_player(whatstr);
21if ($command_utils:player_match_failed(what, whatstr))
22return;
23endif
24else
25what = player:my_match_object(whatstr);
26endif
27if ((!valid(what)) && match(whatstr, "^[0-9]+$"))
28what = toobj(whatstr);
29endif
30if ($command_utils:object_match_failed(what, whatstr))
31return;
32endif
33while (index(verb, ".parent") == (dot + 1))
34what = parent(what);
35dot = dot + 7;
36endwhile
37if (dot >= length(verb))
38val = what;
39elseif ((value = $code_utils:eval_d(tostr("return ", what, verb[dot + 1..$], ";")))[1])
40val = value[2];
41else
42player:notify_lines(value[2]);
43return;
44endif
45if (prepstr)
46program = strsub(iobjstr + ";", "%#", toliteral(val));
47end = 1;
48"while (\"A\" <= (l = argstr[end]) && l <= \"Z\")";
49while (("A" <= (l = program[end])) && (l <= "Z"))
50end = end + 1;
51endwhile
52if ((program[1] == ";") || (program[1..end - 1] in {"if", "for", "fork", "return", "while", "try"}))
53program = $code_utils:substitute(program, this.eval_subs);
54else
55program = $code_utils:substitute("return " + program, this.eval_subs);
56endif
57if ((value = eval(program))[1])
58player:notify(this:eval_value_to_string(value[2]));
59else
60player:notify_lines(value[2]);
61nerrors = length(value[2]);
62player:notify(tostr(nerrors, " error", (nerrors == 1) ? "." | "s."));
63endif
64else
65player:notify(this:eval_value_to_string(val));
66endif

eval_value_to_string

Spec this none thisFlags rxdOwner #2Definer #58

Referenced by

Source

1set_task_perms(caller_perms());
2if (typeof(val = args[1]) == OBJ)
3return tostr("=> ", val, "  ", valid(val) ? ("(" + val.name) + ")" | ((a = $list_utils:assoc(val, {{#-1, "<$nothing>"}, {#-2, "<$ambiguous_match>"}, {#-3, "<$failed_match>"}})) ? a[2] | "<invalid>"));
4elseif (typeof(val) == ERR)
5return tostr("=> ", toliteral(val), "  (", val, ")");
6else
7return tostr("=> ", toliteral(val));
8endif

@progo*ptions @prog-o*ptions @programmero*ptions @programmer-o*ptions

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@<what>-option <option> [is] <value>   sets <option> to <value>";
2"@<what>-option <option>=<value>        sets <option> to <value>";
3"@<what>-option +<option>     sets <option>   (usually equiv. to <option>=1";
4"@<what>-option -<option>     resets <option> (equiv. to <option>=0)";
5"@<what>-option !<option>     resets <option> (equiv. to <option>=0)";
6"@<what>-option <option>      displays value of <option>";
7set_task_perms(player);
8what = "prog";
9options = what + "_options";
10option_pkg = #0.(options);
11set_option = ("set_" + what) + "_option";
12if (!args)
13player:notify_lines({("Current " + what) + " options:", "", @option_pkg:show(this.(options), option_pkg.names)});
14return;
15elseif (typeof(presult = option_pkg:parse(args)) == STR)
16player:notify(presult);
17return;
18else
19if (length(presult) > 1)
20if (typeof(sresult = this:(set_option)(@presult)) == STR)
21player:notify(sresult);
22return;
23elseif (!sresult)
24player:notify("No change.");
25return;
26endif
27endif
28player:notify_lines(option_pkg:show(this.(options), presult[1]));
29endif

prog_option

Spec this none thisFlags rxdOwner #2Definer #58

Referenced by

none

Source

1":prog_option(name)";
2"Returns the value of the specified prog option";
3if ((caller == this) || $perm_utils:controls(caller_perms(), this))
4return $prog_options:get(this.prog_options, args[1]);
5else
6return E_PERM;
7endif

set_prog_option

Spec this none thisFlags rxdOwner #2Definer #58

Referenced by

none

Source

1":set_prog_option(oname,value)";
2"Changes the value of the named option.";
3"Returns a string error if something goes wrong.";
4if (!((caller == this) || $perm_utils:controls(caller_perms(), this)))
5return tostr(E_PERM);
6endif
7"...this is kludgy, but it saves me from writing the same verb 3 times.";
8"...there's got to be a better way to do this...";
9verb[1..4] = "";
10foo_options = verb + "s";
11"...";
12if (typeof(s = #0.(foo_options):set(this.(foo_options), @args)) == STR)
13return s;
14elseif (s == this.(foo_options))
15return 0;
16else
17this.(foo_options) = s;
18return 1;
19endif

@list*#

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@list <obj>:<verb> [<dobj> <prep> <iobj>] [with[out] paren|num] [all] [ranges]";
2set_task_perms(player);
3bynumber = verb == "@list#";
4pflag = player:prog_option("list_all_parens");
5nflag = !player:prog_option("list_no_numbers");
6aflag = 0;
7argspec = {};
8range = {};
9spec = args ? $code_utils:parse_verbref(args[1]) | E_INVARG;
10args = spec ? listdelete(args, 1) | E_INVARG;
11while (args)
12if (args[1] && ((index("without", args[1]) == 1) || (args[1] == "wo")))
13"...w,wi,wit,with => 1; wo,witho,withou,without => 0...";
14fval = !index(args[1], "o");
15if (index("parentheses", args[2]) == 1)
16pflag = fval;
17args[1..2] = {};
18elseif (index("numbers", args[2]) == 1)
19nflag = fval;
20args[1..2] = {};
21else
22player:notify(tostr(args[1], " WHAT?"));
23args = E_INVARG;
24endif
25elseif (index("all", args[1]) == 1)
26if (bynumber)
27player:notify("Don't use `all' with @list#.");
28args = E_INVARG;
29else
30aflag = 1;
31args[1..1] = {};
32endif
33elseif (index("0123456789", args[1][1]) || (index(args[1], "..") == 1))
34if (E_INVARG == (s = $seq_utils:from_string(args[1])))
35player:notify(tostr("Garbled range:  ", args[1]));
36args = E_INVARG;
37else
38range = $seq_utils:union(range, s);
39args = listdelete(args, 1);
40endif
41elseif (bynumber)
42player:notify("Don't give args with @list#.");
43args = E_INVARG;
44elseif (argspec)
45"... second argspec?  Not likely ...";
46player:notify(tostr(args[1], " unexpected."));
47args = E_INVARG;
48elseif (typeof(pas = $code_utils:parse_argspec(@args)) == LIST)
49argspec = pas[1];
50argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2];
51args = pas[2];
52else
53"... argspec is bogus ...";
54player:notify(tostr(pas));
55args = E_INVARG;
56endif
57endwhile
58if (args == E_INVARG)
59if (bynumber)
60player:notify(tostr("Usage:  ", verb, " <object>:<verbnumber> [with|without parentheses|numbers] [ranges]"));
61else
62player:notify(tostr("Usage:  ", verb, " <object>:<verb> [<dobj> <prep> <iobj>] [with|without parentheses|numbers] [all] [ranges]"));
63endif
64return;
65elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1]))
66return;
67endif
68shown_one = 0;
69for what in ({object, @$object_utils:ancestors(object)})
70if (bynumber)
71vname = $code_utils:toint(spec[2]);
72if (vname == E_TYPE)
73return player:notify("Verb number expected.");
74elseif ((vname < 1) || `vname > length(verbs(what)) ! E_PERM => 0')
75return player:notify("Verb number out of range.");
76endif
77code = `verb_code(what, vname, pflag) ! ANY';
78elseif (argspec)
79vnum = $code_utils:find_verb_named(what, spec[2]);
80while (vnum && (`verb_args(what, vnum) ! ANY' != argspec))
81vnum = $code_utils:find_verb_named(what, spec[2], vnum + 1);
82endwhile
83vname = vnum;
84code = (!vnum) ? E_VERBNF | `verb_code(what, vnum, pflag) ! ANY';
85else
86vname = spec[2];
87code = `verb_code(what, vname, pflag) ! ANY';
88endif
89if (code != E_VERBNF)
90if (shown_one)
91player:notify("");
92elseif (what != object)
93player:notify(tostr("Object ", object, " does not define that verb", argspec ? " with those args" | "", ", but its ancestor ", what, " does."));
94endif
95if (typeof(code) == ERR)
96player:notify(tostr(what, ":", vname, " -- ", code));
97else
98info = verb_info(what, vname);
99vargs = verb_args(what, vname);
100fullname = info[3];
101if (index(fullname, " "))
102fullname = toliteral(fullname);
103endif
104if (index(vargs[2], "/"))
105vargs[2] = tostr("(", vargs[2], ")");
106endif
107$ansi_utils:add_noansi();
108player:notify(tostr("@verb ", what, ":", fullname, " ", $string_utils:from_list(vargs, " "), " ", info[2], " ", info[1]));
109player:notify(tostr("@prog ", what, ":", vname));
110if (code == {})
111player:notify("(That verb has not been programmed.)");
112else
113lineseq = {1, length(code) + 1};
114range && (lineseq = $seq_utils:intersection(range, lineseq));
115if (!lineseq)
116player:notify("(No lines in that range.)");
117endif
118for k in [1..length(lineseq) / 2]
119for i in [lineseq[(2 * k) - 1]..lineseq[2 * k] - 1]
120if (nflag)
121player:notify(tostr(" "[1..i < 10], i, ":  ", code[i]));
122else
123player:notify(code[i]);
124endif
125(ticks_left() < 4000) && suspend(0);
126endfor
127endfor
128player:notify(".");
129endif
130endif
131shown_one = 1;
132endif
133if (shown_one && (!aflag))
134return;
135endif
136(ticks_left() < 4400) && suspend(0);
137endfor
138if (!shown_one)
139player:notify(tostr("That object does not define that verb", argspec ? " with those args." | "."));
140endif

set_eval_subs

Spec none none noneFlags rxdOwner #2Definer #58

Referenced by

none

Source

1"Copied from Player Class hacked with eval that does substitutions and assorted stuff (#8855):set_eval_subs by Geust (#24442) Fri Aug  5 13:18:59 1994 PDT";
2if (!$perm_utils:controls(caller_perms(), this))
3return E_PERM;
4elseif (typeof(subs = args[1]) != LIST)
5return E_TYPE;
6else
7for pair in (subs)
8if (((length(pair) != 2) || typeof(pair[1] != STR)) || typeof(pair[2] != STR))
9return E_INVARG;
10endif
11endfor
12endif
13return `this.eval_subs = subs ! ANY';

@verbs*

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1set_task_perms(player);
2if (!dobjstr)
3try
4if ((verb[7] != "(") && (verb[$] != ")"))
5player:tell("Usage:  @verbs <object>");
6return;
7else
8dobjstr = verb[8..$ - 1];
9endif
10except (E_RANGE)
11return player:tell("Usage:  @verbs <object>");
12endtry
13endif
14thing = player:my_match_object(dobjstr);
15if (!$command_utils:object_match_failed(thing, dobjstr))
16verbs = {};
17i = 1;
18while ((info = `verb_info(thing, i) ! ANY') != E_VERBNF)
19verbs = {@verbs, info ? info[3] | E_PERM};
20i = i + 1;
21endwhile
22player:tell(";verbs(", thing, ") => ", toliteral(verbs));
23endif

@forked-v*erbose

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"Syntax:  @forked-v*erbose [player]";
2"         @forked-v*erbose all wizards";
3"";
4"For a normal player, shows all the tasks you have waiting in your queue, especially those forked or suspended. A wizard will see all the tasks of all the players unless the optional argument is provided. For a task which has suspended, and not a fresh fork, shows the full callers() stack.";
5"The second form is only usable by wizards and provides an output of all tasks owned by characters who are .wizard=1. Useful to find a task that may get put in a random queue due to $wiz_utils:random_wizard. Or even finding verbs that run with wizard permissions that shouldn't be.";
6set_task_perms(player);
7if (!dobjstr)
8tasks = queued_tasks();
9elseif ((dobjstr == "all wizards") && player.wizard)
10tasks = {};
11for t in (queued_tasks())
12if (t[5].wizard)
13tasks = {@tasks, t};
14endif
15$command_utils:suspend_if_needed(1);
16endfor
17elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr), dobjstr)[1])
18return;
19elseif (typeof(tasks = $wiz_utils:queued_tasks(dobj)) != LIST)
20player:notify(tostr(verb, " ", dobj.name, "(", dobj, "):  ", tasks));
21return;
22endif
23if (tasks)
24su = $string_utils;
25player:notify("Queue ID    Start Time            Owner         Verb (Line) [This]");
26player:notify("--------    ----------            -----         -----------------");
27now = time();
28for task in (tasks)
29$command_utils:suspend_if_needed(0);
30{q_id, start, nu, nu2, owner, vloc, vname, lineno, this} = task;
31time = (start >= now) ? ctime(start)[5..24] | su:left((start == -1) ? "Reading input ..." | tostr(now - start, " seconds ago..."), 20);
32owner_name = valid(owner) ? owner.name | tostr("Dead ", owner);
33player:notify(tostr(su:left(tostr(q_id), 10), "  ", time, "  ", su:left(owner_name, 12), "  ", vloc, ":", vname, " (", lineno, ")", (this != vloc) ? tostr(" [", this, "]") | ""));
34if (stack = `task_stack(q_id, 1) ! E_INVARG => 0')
35for frame in (listdelete(stack, 1))
36{sthis, svname, sprogger, svloc, splayer, slineno} = frame;
37player:notify(tostr("                    Called By...  ", su:left(valid(sprogger) ? sprogger.name | tostr("Dead ", sprogger), 12), "  ", svloc, ":", svname, (sthis != svloc) ? tostr(" [", sthis, "]") | "", " (", slineno, ")"));
38endfor
39endif
40endfor
41player:notify("-----------------------------------------------------------------");
42else
43player:notify("No tasks.");
44endif

@properties* @props*

Spec any none noneFlags rOwner #2Definer #58

Referenced by

none

Source

1"Usage:  @props <object>";
2"This commands returns a list of the properties on the specified object. It will sub in an E_PERM for any unreadable properties. Requires wizperms and must be !d.";
3x = this:my_match_object(dobjstr);
4if (!$command_utils:object_match_failed(x, dobjstr))
5p = properties(x);
6set_task_perms(player);
7np = {};
8for prop in (p)
9np = {@np, (typeof(x.(prop)) != ERR) ? prop | E_PERM};
10endfor
11this:notify(tostr(";properties(", x, ") => ", $string_utils:print(np)));
12endif

@greprop*s @grepprop*s

Spec any any anyFlags rdOwner #2Definer #58

Referenced by

none

Source

1"@greprops <dobjstr> [from/to/for obj]=> Reports instances of dobjstr in all readble props on the MOO.";
2"'From obj' sets a starting object.";
3"'To obj' sets an ending object.";
4"'For person' will search in person.owned_objects for dobjstr.";
5exclude = $command_utils.feature_task;
6set_task_perms(player);
7if (!dobjstr)
8return this:tell("Usage:  @greprops <object> [from/to/for obj]");
9endif
10if (prepstr == "for")
11iobj = valid(iobj) ? iobj | $string_utils:match_player(iobjstr);
12if (!`!(!property_info(iobj, "owned_objects")) ! ANY => 0')
13return player:tell("That's not a valid player.");
14else
15max = length(iobj.owned_objects);
16start = max ? 1 | 0;
17endif
18else
19max = (prepstr == "to") ? tonum(toobj(iobjstr)) | tonum(max_object());
20start = (prepstr == "from") ? tonum(toobj(iobjstr)) | 0;
21endif
22found = 0;
23player:tell("This could take a long time. If you need to stop this, ;kill_task(", task_id(), ")  You have 10 seconds to copy this eval before the search begins.");
24suspend(10);
25for i in [start..max]
26object = mom = (prepstr == "for") ? iobj.owned_objects[i] | toobj(i);
27props = {};
28while (valid(mom))
29(seconds_left() < 5) && suspend(0);
30momprops = `properties(mom) ! E_PERM => {}';
31nextmom = parent(mom);
32for mp in (momprops)
33(ticks_left() < 8000) && suspend(0);
34if (`mom.(mp) != nextmom.(mp) ! ANY => 1')
35props = setadd(props, mp);
36endif
37endfor
38mom = nextmom;
39endwhile
40for p in (props)
41(((ticks_left() < 6000) && (!suspend(0))) && (random(2) - 1)) && player:tell("...", object);
42if (dobjstr == p)
43player:tell("   ", object, ".", p, "    <<<< ", dobjstr);
44found = found + 1;
45endif
46contents = `toliteral(object.(p)) ! E_PERM => ""';
47if ((cl = length(contents)) >= (dl = length(dobjstr)))
48for j in [1..(1 + cl) - dl]
49(ticks_left() < 4000) && suspend(0);
50if ((dobjstr == contents[j..(j + dl) - 1]) && (object.(p) != exclude))
51player:tell("   ", object, ".", p, "    <<<< ", dobjstr);
52found = found + 1;
53break;
54endif
55endfor
56endif
57endfor
58(ticks_left() < 10000) && suspend(0);
59endfor
60player:tell("__________");
61player:tell(found, " total");

@core

Spec any none noneFlags rdOwner #2Definer #58

Referenced by

none

Source

1"USAGE: @core => lists all corified objects";
2"       @core <object> => tells if the object is listed on the core";
3"       @core check => tells if objects listed on the core have 'init_for_core' verbs";
4if (dobjstr && (dobjstr != "check"))
5if (valid(o = $string_utils:literal_object(dobjstr)))
6for p in (properties(#0))
7if (o == #0.(p))
8return player:tell((("$" + p) + " => ") + $string_utils:nn(o));
9endif
10(ticks_left() < 2000) && suspend(0);
11endfor
12endif
13player:tell("That is not a core object.");
14if (ps = `properties($local) ! ANY')
15for p in (ps)
16if (o == $local.(p))
17return player:tell((("$local." + p) + " => ") + $string_utils:nn(o));
18endif
19(ticks_left() < 2000) && suspend(0);
20endfor
21endif
22return player:tell("That is not a local object.");
23endif
24all = {};
25player:tell("Compiling the list...");
26if (dobjstr == "check")
27for o in ($core_objects())
28all = (!$object_utils:has_callable_verb(o, "init_for_core")) ? {@all, o} | all;
29endfor
30return player:tell("Needs an 'init_for_core' verb: ", $string_utils:nn(all));
31endif
32for p in (properties(#0))
33all = {@all, (("$" + p) + " => ") + `$string_utils:nn(#0.(p)) ! E_TYPE => toliteral(#0.(p))'};
34(ticks_left() < 2000) && suspend(0);
35endfor
36if (ps = `properties($local) ! ANY')
37all = {@all, "LOCAL REFERENCES:"};
38for p in (ps)
39all = {@all, (("   " + p) + " => ") + `$string_utils:nn($local.(p)) ! E_TYPE => toliteral($local.(p))'};
40(ticks_left() < 2000) && suspend(0);
41endfor
42endif
43suspend(0);
44player:tell_lines_suspended(all);

@setl*earn @setk*nowledge

Spec any none noneFlags rxdOwner #2Definer #58

Referenced by

none

Source

1"Usage: @setlearn <object>";
2target = $string_utils:match_object(dobjstr, $nothing);
3if ((parent(player) == $rpgamer) && (player != this))
4player:tell("You cannot set game knowledge.");
5return;
6elseif (target == $failed_match)
7player:tell("Usage: @setlearn <object>");
8player:tell("");
9player:tell("Prompts for the text to be copied to <object>.learn for use by Knowledge spells.");
10return;
11elseif (!valid(target))
12player:tell("Invalid object.");
13return;
14elseif (!$object_utils:has_property(target, "learn"))
15player:tell("'", dobjstr, "' does not have a .learn property.");
16return;
17else
18addknowledge = $command_utils:read_lines();
19target.learn = addknowledge;
20player:tell("You write the knowledge for ", target, " (", target.name, ").");
21endif

@seek*nowledge

Spec any none noneFlags rxdOwner #2Definer #58

Referenced by

none

Source

1"Usage: @seek*nowledge <object>";
2match = $string_utils:match_object(dobjstr, $nothing);
3if ((parent(player) == $rpgamer) && (player != this))
4player:tell("You must be at least a programmer to use this command.");
5return;
6elseif (match == $failed_match)
7player:tell("Usage: @seek*nowledge <object>");
8player:tell("");
9player:tell("Shows the knowledge (as set for Knowledge spells) for <object>.");
10player:tell("This information is copied from the scripting files.");
11player:tell("Use @setlearn <object> to add or change the knowledge for <object>.");
12return;
13elseif (!valid(match))
14player:tell("Invalid object.");
15return;
16elseif (!$object_utils:has_property(match, "learn"))
17player:tell("'", tostr(match), "' does not have a learn property.");
18return;
19else
20player:tell("[purple]You read the knowledge for ", match, " (", match.name, ")", "[purple]...[normal]");
21player:tell("");
22for x in (match.learn)
23player:tell("[cyan]", x, "[normal]");
24endfor
25player:tell("");
26player:tell("[purple]You finish reading.[normal]");
27endif

@monscr

Spec any any anyFlags rxdOwner #2Definer #58

Referenced by

none

Source

1if (!player.programmer)
2return $command_utils:do_huh();
3endif
4if (!dobjstr)
5return player:tell("You must specify an object.");
6endif
7target = $object_utils:match_object(dobjstr, $nothing);
8if (!$object_utils:has_property(target, "hostility"))
9return player:tell("The object must be a monster.");
10endif
11if (target == $failed_match)
12return player:tell("\"", dobjstr, "\" could not be matched to anything..");
13elseif (target == $ambiguous_match)
14return player:tell("Ambiguous object match.");
15endif
16"End of error handlers.";
17if (!iobjstr)
18n = target.name;
19else
20n = iobjstr;
21endif
22mname = target.name;
23dsc = toliteral(target.description);
24sts = toliteral(target.stats);
25com = toliteral(target.skills);
26exp = tostr(target.exp);
27hom = toliteral(target.home);
28rot = tostr(target.rot_time);
29ges = tostr(target.gestate);
30wts = tostr(target.wait_seconds);
31bir = toliteral(target.birth_msg);
32dth = toliteral(target.death_msg);
33grd = tostr(target.greedy);
34edi = tostr(target.edible);
35eth = tostr(target.eat_heal);
36ndf = tostr(target.natural_def);
37imm = tostr(target.magic_immunity);
38hst = tostr(target.hostility);
39wpt = toliteral(target.weapon_types);
40wnd = tostr(target.wander_ok);
41stm = toliteral(target.startmoney);
42mon = toliteral(target.money);
43player:tell();
44player:tell("@create $monster named ", mname);
45player:tell("@desc ", n, " as ", dsc);
46player:tell("@set ", n, ".stats to ", sts);
47player:tell("@set ", n, ".stats_current to ", sts);
48player:tell("@set ", n, ".skills to ", com);
49player:tell("@set ", n, ".exp to ", exp);
50player:tell("@set ", n, ".home to ", hom);
51player:tell("@set ", n, ".rot_time to ", rot);
52player:tell("@set ", n, ".gestate to ", ges);
53player:tell("@set ", n, ".wait_seconds to ", wts);
54player:tell("@set ", n, ".birth_msg to ", bir);
55player:tell("@set ", n, ".death_msg to ", dth);
56player:tell("@set ", n, ".greedy to ", grd);
57player:tell("@set ", n, ".edible to ", edi);
58player:tell("@set ", n, ".eat_heal to ", eth);
59player:tell("@set ", n, ".natural_def to ", ndf);
60player:tell("@set ", n, ".magic_immunity to ", imm);
61player:tell("@set ", n, ".hostility to ", hst);
62player:tell("@set ", n, ".weapon_types to ", wpt);
63player:tell("@set ", n, ".wander_ok to ", wnd);
64player:tell("@set ", n, ".startmoney to ", stm);
65player:tell("@set ", n, ".money to ", mon);
66player:tell("@chmod ", n, " rf");
67player:tell();
68player:tell("(End of autoscript for ", toobj(target), ".)");

@scr*ipt

Spec any any anyFlags rxdOwner #2Definer #58

Referenced by

none

Source

1if (!player.programmer)
2return $command_utils:do_huh();
3endif
4if (!dobjstr)
5return player:tell("You must specify an object.");
6endif
7target = $object_utils:match_object(dobjstr, $nothing);
8if (!valid(target))
9return player:tell("Invalid target.");
10endif
11if (!iobjstr)
12n = $string_utils:lowercase($string_utils:first_word(target.name)[1]);
13else
14n = iobjstr;
15endif
16if (parent(target) == $monster)
17mname = target.name;
18dsc = tostr(target.description);
19stt = tostr(target.stats[2][1]);
20dex = tostr(target.stats[2][2]);
21itl = tostr(target.stats[2][3]);
22hea = tostr(target.stats[2][4]);
23com = tostr(target.skills[2][1]);
24exp = tostr(target.exp);
25hom = toliteral(target.home);
26rot = tostr(target.rot_time);
27ges = tostr(target.gestate);
28wts = tostr(target.wait_seconds);
29bir = toliteral(target.birth_msg);
30dth = toliteral(target.death_msg);
31grd = tostr(target.greedy);
32edi = tostr(target.edible);
33eth = tostr(target.eat_heal);
34ndf = tostr(target.natural_def);
35imm = tostr(target.magic_immunity);
36hst = tostr(target.hostility);
37wpt = toliteral(target.weapon_types);
38wnd = tostr(target.wander_ok);
39stm = toliteral(target.startmoney);
40mon = toliteral(target.money);
41player:tell();
42player:tell("@create $monster named ", mname);
43player:tell("@desc ", n, " as ", dsc);
44player:tell("@str ", n, " is ", stt);
45player:tell("@dex ", n, " is ", dex);
46player:tell("@int ", n, " is ", itl);
47player:tell("@hea ", n, " is ", hea);
48player:tell("@com ", n, " is ", com);
49player:tell("@set ", n, ".exp to ", exp);
50player:tell("@set ", n, ".home to ", hom);
51player:tell("@set ", n, ".rot_time to ", rot);
52player:tell("@set ", n, ".gestate to ", ges);
53player:tell("@set ", n, ".wait_seconds to ", wts);
54player:tell("@set ", n, ".birth_msg to ", bir);
55player:tell("@set ", n, ".death_msg to ", dth);
56player:tell("@set ", n, ".greedy to ", grd);
57player:tell("@set ", n, ".edible to ", edi);
58player:tell("@set ", n, ".eat_heal to ", eth);
59player:tell("@set ", n, ".natural_def to ", ndf);
60player:tell("@set ", n, ".magic_immunity to ", imm);
61player:tell("@set ", n, ".hostility to ", hst);
62player:tell("@set ", n, ".weapon_types to ", wpt);
63player:tell("@set ", n, ".wander_ok to ", wnd);
64player:tell("@set ", n, ".startmoney to ", stm);
65player:tell("@set ", n, ".money to ", mon);
66player:tell("@chmod ", n, " rf");
67player:tell();
68player:tell("(End of autoscript for ", toobj(target), ".)");
69elseif (parent(target) == $weapon)
70wname = target.name;
71desc = toliteral(target.description);
72if (!target.shoots)
73usv = toliteral(target.usage_verbage);
74usvstr = "usage_verbage";
75else
76usv = toliteral(target.shoot_verbage);
77usvstr = "shoot_verbage";
78endif
79stn = tostr(target.can_stun);
80par = tostr(target.can_paralyse);
81if (!target.shoots)
82dam = tostr(target.damage_base);
83damstr = "damage_base";
84else
85dam = tostr(target.projectile_dam);
86damstr = "projectile_dam";
87endif
88val = tostr(target.value_base);
89player:tell();
90player:tell("@create $weapon named ", wname);
91player:tell("@desc ", n, " as ", desc);
92player:tell("@set ", n, ".shoots to ", tostr(target.shoots));
93if (target.shoots)
94player:tell("@set ", n, ".ammo_type to ", toliteral(target.ammo_type));
95endif
96player:tell("@set ", n, ".", usvstr, " to ", usv);
97player:tell("@set ", n, ".can_stun to ", stn);
98player:tell("@set ", n, ".can_paralyse to ", par);
99player:tell("@set ", n, ".", damstr, " to ", dam);
100player:tell("@set ", n, ".value_base to ", val);
101if (target.shoots)
102player:tell("@set ", n, ".max_load to ", tostr(target.max_load));
103endif
104player:tell("@chmod ", n, " rf");
105player:tell();
106player:tell("(End of autoscript for ", toobj(target), ".)");
107elseif (parent(target) == $clothing)
108aname = target.name;
109desc = toliteral(target.description);
110arm = tostr(target.armor);
111cur = tostr(target.cursed);
112bda = toliteral(target.body_area);
113val = tostr(target.value_base);
114player:tell();
115player:tell("@create $clothing named ", aname);
116player:tell("@desc ", n, " as ", desc);
117player:tell("@set ", n, ".armor to ", arm);
118player:tell("@set ", n, ".cursed to ", cur);
119player:tell("@set ", n, ".body_area to ", bda);
120player:tell("@set ", n, ".value_base to ", val);
121player:tell("@chmod ", n, " rf");
122player:tell();
123player:tell("(End of autoscript for ", toobj(target), ".)");
124else
125return player:tell("Parent of argument must be $monster, $weapon, or $clothing.");
126endif

&*

Spec any any anyFlags rxdOwner #2Definer #58

Referenced by

none

Source

1if (!argstr)
2return player:tell("You must provide a name for the new location.");
3endif
4px = {};
5for i in (player.location.exits)
6px = setadd(px, i.aliases[$]);
7endfor
8if ((verb == "&n") || (verb == "&north"))
9if ("n" in px)
10return player:tell("A north exit from this location already exists. Execution stopped.");
11endif
12player:tell("Creating a room called '", argstr, "' to the north.");
13force_input(player, tostr("@dig \"North [n],north,n|South [s],south,s\" to ", argstr));
14elseif ((verb == "&s") || (verb == "&south"))
15if ("s" in px)
16return player:tell("A south exit from this location already exists. Execution stopped.");
17endif
18player:tell("Creating a room called '", argstr, "' to the south.");
19force_input(player, tostr("@dig \"South [s],south,s|North [n],north,n\" to ", argstr));
20elseif ((verb == "&e") || (verb == "&east"))
21if ("e" in px)
22return player:tell("An east exit from this location already exists. Execution stopped.");
23endif
24player:tell("Creating a room called '", argstr, "' to the east.");
25force_input(player, tostr("@dig \"East [e],east,e|West [w],west,w\" to ", argstr));
26elseif ((verb == "&w") || (verb == "&west"))
27if ("w" in px)
28return player:tell("A west exit from this location already exists. Execution stopped.");
29endif
30player:tell("Creating a room called '", argstr, "' to the west.");
31force_input(player, tostr("@dig \"West [w],west,w|East [e],east,e\" to ", argstr));
32elseif ((verb == "&ne") || (verb == "&northeast"))
33if ("ne" in px)
34return player:tell("A northeast exit from this location already exists. Execution stopped.");
35endif
36player:tell("Creating a room called '", argstr, "' to the northeast.");
37force_input(player, tostr("@dig \"Northeast [ne],northeast,ne|Southwest [sw],southwest,sw\" to ", argstr));
38elseif ((verb == "&nw") || (verb == "&northwest"))
39if ("nw" in px)
40return player:tell("A northwest exit from this location already exists. Execution stopped.");
41endif
42player:tell("Creating a room called '", argstr, "' to the northwest.");
43force_input(player, tostr("@dig \"Northwest [nw],northwest,nw|Southeast [se],southeast,se\" to ", argstr));
44elseif ((verb == "&se") || (verb == "southeast"))
45if ("se" in px)
46return player:tell("A southeast exit from this location already exists. Execution stopped.");
47endif
48player:tell("Creating a room called '", argstr, "' to the southeast.");
49force_input(player, tostr("@dig \"Southeast [se],southeast,se|Northwest [nw],northwest,nw\" to ", argstr));
50elseif ((verb == "&sw") || (verb == "&southwest"))
51if ("sw" in px)
52return player:tell("A southwest exit from this location already exists. Execution stopped.");
53endif
54player:tell("Creating a room called '", argstr, "' to the southwest.");
55force_input(player, tostr("@dig \"Southwest [sw],southwest,sw|Northeast [ne],northeast,ne\" to ", argstr));
56elseif ((verb == "&u") || (verb == "&up"))
57if ("u" in px)
58return player:tell("An exit leading up from this location already exists. Execution stopped.");
59endif
60player:tell("Creating a room called '", argstr, "' going up.");
61force_input(player, tostr("@dig \"Up [u],up,u|Down [d],down,d\" to ", argstr));
62elseif ((verb == "&d") || (verb == "&down"))
63if ("d" in px)
64return player:tell("An exit leading down from this location already exists. Execution stopped.");
65endif
66player:tell("Creating a room called '", argstr, "' going down.");
67force_input(player, tostr("@dig \"Down [d],down,d|Up [u],up,u\" to ", argstr));
68else
69return player:tell("Direction '", verb[2..$], "' unsupported.");
70endif

%*

Spec any none noneFlags rxdOwner #2Definer #58

Referenced by

none

Source

1if (verb == "%")
2return player:tell("You must give an object.");
3elseif (!$object_utils:has_property(#0, tostr(verb[2..$])))
4return player:tell("Invalid object.");
5endif
6force_input(player, tostr("@create $", verb[2..$], " named ", $string_utils:capitalize(verb[2..$])));
7force_input(player, tostr("@set ", verb[2..$], ".home to ", player.location));
8force_input(player, tostr("@move ", verb[2..$], " to here"));