housekeeper #71

Parent #58Owner #36Flags player, programmer, readSource RPG Core/rpgcore-patched.db

Aliases: housekeeper

32 verbs · 141 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
look_selfthis none thisrxd#712
cleanupthis none thisrxd#7114
replacethis none thisrxd#7168
cleanup_listany none nonerxd#7132
add_cleanupany any anyrxd#7147
remove_cleanupany none nonerxd#7115
controlsthis none thisrxd#7113
litterbugthis none thisrxd#7112
is_watchingthis none thisrxd#711
send_homethis none thisrxd#7115
moveitthis none thisrxd#717
ejectitthis none thisrxd#714
is_object_cleanedthis none thisrxd#716
is_litterthis none thisrxd#717
init_for_corethis none thisrxd#7119
clean_statusthis none thisrxd#7111
is_cleaningthis none thisrxd#718
timethis none thisrxd#713
acceptablethis none thisrxd#711
move_players_homethis none thisrxd#718
move_emthis none thisrxd#7129
take_away_msg drop_off_msgthis none thisrxd#711
set_moveto_taskthis none thisrxd#715
scheduled_cleanupthis none thisrxd#7115
do_move_players_homethis none thisrxd#7122
fix_all_exitsthis none thisrxd#7130
exit_alias_builderthis none thisrxd#7168
fix_object_aliasesthis none thisrxd#7117
object_scrub dailythis none thisrxd#7123
@beginthis at/to anyrd#7128
find_duplicate_verbsthis none thisrxd#7118
knock_em_homersthis none thisrxd#7111

Properties

PropertyDefinerFlagsOwnerValue
recycle_bins#71rc#36{}
owners#71rc#36{#2}
cleaning#71rc#36#-1
litter#71rc#36{}
eschews#71rc#36{}
public_places#71rc#36{}
task#71rc#36{0, 0}
requestors#71rc#36{}
destination#71rc#36{}
clean#71r#36{}
testing#71rc#360
player_queue#71r#36{}
take_away_msg#71rc#36"%N %<shuffles> off to find a quieter place to sleep."
drop_off_msg#71rc#36"%[tpsc] arrives to drop off %n, who is sound asleep."
move_player_task#71r#360
moveto_task#71rc#360
cleaning_index#71rc#360
eval_subs#58r#36{}
eval_ticks#58r#36<clear>
eval_env#58r#36"here=player.location;me=player"
prog_options#58rc#36<clear>
bot#58rc#36<clear>
build_options#4rc#36<clear>
at_room_width#90rc#36<clear>
at_number#90rc#36<clear>
join_msg#90rc#36<clear>
object_port_msg#90rc#36<clear>
victim_port_msg#90rc#36<clear>
thing_arrive_msg#90rc#36<clear>
othing_port_msg#90rc#36<clear>
thing_port_msg#90rc#36<clear>
player_arrive_msg#90rc#36<clear>
oplayer_port_msg#90rc#36<clear>
player_port_msg#90rc#36<clear>
self_arrive_msg#90rc#36<clear>
oself_port_msg#90rc#36<clear>
self_port_msg#90rc#36<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#36<clear>
whisper_refused_msg#90rc#36<clear>
mail_refused_msg#90rc#36<clear>
death_msg#91rc#36<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.36749999999999
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#36<clear>
stopfollow_msg#91rc#36<clear>
searching#91r#36<clear>
languages#91r#36{{#142}, {2.0}}
speaking#91r#36<clear>
remembered_names#91r#36{}
short_desc_msg#91r#36""
_mail_task#40rc#36<clear>
messages_going#40c#36<clear>
mail_lists#40rc#36<clear>
mail_notify#40r#2<clear>
mail_forward#40rc#36{#2}
mail_options#40rc#36{}
message_keep_date#40rc#36<clear>
messages_kept#40rc#36<clear>
current_message#40c#36{0, -1300000000}
messages#40c#36<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#360
more_msg#6rc#36<clear>
linetask#6r#36<clear>
linesleft#6r#36<clear>
linebuffer#6#36<clear>
pagelen#6r#36<clear>
owned_objects#6r#2{}
linelen#6r#36-80
current_folder#6c#36<clear>
all_connect_places#6#2<clear>
last_connect_place#6#2<clear>
brief#6rc#36<clear>
lines#6c#36<clear>
page_absent_msg#6rc#36"The housekeeper too busy putting away all the junk."
pq#6rc#36"the housekeeper's"
pqc#6rc#36"The housekeeper's"
page_origin_msg#6rc#36<clear>
page_echo_msg#6rc#36<clear>
edit_options#6rc#36<clear>
last_connect_time#6r#2<clear>
ownership_quota#6#36-9993
gender#6rc#36<clear>
prc#6rc#36"'Self"
ppc#6rc#36"The housekeeper's"
poc#6rc#36"The housekeeper"
psc#6rc#36"The housekeeper"
pr#6rc#36"'self"
pp#6rc#36"the housekeeper's"
po#6rc#36"the housekeeper"
ps#6rc#36"the housekeeper"
home#6rc#36#62
password#6#2"Impossible password to type"
gaglist#6rc#36<clear>
paranoid#6rc#36<clear>
display_options#6rc#36<clear>
verb_subs#6rc#36<clear>
first_connect_time#6r#20
size_quota#6#36{50000, 0, -1119114564, 0}
last_password_time#6#20
last_connect_attempt#6#2<clear>
page_count_start_time#6r#2<clear>
ping_task#6r#36<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#36<clear>
key#1c#36<clear>
aliases#1r#2{"housekeeper"}
description#1rc#36"A very clean, neat, tidy person who doesn't mind lugging players and their gear all over the place."
object_size#1r#36{34419, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #58 generic programmer#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: none

