generic holding tank #345
Aliases: generic holding tank
5 verbs · 11 properties · 3 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
_clean | this none this | rxd | #345 | 17 |
_clean_start | this none this | rxd | #345 | 7 |
@clean | this none none | rxd | #345 | 1 |
maybe_clean | this none this | rxd | #345 | 19 |
look_self | this none this | rxd | #345 | 54 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
clean_task | #345 | rc | #361 | 0 |
aliases | #1 | rc | #361 | {"generic holding tank"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {3815, 1298434510} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #185 womb, #186 tomb, #229 lostnfound
Call graph
Source
_clean
Referenced by
- #345:_clean_start line 5:
this:_clean
Source
1who = args[1]; 2who:tell("Starting $", this.name, " cleaner."); 3goats = this.contents; 4kills = 0; 5while (goats) 6goat = goats[1]; 7`goat.junk_ok = 1 ! ANY => 0'; 8`$rpg:junk(goat) ! ANY => 0'; 9if (!is_a(goat, $garbage)) 10who:tell($ansi.cyan, " Couldn't junk ", $su:nn(goat), "!", $ansi.reset); 11else 12kills = kills + 1; 13endif 14goats = setremove(goats, goat); 15$cu:sin(2) && who:tell($ansi.cyan, " Killed ", kills, "...", $ansi.reset); 16endwhile 17who:tell("Done cleaning ", $su:nn(this), ".");
_clean_start
Referenced by
- #345:@clean line 1:
this:_clean_start - #345:maybe_clean line 10:
this:_clean_start
Source
1if (task_valid(this.clean_task)) 2return E_INVARG; 3endif 4fork task_id (1) 5this:_clean(player); 6endfork 7this.clean_task = task_id;
@clean
Referenced by
none
Source
1this:_clean_start();
maybe_clean
Referenced by
none
Source
1return; 2if (random(100) < 10) 3clear = 1; 4for x in (connected_players()) 5if ((!x.programmer) && (idle_seconds(x) < 600)) 6clear = 0; 7endif 8endfor 9if ((clear && (!task_valid(this.clean_task))) && (length(this.contents) > 50)) 10this:_clean_start(); 11endif 12endif 13count = 0; 14while (this.contents && (count < 2)) 15goat = this.contents[random(length(this.contents))]; 16$rpg:junk(goat); 17count = count + 1; 18suspend(1); 19endwhile
look_self
Referenced by
none
Source
1names = {@$iu:pluralsc(), "Misc", "Non-things"}; 2nonthings = {}; 3things = {}; 4total_weight = 0; 5for x in (this.contents) 6if (!is_a(x, $thing)) 7nonthings = {@nonthings, x}; 8else 9things = {@things, x}; 10endif 11endfor 12buckets = $iu:group_by_type(things); 13buckets = {@buckets, nonthings}; 14for x in [1..length(buckets)] 15if (buckets[x]) 16player:tell($ansi.bold_on, names[x], ":", $ansi.reset); 17things = buckets[x]; 18msg_db = {}; 19names = {}; 20weights = player:check_pref("weights"); 21for x in (things) 22added = 0; 23iname = x:iname(); 24if (weights) 25iname = ((((iname + $ansi.cyan) + " [") + $su:english_weight_short(weight = x:weight())) + "]") + $ansi.reset; 26endif 27if (i = $lu:iassoc(iname, msg_db, 2)) 28msg_db[i][3] = msg_db[i][3] + 1; 29msg_db[i][1] = setadd(msg_db[i][1], x); 30added = 1; 31else 32msg_db = {@msg_db, {{x}, iname, 1}}; 33endif 34yield; 35endfor 36for x in (msg_db) 37if (x[3] > 1) 38name = ($string_utils:aggregate_number(x[3]) + " ") + x[1][1]:plural_name(); 39if (weights) 40wt = 0; 41for z in (x[1]) 42wt = wt + z:weight(); 43endfor 44name = ((((name + $ansi.cyan) + " [") + $su:english_weight_short(wt)) + "]") + $ansi.reset; 45endif 46else 47name = x[2]; 48endif 49names = {@names, name}; 50yield; 51endfor 52player:tell_item_list(names); 53endif 54endfor