a61 @verb #2992:"@iwho" any any any rxd #562 @program #2992:"@iwho" any any any "@iwho - Shows a who listing sorted by idle and disconnect times." if (player == caller) this:update_usage("@iwho") this:check_list() idx = $list_utils:iassoc(player, this.inter) if (!idx) player:tell("You don't have an interesting list.") return endif WhosInteresting = this.inter[idx][3] nonplayers = {} if (length(WhosInteresting)) now = time() onlist = {} dreamlist = {} idlelist = {} daylist = {} weeklist = {} monthlist = {} longerlist = {} titles = {"Active: ", "Daydreaming: ", "Idle: ", "Last login within a day: ", "Last login within a week: ", "Last login within a month: ", "Last login over a month ago: "} " set_task_perms(player);" connlist = player:isa($guardian) ? connected_players() | $no_one:eval("connected_players()")[2] for dude in (WhosInteresting) if (!(dude in connlist)) if (!is_player(dude)) nonplayers = {@nonplayers, dude} else then = dude.last_connect_time gone = now - then if (gone < 60 * 60 * 24) daylist = {@daylist, dude.name} elseif (gone < 60 * 60 * 24 * 7) weeklist = {@weeklist, dude.name} elseif (gone < 60 * 60 * 24 * 30) monthlist = {@monthlist, dude.name} else longerlist = {@longerlist, dude.name} endif endif elseif (idle_seconds(dude) < 2 * 60) onlist = {@onlist, dude.name} elseif (idle_seconds(dude) < 5 * 60) dreamlist = {@dreamlist, dude.name} else idlelist = {@idlelist, dude.name} endif endfor index = 0 master = {onlist, dreamlist, idlelist, daylist, weeklist, monthlist, longerlist} for namelist in (master) count = 0 names = "" namelist = $list_utils:sort(namelist) for dudename in (namelist) count = count + 1 names = names + dudename + (count == length(namelist) ? "." | ", ") endfor index = index + 1 if (names) player:tell(titles[index] + names) endif endfor if (nonplayers) player:tell("Removing nonplayer object", length(nonplayers) == 1 ? ": " | "s: ", $string_utils:english_list(nonplayers), " from your interesting list.") this.inter[idx][3] = $set_utils:difference(this.inter[idx][3], nonplayers) endif else player:tell("You don't have an interesting list.") endif endif "Last modified by killeen (#562) on Sat Sep 2 09:18:35 2000 MDT." . 0