Call graph

calls n71_0 #71:look_self n6_79 #6:tell_lines n71_0->n6_79 n91_36 #91:description n71_0->n91_36 n6_18 #6:tell n71_0->n6_18 n20_34 #20:pronoun_sub n71_0->n20_34 n71_1 #71:cleanup n71_1->n6_18 n71_2 #71:replace n71_1->n71_2 n63_9 #63:valid n71_2->n63_9 n59_36 #59:verb_or_property n71_2->n59_36 n20_59 #20:name_and_number n71_2->n20_59 n52_2 #52:has_verb n71_2->n52_2 n52_0 #52:has_property n71_2->n52_0 n71_10 #71:moveit n71_2->n71_10 n52_5 #52:isa n71_2->n52_5 n71_3 #71:cleanup_list n71_3->n6_18 n20_71 #20:redirect_ansi n71_3->n20_71 n71_4 #71:add_cleanup n71_4->n52_5 n42_0 #42:controls n71_4->n42_0 n52_3 #52:has_callable_verb n71_4->n52_3 n71_6 #71:controls n71_4->n71_6 n71_5 #71:remove_cleanup n71_5->n42_0 n71_5->n71_6 n71_7 #71:litterbug n71_13 #71:is_litter n71_7->n71_13 n71_8 #71:is_watching n71_7->n71_8 n71_9 #71:send_home n71_7->n71_9 n71_13->n52_5 n71_9->n52_5 n71_9->n52_3 n71_11 #71:ejectit n71_9->n71_11 n71_14 #71:init_for_core n4_31 #4:init_for_core n71_14->n4_31 n71_15 #71:clean_status n71_15->n6_18 n55_7 #55:remove_duplicates n71_15->n55_7 n43_7 #43:english_time n71_15->n43_7 n71_17 #71:time n71_15->n71_17 n10_30 #10:current_lag n71_17->n10_30 n71_16 #71:is_cleaning n71_12 #71:is_object_cleaned n71_16->n71_12 n71_19 #71:move_players_home n71_19->n42_0 n99_4 #99:valid_task n71_19->n99_4 n71_24 #71:do_move_players_home n71_19->n71_24 n71_24->n42_0 n71_20 #71:move_em n71_24->n71_20 n59_37 #59:task_valid n71_24->n59_37 n52_16 #52:connected n71_24->n52_16 n71_22 #71:set_moveto_task n71_20->n71_22 n52_6 #52:ancestors n71_20->n52_6 n71_21 #71:take_away_msg n71_20->n71_21 n71_21->n20_34 n71_23 #71:scheduled_cleanup n71_23->n71_2 n71_23->n42_0 n71_23->n71_7 n71_23->n71_17 n71_23->n71_24 n99_17 #99:schedule n71_23->n99_17 n71_25 #71:fix_all_exits n71_25->n55_7 n52_25 #52:descendants_suspended n71_25->n52_25

