@verb #53:"what_trash" this none this rxdo #55 @program #53:"what_trash" this none this if (!this.net_task_id) "pretty please don't create a billion objects at once.. but at least now, this will only run once regardless." fork id (0) while (length(children($garbage)) <= this.minimum_total_garbage) $wiz_utils:guard_alert("Warning: Garbage count below minimum safe level (", this.minimum_total_garbage, "). Creating ", new = this.minimum_total_garbage * 2, " *new* objects.") if (new < 1) new = 1 endif for x in [1..new] $hard_creating_tasks = setadd($hard_creating_tasks, task_id()) number = create($thing) $recycler:recycle(number) endfor endwhile while (!this:valid_invalids() && length(children($garbage))) $wiz_utils:guard_alert("Error: No valid user garbage. Loosing an hour of refkill to compensate. ($recycler.lastcomplete_refkill_sweep += 3600)") $recycler.last_complete_refkill_sweep = $recycler.last_complete_refkill_sweep + 3600 endwhile if (this:valid_invalids() <= this.minimum_valid_garbage) $wiz_utils:guard_alert("Warning: Valid garbage below minimum safe level (", this.minimum_valid_garbage, "). Refkilling.") fork (0) `this:refkiller() ! E_QUOTA => "Fine, I only want one running anyways."' endfork endif this.net_task_id = 0 endfork this.net_task_id = id endif min = this.min_user_obj max = max_object() if (valid(args[1])) "The following thresholds are defined as toobj(123) instead of #123 to avoid the wrath of the Housekeeper's invalid object sweep." if (args[1]:isa($player)) return this:new_player_number(args[1]) elseif (args[1]:isoneof($webber, $daemon_connection)) min = toobj(7000) max = toobj(7999) "Transitory stuff" elseif (args[1]:isa($thing)) min = this.min_user_obj max = toobj(2999) elseif (args[1]:isa($room)) min = toobj(3000) max = toobj(4999) elseif (args[1]:isa($exit)) min = toobj(5000) max = toobj(6999) elseif (args[1]:isoneof($database, $newsgroup, $help_db, $option)) min = toobj(8000) max = toobj(9999) endif endif trash = {} for x in [min..max] parent(x) == $trash && x.recycled_time <= this.last_complete_refkill_sweep && (trash = {@trash, x}) endfor while (1) if (!trash) trash = children($trash) endif if (!trash) "Uh-oh, we have no trash at all. Hopefully, the forked task is fixing this situation right now..." if ($code_utils:task_valid(this.net_task_id)) "Wait for new garbage to be created by the forked task..." player:tell("Waiting for new trash to be created, suspending...") suspend(1) continue else $wiz_utils:guard_alert("No trash available, and no task running to remedy this situation! Help!") return raise(E_QUOTA, "No trash available!") endif endif victim = trash[random($)] if (this:valid(victim)) trash = setremove(trash, victim) "#8084:Tell(victim, \" disqualified for being valid.\");" "Huh?!?" elseif (victim.recycled_time >= $recycler.last_complete_refkill_sweep) trash = setremove(trash, victim) "#8084:tell(victim, \" disqualified for being !refkilled.\");" "Hasn't had it's refs purged." elseif (victim < this.min_user_obj) "#8084:tell(victim, \" disqualified for being < $recyler.min_user_obj.\");" trash = setremove(trash, victim) "Reserved for wizzen" else "#8084:tell(victim, \" returned.\");" return victim "Bingo!" endif if ($command_utils:running_out_of_time()) player:tell("Searching for trash, suspending before continuing search...") suspend(0) endif endwhile "Last modified by Slacker (#55) on Sat Jul 30 12:23:29 2005 MDT." .