housekeeper #71
Aliases: housekeeper
32 verbs · 154 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
look_self | this none this | rxd | #71 | 2 |
cleanup | this none this | rxd | #71 | 14 |
replace | this none this | rxd | #71 | 68 |
cleanup_list | any none none | rxd | #71 | 32 |
add_cleanup | any any any | rxd | #71 | 47 |
remove_cleanup | any none none | rxd | #71 | 15 |
controls | this none this | rxd | #71 | 13 |
litterbug | this none this | rxd | #71 | 12 |
is_watching | this none this | rxd | #71 | 1 |
send_home | this none this | rxd | #71 | 15 |
moveit | this none this | rxd | #71 | 7 |
ejectit | this none this | rxd | #71 | 4 |
is_object_cleaned | this none this | rxd | #71 | 6 |
is_litter | this none this | rxd | #71 | 7 |
init_for_core | this none this | rxd | #71 | 19 |
clean_status | this none this | rxd | #71 | 11 |
is_cleaning | this none this | rxd | #71 | 8 |
time | this none this | rxd | #71 | 3 |
acceptable | this none this | rxd | #71 | 1 |
move_players_home | this none this | rxd | #71 | 8 |
move_em | this none this | rxd | #71 | 29 |
take_away_msg drop_off_msg | this none this | rxd | #71 | 1 |
set_moveto_task | this none this | rxd | #71 | 5 |
scheduled_cleanup | this none this | rxd | #71 | 15 |
do_move_players_home | this none this | rxd | #71 | 22 |
fix_all_exits | this none this | rxd | #71 | 30 |
exit_alias_builder | this none this | rxd | #71 | 68 |
fix_object_aliases | this none this | rxd | #71 | 17 |
object_scrub daily | this none this | rxd | #71 | 23 |
@begin | this at/to any | rd | #71 | 28 |
find_duplicate_verbs | this none this | rxd | #71 | 18 |
knock_em_homers | this none this | rxd | #71 | 11 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
recycle_bins | #71 | rc | #36 | {} |
owners | #71 | rc | #36 | {#2} |
cleaning | #71 | rc | #36 | #-1 |
litter | #71 | rc | #36 | {} |
eschews | #71 | rc | #36 | {} |
public_places | #71 | rc | #36 | {} |
task | #71 | rc | #36 | {0, 0} |
requestors | #71 | rc | #36 | {} |
destination | #71 | rc | #36 | {} |
clean | #71 | r | #36 | {} |
testing | #71 | rc | #36 | 0 |
player_queue | #71 | r | #36 | {} |
take_away_msg | #71 | rc | #36 | "%N %<shuffles> off to find a quieter place to sleep." |
drop_off_msg | #71 | rc | #36 | "%[tpsc] arrives to drop off %n, who is sound asleep." |
move_player_task | #71 | r | #36 | 1279002036 |
moveto_task | #71 | rc | #36 | 11886198 |
cleaning_index | #71 | rc | #36 | 0 |
eval_subs | #58 | r | #36 | {} |
eval_ticks | #58 | r | #36 | <clear> |
eval_env | #58 | r | #36 | "here=player.location;me=player" |
prog_options | #58 | rc | #36 | <clear> |
bot | #58 | rc | #36 | <clear> |
build_options | #4 | rc | #36 | <clear> |
at_room_width | #90 | rc | #36 | <clear> |
at_number | #90 | rc | #36 | <clear> |
join_msg | #90 | rc | #36 | <clear> |
object_port_msg | #90 | rc | #36 | <clear> |
victim_port_msg | #90 | rc | #36 | <clear> |
thing_arrive_msg | #90 | rc | #36 | <clear> |
othing_port_msg | #90 | rc | #36 | <clear> |
thing_port_msg | #90 | rc | #36 | <clear> |
player_arrive_msg | #90 | rc | #36 | <clear> |
oplayer_port_msg | #90 | rc | #36 | <clear> |
player_port_msg | #90 | rc | #36 | <clear> |
self_arrive_msg | #90 | rc | #36 | <clear> |
oself_port_msg | #90 | rc | #36 | <clear> |
self_port_msg | #90 | rc | #36 | <clear> |
rooms | #90 | r | #36 | <clear> |
refused_origins | #90 | r | #36 | <clear> |
refused_extra | #90 | r | #36 | <clear> |
default_refusal_time | #90 | r | #36 | <clear> |
report_refusal | #90 | r | #36 | <clear> |
refused_actions | #90 | r | #36 | <clear> |
refused_until | #90 | r | #36 | <clear> |
page_refused | #90 | r | #36 | <clear> |
page_refused_msg | #90 | rc | #36 | <clear> |
whisper_refused_msg | #90 | rc | #36 | <clear> |
mail_refused_msg | #90 | rc | #36 | <clear> |
death_msg | #91 | rc | #36 | <clear> |
alive | #91 | r | #36 | <clear> |
alert | #91 | r | #36 | <clear> |
mobile | #91 | r | #36 | <clear> |
wielded | #91 | r | #36 | <clear> |
last_paged | #91 | r | #36 | <clear> |
last_healed | #91 | r | #36 | <clear> |
followed_by | #91 | r | #36 | <clear> |
following | #91 | r | #36 | <clear> |
free_points | #91 | r | #36 | 1.36749999999999 |
stats | #91 | r | #36 | <clear> |
stats_current | #91 | r | #36 | <clear> |
skills | #91 | r | #36 | <clear> |
race | #91 | r | #36 | <clear> |
org | #91 | r | #36 | <clear> |
money | #91 | r | #36 | <clear> |
follow_msg | #91 | rc | #36 | <clear> |
stopfollow_msg | #91 | rc | #36 | <clear> |
searching | #91 | r | #36 | <clear> |
languages | #91 | r | #36 | {{#142}, {2.0}} |
speaking | #91 | r | #36 | <clear> |
remembered_names | #91 | r | #36 | {} |
short_desc_msg | #91 | r | #36 | "" |
knowledge | #91 | rc | #36 | <clear> |
magic_immunity | #91 | rc | #36 | <clear> |
roomnum | #91 | rwc | #36 | <clear> |
killcount | #91 | rc | #36 | <clear> |
pkill | #91 | rc | #36 | <clear> |
level | #91 | rc | #36 | <clear> |
experience | #91 | rc | #36 | <clear> |
adv_points | #91 | rc | #36 | <clear> |
resets | #91 | rc | #36 | <clear> |
exp | #91 | rc | #36 | <clear> |
class | #91 | rc | #36 | <clear> |
map | #91 | rc | #36 | <clear> |
used_spells | #91 | rc | #36 | <clear> |
_mail_task | #40 | rc | #36 | <clear> |
messages_going | #40 | c | #36 | <clear> |
mail_lists | #40 | rc | #36 | <clear> |
mail_notify | #40 | r | #2 | <clear> |
mail_forward | #40 | rc | #36 | {#2} |
mail_options | #40 | rc | #36 | {} |
message_keep_date | #40 | rc | #36 | <clear> |
messages_kept | #40 | rc | #36 | <clear> |
current_message | #40 | c | #36 | {0, -1300000000} |
messages | #40 | c | #36 | <clear> |
ansi_options | #95 | r | #36 | <clear> |
replace_codes | #95 | r | #36 | <clear> |
features | #6 | r | #36 | <clear> |
previous_connection | #6 | | #2 | <clear> |
email_address | #6 | | #2 | <clear> |
last_disconnect_time | #6 | r | #2 | <clear> |
help | #6 | rc | #36 | 0 |
more_msg | #6 | rc | #36 | <clear> |
linetask | #6 | r | #36 | <clear> |
linesleft | #6 | r | #36 | <clear> |
linebuffer | #6 | | #36 | <clear> |
pagelen | #6 | r | #36 | <clear> |
owned_objects | #6 | r | #2 | {} |
linelen | #6 | r | #36 | -80 |
current_folder | #6 | c | #36 | <clear> |
all_connect_places | #6 | | #2 | <clear> |
last_connect_place | #6 | | #2 | <clear> |
brief | #6 | rc | #36 | <clear> |
lines | #6 | c | #36 | <clear> |
page_absent_msg | #6 | rc | #36 | "The housekeeper too busy putting away all the junk." |
pq | #6 | rc | #36 | "the housekeeper's" |
pqc | #6 | rc | #36 | "The housekeeper's" |
page_origin_msg | #6 | rc | #36 | <clear> |
page_echo_msg | #6 | rc | #36 | <clear> |
edit_options | #6 | rc | #36 | <clear> |
last_connect_time | #6 | r | #2 | <clear> |
ownership_quota | #6 | | #36 | -9993 |
gender | #6 | rc | #36 | <clear> |
prc | #6 | rc | #36 | "'Self" |
ppc | #6 | rc | #36 | "The housekeeper's" |
poc | #6 | rc | #36 | "The housekeeper" |
psc | #6 | rc | #36 | "The housekeeper" |
pr | #6 | rc | #36 | "'self" |
pp | #6 | rc | #36 | "the housekeeper's" |
po | #6 | rc | #36 | "the housekeeper" |
ps | #6 | rc | #36 | "the housekeeper" |
home | #6 | rc | #36 | #62 |
password | #6 | | #2 | "Impossible password to type" |
gaglist | #6 | rc | #36 | <clear> |
paranoid | #6 | rc | #36 | <clear> |
display_options | #6 | rc | #36 | <clear> |
verb_subs | #6 | rc | #36 | <clear> |
first_connect_time | #6 | r | #2 | 0 |
size_quota | #6 | | #36 | {50000, 0, -1119114564, 0} |
last_password_time | #6 | | #2 | 0 |
last_connect_attempt | #6 | | #2 | <clear> |
page_count_start_time | #6 | r | #2 | <clear> |
ping_task | #6 | r | #36 | <clear> |
infobar | #6 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | <clear> |
key | #1 | c | #36 | <clear> |
aliases | #1 | r | #2 | {"housekeeper"} |
description | #1 | rc | #36 | "A very clean, neat, tidy person who doesn't mind lugging players and their gear all over the place." |
object_size | #1 | r | #36 | {34419, -1090650497} |
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
Showing 48 of 64 verbs; 16 not shown.
Source
look_self
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
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
Referenced by
- #71:cleanup line 8:
this:replace - #71:scheduled_cleanup line 9:
this:replace
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
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
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
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
Referenced by
- #71:add_cleanup line 37:
this:controls - #71:remove_cleanup line 6:
this:controls
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
Referenced by
- #71:scheduled_cleanup line 12:
this:litterbug
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
Referenced by
- #71:litterbug line 4:
this:is_watching
Source
1return valid(thing = args[1]) && thing:is_listening();
send_home
Referenced by
- #71:litterbug line 7:
this:send_home
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
Referenced by
- #71:replace line 54:
this:moveit
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
Referenced by
- #71:send_home line 6:
this:ejectit
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
Referenced by
- #71:is_cleaning line 3:
this:is_object_cleaned
Source
1what = args[1]; 2if (!(where = what in this.clean)) 3return 0; 4else 5return {this.destination[where], this.requestors[where]}; 6endif
is_litter
Referenced by
- #71:litterbug line 4:
this:is_litter
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
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
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
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
Referenced by
- #71:clean_status line 11:
this:time - #71:scheduled_cleanup line 5:
this:time - #71:@begin line 8:
this:time
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
Referenced by
none
Source
1return caller == this;
move_players_home
Referenced by
- #3:disfunc line 6:
$housekeeper:move_players_home - #104:disfunc line 7:
$housekeeper:move_players_home
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
Referenced by
- #71:do_move_players_home line 14:
this:move_em
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
Referenced by
- #71:move_em line 12:
this:take_away_msg - #71:move_em line 19:
this:take_away_msg - #71:move_em line 23:
this:drop_off_msg
Source
1return $string_utils:pronoun_sub(this.(verb), args[1], this);
set_moveto_task
Referenced by
- #71:move_em line 7:
this:set_moveto_task
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
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
Referenced by
- #71:move_players_home line 7:
this:do_move_players_home - #71:scheduled_cleanup line 14:
this:do_move_players_home
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
Referenced by
- #71:object_scrub line 16:
this:fix_all_exits
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
Referenced by
- #71:fix_all_exits line 11:
this:exit_alias_builder - #71:fix_all_exits line 24:
this:exit_alias_builder
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
Referenced by
- #71:object_scrub line 14:
this:fix_object_aliases
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
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
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
Referenced by
- #71:object_scrub line 20:
this:find_duplicate_verbs
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
Referenced by
- #71:object_scrub line 18:
this:knock_em_homers
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