Showing 48 of 64 verbs; 16 not shown.

Source

look_self

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

none

Source

1player:tell_lines(this:description());
2player:tell($string_utils:pronoun_sub("%S %<is> moving around from room to room, cleaning up.", this));

cleanup

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

none

Source

1"$housekeeper:cleanup([insist]) => clean up player's objects. Argument is 'up' or 'up!' for manually requested cleanups (notify player differently)";
2if (caller_perms() != this)
3return E_PERM;
4endif
5for object in (this.clean)
6x = object in this.clean;
7if (this.requestors[x] == player)
8if (result = this:replace(object, @args))
9player:tell(result, ".");
10endif
11endif
12(ticks_left() < 3000) && suspend(0);
13endfor
14player:tell("The housekeeper has finished cleaning up your objects.");

replace

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1"replace the object given to its proper spot (if there is one).";
2{object, ?insist = 0} = args;
3i = object in this.clean;
4if (!i)
5return tostr(object, " is not on the ", this.name, "'s cleanup list");
6endif
7place = this.destination[i];
8if (!(($recycler:valid(object) && ($recycler:valid(place) || (place == #-1))) && (!(object.location in this.recycle_bins))))
9"object no longer valid (recycled or something), remove it.";
10this.clean = listdelete(this.clean, i);
11this.requestors = listdelete(this.requestors, i);
12this.destination = listdelete(this.destination, i);
13return tostr(object) + " is no longer valid, removed from cleaning list";
14endif
15oldloc = loc = object.location;
16if (object.location == place)
17"already in its place";
18return "";
19endif
20requestor = this.requestors[i];
21if (insist != "up!")
22if ($code_utils:verb_or_property(object, "in_use"))
23return ("Not returning " + object.name) + " because it claims to be in use";
24endif
25for thing in (object.contents)
26if (thing:is_listening())
27return ((("Not returning " + object.name) + " because ") + thing.name) + " is inside";
28endif
29(ticks_left() < 4000) && suspend(0);
30endfor
31if (valid(loc) && (loc != $limbo))
32if (loc:is_listening())
33return ((("Not returning " + object.name) + " because ") + loc.name) + " is holding it";
34endif
35for y in (loc:contents())
36if ((y != object) && y:is_listening())
37return (((("Not returning " + object.name) + " because ") + y.name) + " is in ") + loc.name;
38endif
39(ticks_left() < 4000) && suspend(0);
40endfor
41endif
42endif
43if (valid(place) && (!place:acceptable(object)))
44return (place.name + " won't accept ") + object.name;
45endif
46try
47requestor:tell("As you requested, the housekeeper tidies ", $string_utils:nn(object), " from ", $string_utils:nn(loc), " to ", $string_utils:nn(place), ".");
48if ($object_utils:has_verb(loc, "announce_all_but"))
49loc:announce_all_but({requestor, object}, "At ", requestor.name, "'s request, the ", this.name, " sneaks in, picks up ", object.name, " and hurries off to put ", ($object_utils:has_property(object, "po") && (typeof(object.po) == STR)) ? object.po | "it", " away.");
50endif
51except (ANY)
52"Ignore errors";
53endtry
54this:moveit(object, place, requestor);
55if ((loc = object.location) == oldloc)
56return (object.name + " wouldn't go; ") + ((!place:acceptable(object)) ? (" perhaps " + $string_utils:nn(place)) + " won't let it in" | ((" perhaps " + $string_utils:nn(loc)) + " won't let go of it"));
57endif
58try
59object:tell("The housekeeper puts you away.");
60if ($object_utils:isa(loc, $room))
61loc:announce_all_but({object}, "At ", requestor.name, "'s request, the housekeeper sneaks in, deposits ", object:title(), " and leaves.");
62else
63loc:tell("You notice the housekeeper sneak in, give you ", object:title(), " and leave.");
64endif
65except (ANY)
66"Ignore errors";
67endtry
68return "";

cleanup_list

Spec any none noneFlags rxdOwner #36Definer #71

Referenced by

none

Source

1if (args)
2if (!valid(who = args[1]))
3return;
4endif
5player:tell(who.name, "'s personal cleanup list:");
6else
7who = 0;
8player:tell("Housekeeper's complete cleanup list:");
9endif
10player:tell("------------------------------------------------------------------");
11printed_anything = 0;
12objs = this.clean;
13reqs = this.requestors;
14dest = this.destination;
15for i in [1..length(objs)]
16(ticks_left() < 5000) && suspend(2);
17req = reqs[i];
18ob = objs[i];
19place = dest[i];
20if (((who == 0) || (req == who)) || (ob.owner == who))
21if (!valid(ob))
22player:tell($string_utils:left(tostr(ob), 7), $string_utils:left("** recycled **", 50), "(", req.name, ")");
23else
24player:tell($string_utils:left(tostr(ob), 7), $string_utils:left(ob.name, 26), "=>", $string_utils:left(tostr(place), 7), place.name || "nowhere", " (", req.name, ")");
25endif
26printed_anything = 1;
27endif
28endfor
29if (!printed_anything)
30player:tell("** The housekeeper has nothing in the cleanup list.");
31endif
32player:tell("------------------------------------------------------------------");

add_cleanup

Spec any any anyFlags rxdOwner #36Definer #71

Referenced by

none

Source

1if (!$perm_utils:controls(caller_perms(), this))
2return E_PERM;
3endif
4{what, ?who = player, ?where = what.location} = args;
5if ((what < #1) || (!valid(what)))
6return "invalid object";
7endif
8if ($object_utils:isa(who, $guest))
9return tostr("Guests can't use the ", this.name, ".");
10endif
11if (!is_player(who))
12return tostr("Non-players can't use the ", this.name, ".");
13endif
14if (!valid(where))
15return tostr("The ", this.name, "doesn't know how to find ", where, " in order to put away ", what.name, ".");
16endif
17if (is_player(what))
18return ("The " + this.name) + " doesn't do players, except to cart them home when they fall asleep.";
19endif
20for x in (this.eschews)
21if ($object_utils:isa(what, x[1]))
22ok = 0;
23for y in [3..length(x)]
24if ($object_utils:isa(what, x[y]))
25ok = 1;
26endif
27endfor
28if (!ok)
29return tostr("The ", this.name, " doesn't do ", x[2], "!");
30endif
31endif
32endfor
33if ($object_utils:has_callable_verb(where, "litterp") ? where:litterp(what) | ((where in this.public_places) && (!(what in where.residents))))
34return tostr("The ", this.name, " won't litter ", where.name, "!");
35endif
36if (i = what in this.clean)
37if ((!this:controls(i, who)) && valid(this.destination[i]))
38return tostr(this.requestors[i].name, " already asked that ", what.name, " be kept at ", this.destination[i].name, "!");
39endif
40this.requestors[i] = who;
41this.destination[i] = where;
42else
43this.clean = {what, @this.clean};
44this.requestors = {who, @this.requestors};
45this.destination = {where, @this.destination};
46endif
47return tostr("The ", this.name, " will keep ", what.name, " (", what, ") at ", valid(where) ? ((where.name + " (") + tostr(where)) + ")" | where, ".");

remove_cleanup

Spec any none noneFlags rxdOwner #36Definer #71

Referenced by

none

Source

1if (!$perm_utils:controls(caller_perms(), this))
2return E_PERM;
3endif
4{what, ?who = player} = args;
5if (i = what in this.clean)
6if (!this:controls(i, who))
7return tostr("You may remove an object from ", this.name, " list only if you own the object, the place it is kept, or if you placed the original cleaning order.");
8endif
9this.clean = listdelete(this.clean, i);
10this.destination = listdelete(this.destination, i);
11this.requestors = listdelete(this.requestors, i);
12return tostr(what.name, " (", what, ") removed from cleanup list.");
13else
14return tostr(what.name, " not in cleanup list.");
15endif

controls

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1"does player control entry I?";
2{i, who} = args;
3if ((who in {this.owner, @this.owners}) || who.wizard)
4return "Yessir.";
5endif
6cleanable = this.clean[i];
7if (this.requestors[i] == who)
8return "you asked for the previous result, you can change this one.";
9elseif (((who == cleanable.owner) || (!valid(dest = this.destination[i]))) || (who == dest.owner))
10return "you own the object or the place where it is being cleaned to, or the destination is no longer valid.";
11else
12return "";
13endif

litterbug

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1for room in (this.public_places)
2for thingy in (room.contents)
3suspend(10);
4if (((thingy.location == room) && this:is_litter(thingy)) && (!this:is_watching(thingy, $nothing)))
5"if it is litter and no-one is watching";
6fork (0)
7this:send_home(thingy);
8endfork
9suspend(0);
10endif
11endfor
12endfor

is_watching

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1return valid(thing = args[1]) && thing:is_listening();

send_home

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1if (caller != this)
2return E_PERM;
3endif
4litter = args[1];
5littering = litter.location;
6this:ejectit(litter, littering);
7home = litter.location;
8if ($object_utils:isa(home, $room))
9home:announce_all("The ", this.name, " sneaks in, deposits ", litter:title(), " and leaves.");
10else
11home:tell("You notice the ", this.name, " sneak in, give you ", litter:title(), " and leave.");
12endif
13if ($object_utils:has_callable_verb(littering, "announce_all_but"))
14littering:announce_all_but({litter}, "The ", this.name, " sneaks in, picks up ", litter:title(), " and rushes off to put it away.");
15endif

moveit

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"Wizardly verb to move object with requestor's permission";
2if (caller != this)
3return E_PERM;
4else
5set_task_perms(player = args[3]);
6return args[1]:moveto(args[2]);
7endif

ejectit

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"this:ejectit(object,room): Eject args[1] from args[2].  Callable only by housekeeper's quarters verbs.";
2if (caller == this)
3args[2]:eject(args[1]);
4endif

is_object_cleaned

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1what = args[1];
2if (!(where = what in this.clean))
3return 0;
4else
5return {this.destination[where], this.requestors[where]};
6endif

is_litter

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1thingy = args[1];
2for x in (this.litter)
3if ($object_utils:isa(thingy, x[1]) && (!$object_utils:isa(thingy, x[2])))
4return 1;
5endif
6endfor
7return 0;

init_for_core

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

none

Source

1if (caller_perms().wizard)
2this.password = "Impossible password to type";
3this.last_password_time = 0;
4this.litter = {};
5this.public_places = {};
6this.requestors = {};
7this.destination = {};
8this.clean = {};
9this.eschews = {};
10this.recycle_bins = {};
11this.cleaning = #-1;
12this.task = {0, 0};
13this.owners = {#2};
14this.mail_forward = {#2};
15this.player_queue = {};
16this.move_player_task = 0;
17this.moveto_task = 0;
18pass(@args);
19endif

clean_status

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

none

Source

1count = 0;
2for i in (this.requestors)
3if (i == player)
4count = count + 1;
5endif
6(ticks_left() < 5000) && suspend(1);
7endfor
8player:tell("Number of items in cleanup list: ", tostr(length(this.clean)));
9player:tell("Number of items you requested to be tidied: ", tostr(count));
10player:tell("Number of requestors: ", tostr(length($list_utils:remove_duplicates(this.requestors))));
11player:tell("Time to complete one cleaning circuit: ", $time_utils:english_time(length(this.clean) * this:time()));

is_cleaning

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

none

Source

1"return a string status if the hosuekeeper is cleaning this object";
2cleanable = args[1];
3info = this:is_object_cleaned(cleanable);
4if (info == 0)
5return tostr(cleanable.name, " is not cleaned by the ", this.name, ".");
6else
7return tostr(cleanable.name, " is kept tidy at ", info[1].name, " (", info[1], ") at ", info[2].name, "'s request.");
8endif

time

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1"Returns the amount of time to suspend between objects while continuous cleaning.";
2"Currently set to try to complete cleaning circuit in one hour, but not exceed one object every 20 seconds.";
3return max(20 + $login:current_lag(), length(this.clean) ? 3600 / length(this.clean) | 0);

acceptable

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

none

Source

1return caller == this;

move_players_home

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1if (!$perm_utils:controls(caller_perms(), this))
2"perms don't control the $housekeeper; probably not called by $room:disfunc then. Used to let args[1] call this. No longer.";
3return E_PERM;
4endif
5this.player_queue = {@this.player_queue, {args[1], time() + 300}};
6if (!`$scheduler:valid_task(this.task[1]) ! E_PROPNF => 0')
7this:do_move_players_home();
8endif

move_em

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1if (caller == this)
2who = args[1];
3set_task_perms(who.owner);
4fork (0)
5start = who.location;
6dest = who.programmer ? who.home | $player_start;
7this:set_moveto_task();
8who:moveto(dest);
9suspend(1);
10if (who.location != start)
11if ($terrain in $object_utils:ancestors(start))
12msg = this:take_away_msg(who);
13for x in (start.contents)
14if (start:match_loc(who, x))
15x:tell(msg);
16endif
17endfor
18else
19start:announce(this:take_away_msg(who));
20endif
21endif
22if (who.location == who.home)
23who.home:announce(this:drop_off_msg(who));
24endif
25who.home = who.programmer ? who.home | start;
26endfork
27else
28return E_PERM;
29endif

take_away_msg drop_off_msg

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1return $string_utils:pronoun_sub(this.(verb), args[1], this);

set_moveto_task

Spec this none thisFlags rxdOwner #36Definer #71

Referenced by

Source

1"sets $housekeeper.moveto_task to the current task_id() so player:moveto's can check for validity.";
2if (caller != this)
3return E_PERM;
4endif
5this.moveto_task = task_id();

scheduled_cleanup

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

none

Source

1"needs $scheduler. if an integer arg is passed, sets the wait time to that.";
2if (!($perm_utils:controls(caller_perms(), this) && `toint($scheduler) ! E_PROPNF => 0'))
3return E_PERM;
4endif
5wait = args ? args[1] | this:time();
6if (this.cleaning_index < length(this.clean))
7x = this.clean[this.cleaning_index];
8this.cleaning_index = this.cleaning_index + 1;
9`this:replace(x) ! ANY => ""';
10else
11this.cleaning_index = 0;
12this:litterbug();
13endif
14this:do_move_players_home();
15this.task[1] = $scheduler:schedule(wait, this, "scheduled_cleanup", {wait});

do_move_players_home

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1if (!$perm_utils:controls(caller_perms(), this))
2"perms don't control the $housekeeper; probably not called by $room:disfunc then. Used to let args[1] call this. No longer.";
3return E_PERM;
4endif
5if ($code_utils:task_valid(this.move_player_task))
6"the move-players-home task is already running";
7return;
8endif
9fork tid (10)
10while (this.player_queue)
11if ((mtime = this.player_queue[1][2]) < (time() + 200))
12if (is_player(who = this.player_queue[1][1]) && (!$object_utils:connected(who)))
13if (`$rp_regulator.do_clean_rooms ! E_PROPNF => 0' || (who.location != who.home))
14this:move_em(who);
15endif
16endif
17this.player_queue = listdelete(this.player_queue, 1);
18endif
19(ticks_left() < 5000) && suspend(1);
20endwhile
21endfork
22this.move_player_task = tid;

fix_all_exits

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"USAGE: call from the $scheduler at least weekly.";
2if (!caller_perms().wizard)
3return E_PERM;
4endif
5for x in ($object_utils:descendants_suspended($exit))
6if ((!x.f) && `parent(x.dest) == $garbage ! ANY => 0')
7$recycler:_recycle(x);
8elseif (!x.f)
9(ticks_left() < 10000) && suspend(1);
10alist = $list_utils:remove_duplicates({x.name, @x.aliases});
11alist = this:exit_alias_builder(alist);
12x.name = alist[1];
13x.aliases = alist;
14endif
15endfor
16for r in ($object_utils:descendants_suspended($veroom))
17(ticks_left() < 10000) && suspend(1);
18if (xl = length(r.virtual_exits))
19removals = {};
20for x in [1..xl]
21if (`parent(r.virtual_exits[x][2]) == $garbage ! ANY => 0')
22removals = {@removals, r.virtual_exits[x]};
23else
24r.virtual_exits[x][1] = this:exit_alias_builder(r.virtual_exits[x][1]);
25endif
26(ticks_left() < 10000) && suspend(1);
27endfor
28r.virtual_exits = $set_utils:diff(r.virtual_exits, removals);
29endif
30endfor

exit_alias_builder

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"USAGE: exit_alias_builder(alias list) => new alias list";
2aliai = args[1];
3name = $string_utils:strip_chars(aliai[1], ")>]");
4alist = $string_utils:explode(name, "[");
5alist = $string_utils:explode(alist[1], "(");
6alist = $string_utils:explode(alist[1], "<");
7blist = $string_utils:words($string_utils:subst(alist[1], {{"_", " "}}));
8for i in [1..length(blist)]
9blist[i] = $string_utils:capitalize(blist[i]);
10endfor
11name = $string_utils:from_list(blist);
12if (name == "North")
13aliai = setadd(aliai, "N");
14elseif (name == "South")
15aliai = setadd(aliai, "S");
16elseif (name == "East")
17aliai = setadd(aliai, "E");
18elseif (name == "West")
19aliai = setadd(aliai, "W");
20elseif (name == "Northwest")
21aliai = setadd(aliai, "NW");
22elseif (name == "Northeast")
23aliai = setadd(aliai, "NE");
24elseif (name == "Southwest")
25aliai = setadd(aliai, "SW");
26elseif (name == "Southeast")
27aliai = setadd(aliai, "SE");
28elseif (name == "Up")
29aliai = setadd(aliai, "U");
30elseif (name == "Down")
31aliai = setadd(aliai, "D");
32elseif (name == "Exit")
33aliai = setadd(aliai, "O");
34aliai = setadd(aliai, "Out");
35elseif (name == "Out")
36aliai = setadd(aliai, "O");
37aliai = setadd(aliai, "Exit");
38endif
39longname = ((name + " [") + $string_utils:lowercase($list_utils:shortest(aliai))) + "]";
40suspend(0);
41aliai[1] = $string_utils:strip_chars(longname, "_");
42aliai = setadd(aliai, name);
43needsfix = 0;
44if ((la = length(aliai)) > 1)
45for i in [2..length(aliai)]
46(ticks_left() < 10000) && suspend(0);
47aliai[i] = $string_utils:strip_chars(aliai[i], " _[]<>()");
48if (length(aliai[i]) < 3)
49(ticks_left() < 10000) && suspend(0);
50aliai[i] = $string_utils:lowercase(aliai[i]);
51if ((aliai[i] in {"i", "t", "g", "l"}) && (length(name) > 1))
52aliai[i] = name[1..2];
53needsfix = 1;
54endif
55if ((aliai[i] in {"th", "dr"}) && (length(name) > 2))
56aliai[i] = name[1..3];
57needsfix = 1;
58endif
59endif
60(ticks_left() < 10000) && suspend(0);
61endfor
62endif
63if (needsfix)
64longname = ((name + " [") + $string_utils:lowercase($list_utils:shortest(aliai))) + "]";
65aliai[1] = $string_utils:strip_chars(longname, "_");
66endif
67aliai = $list_utils:remove_duplicates(aliai);
68return aliai;

fix_object_aliases

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"$housekeeper:fix_object_aliases -- makes sure .aliases[1] == .name";
2if (!caller_perms().wizard)
3return E_PERM;
4else
5baddies = {};
6for x in [2..toint(max_object())]
7(ticks_left() < 4000) && suspend(0);
8if (((parent(o = toobj(x)) != $garbage) && (o != $garbage)) && `o.name != o.aliases[1] ! E_RANGE => 1')
9baddies = {@baddies, tostr($string_utils:nn(o), " owned by ", $string_utils:nn(o.owner))};
10o.aliases = setremove(o.aliases, o.name);
11o.aliases = {o.name, @o.aliases};
12endif
13endfor
14if (baddies)
15$mail_agent:send_message(this, this.owners, "Alias fix report", {"Had a bad \".alias\" property:", @baddies});
16endif
17endif

object_scrub daily

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

none

Source

1"-- called from $housekeeper:continuous(interval)";
2"-- will run at an interval 400 x litter cleanup interval";
3"-- cleans sloppy object properties around the MOO";
4"-- called infrequently because of lag.";
5if (!caller_perms().wizard)
6return E_PERM;
7elseif (!(i = `toint(args[1]) ! ANY => 0'))
8return E_INVARG;
9endif
10this.task[2] = $scheduler:schedule(400 * i, this, "daily", {i});
11for p in (connected_players())
12p:notify("! -- There may be some heavy lag as the MOO checks every object for bad properties and duplicate verbs.");
13endfor
14`this:fix_object_aliases() ! ANY => $mail_agent:send_message(this, this.owners, "Cleanup Bug!", {"Halted at $housekeeper:fix_object_aliases()"})';
15suspend(15);
16`this:fix_all_exits() ! ANY => $mail_agent:send_message(this, this.owners, "Cleanup Bug!", {"Halted at $housekeeper:fix_all_exits()"})';
17suspend(15);
18`this:knock_em_homers() ! ANY => $mail_agent:send_message(this, this.owners, "Cleanup Bug!", {"Halted at $housekeeper:knock_em_homers()"})';
19suspend(15);
20`this:find_duplicate_verbs() ! ANY => $mail_agent:send_message(this, this.owners, "Cleanup Bug!", {"Halted at $housekeeper:find_duplicate_verbs()"})';
21for p in (connected_players())
22p:notify("! -- Cleanup complete.");
23endfor

@begin

Spec this at/to anyFlags rdOwner #2Definer #71

Referenced by

none

Source

1"@begin <this> at <interval>";
2"start the housekeeper cleaning continuously.";
3"Kill any previous continuous task. Uses $scheduler";
4"and iobjstr if either are available.";
5if (!player.wizard)
6return E_PERM;
7endif
8wait = (w = toint(iobjstr)) ? w | this:time();
9fork (0)
10if (`$scheduler:valid_task(this.task[2]) ! ANY => 0')
11taskn = this.task[2];
12this.task[2] = 0;
13$scheduler:kill_task(taskn);
14endif
15this.task[2] = $scheduler:schedule(2 * wait, this, "object_scrub", {wait});
16endfork
17fork (0)
18if (`$scheduler:valid_task(this.task[1]) ! ANY => 0')
19taskn = this.task[1];
20this.task[1] = 0;
21$scheduler:kill_task(taskn);
22endif
23this.cleaning_index = 0;
24this.task[1] = $scheduler:schedule(wait, this, "scheduled_cleanup", {wait});
25endfork
26suspend(1);
27player:tell("Location cleaning task = ", this.task[1]);
28player:tell("Property cleaning task = ", this.task[2]);

find_duplicate_verbs

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"$housekeeper:find_duplicate_verbs -- looks for 2 verbs of the same name on same object.";
2if (!caller_perms().wizard)
3return E_PERM;
4else
5baddies = {};
6for x in [0..toint(max_object())]
7((ticks_left() < 6000) || (seconds_left() < 3)) && suspend(1);
8voibs = verbs(o = toobj(x));
9if (voibs != (clean = $list_utils:remove_duplicates(voibs)))
10dubvoibs = $set_utils:difference_suspended(voibs, clean);
11loc = dubvoibs[1] in voibs;
12baddies = {@baddies, tostr($string_utils:nn(o), ":", dubvoibs[1], " (", loc, "),", " owned by ", $string_utils:nn(o.owner), " hint----> verb ", loc + 1, " = ", voibs[loc + 1])};
13endif
14endfor
15if (baddies)
16$mail_agent:send_message(this, this.owners, "Duplicate verb report", {"These objects have duplicate verbs:", @baddies});
17endif
18endif

knock_em_homers

Spec this none thisFlags rxdOwner #2Definer #71

Referenced by

Source

1"A daily cleanup of $homers that didn't get triggered.";
2if (!caller_perms().wizard)
3return E_PERM;
4endif
5homers = $object_utils:descendants_suspended($homer);
6for homey in (homers)
7if (homey.returning && (homey.location != homey.home))
8`$scheduler:schedule(homey.how_long, homey, "go_home") ! ANY => "oh well"';
9endif
10(ticks_left() < 2000) && suspend(0);
11endfor