;return tostr("[bold][cyan]Creating Who/Where and corifying...[normal]"); @create $feature named who_where,who,where,ww @corify who as $who_where ;return tostr("[bold][cyan]Writing properties...[normal]"); @prop who.groups {"Wizards", "wizard", "Programmers", "programmer", "builders", "builder", "!idle", "!wizard", "!wizards", "!programmer", "!programmers", "!builder", "!builders"} rc ;return tostr("[bold][cyan]Installing Verbs..[normal]"); ;return tostr(" "); ;return tostr("[bold][cyan]Writing :\"who\" any any any rxd[normal]"); @verb who:"who" any any any rxd @program who:who player:tell(); {cnum, wnum, i_times, where} = {0, 0, {}, {}}; for who in (plist = this:get_players(@args)) wnum = who.wizard ? wnum + 1 | wnum; i_times = who in connected_players() && !who.hide ? {@i_times, idle_seconds(who)} | (who in connected_players() && who.hide ? {@i_times, -100} | {@i_times, 99999999}); name = $who_utils:convsize((who.wizard ? "[red]*[normal] " | " ") + who:title(), 18) + " "; connected = $string_utils:right(who in connected_players() && !who.hide ? "[bold][green]" + $time_utils:dhms(time() - who.last_connect_time) + "[normal]" | (player.wizard && who in connected_players() && who.hide ? "[bold][green]" + $time_utils:dhms(time() - who.last_connect_time) + "[normal]" | "[bold][green]..:..:..:..[normal]"), 12) + " "; who in connected_players() && idle_seconds(who) < 5 * 60 ? cnum = cnum + 1 | (cnum = cnum); idle_time = who in connected_players() && !who.hide ? $string_utils:right("[bold][red]" + $time_utils:dhms(idle_seconds(who)) + "[normal]", 13) + " " | (player.wizard && who in connected_players() && who.hide ? $string_utils:right("[bold][red]" + $time_utils:dhms(idle_seconds(who)) + "[normal]", 13) + " " | $string_utils:right("[bold][red]..:..:..:..[normal]", 13) + " "); if (!length(who.doing_msg)) doing = $who_utils:convsize("[red]Nothing.[normal]", player:linelen() - 20 - 19 - 12); else doing = $who_utils:convsize(typeof(who.doing_msg) == LIST ? "[red]@Doing to read.[normal]" | who.doing_msg, player:linelen() - 20 - 19 - 12); endif where_line = name + connected + idle_time + doing; where = setadd(where, where_line); endfor player:tell(",======Players====== ==Connected== ==Idle Time== ", $string_utils:center("Doing", player:linelen() - 50, "="), "."); for x in ($list_utils:sort(where, i_times)) player:tell("| ", x, " |"); endfor player:tell("+", $ansi_utils:center(p = tostr("[gray][[normal][cyan]", cnum, "[gray]|[normal][green]", length(plist), "[gray]][normal]"), 19, "="), " =[bold][green]DD:HH:MM:SS[normal]= =[bold][red]DD:HH:MM:SS[normal]= ", $ansi_utils:center("Doing", player:linelen() - 50, "="), "+"); footer = tostr("[cyan]Active Players: ", cnum, "[gray] | [normal][unbold][green]", plist == connected_players() ? "Connected Players: " | "Listed Players:: ", length(plist), "[gray] | [normal][unbold][red]Connected Wizards: ", wnum, "[normal]"); player:tell("| ", $ansi_utils:center(footer, player:linelen() - 4), " |"); player:tell("`", $string_utils:left("=", player:linelen() - 2, "="), "'"); . ;return tostr("[bold][cyan]:\"who\" complete, installing :\"get_players\" tnt xdo[normal]"); @verb who:"get_players" this none this xdo @program who:get_players if (!args) plist = connected_players(); else length = ra = rb = 0; plist = inv = {}; for a in ($string_utils:explode(argstr)) if ((a == "*builders") || (a == "*builder")) for who in (players()) if (parent(who) == #4) plist = {@plist, who}; endif endfor elseif ((a[1] == "*") && (a[2..$] == "all")) for all in (players()) plist = {@plist, all}; endfor elseif ((a[1] == "*") && (a[2..$] in this.groups)) for who in (players()) if (a[$] == "s") if (who.(a[2..$ - 1])) plist = {@plist, who}; endif else if (who.(a[2..$])) plist = {@plist, who}; endif endif endfor elseif ((a[1] == "*") && (!(a in this.groups))) player:tell("Couldn't match ", a, " to any groups. Listing connected players by default."); elseif ($string_utils:is_numeric(a)) length = tonum(a); elseif (($string_utils:is_numeric($string_utils:explode(a, "..")[1]) && $string_utils:is_numeric($string_utils:explode(a, "..")[1])) && (index(a, "..") == 2)) {ra, rb} = {tonum($string_utils:explode(a, "..")[1]), tonum($string_utils:explode(a, "..")[2])}; else if (!(a in this.groups)) plist = {@plist, $string_utils:match_player(a)}; endif endif $command_utils:suspend_if_needed(0); endfor for whatever in (plist) if (!valid(whatever)) plist = connected_players(); inv = {@inv, whatever}; endif endfor while ($code_utils:are_members(#2, #35, #37, #116, @children($guest), plist)) plist = $code_utils:setremove_lines(plist, #2, #35, #37, #116, @children($guest)); endwhile plist = $list_utils:remove_duplicates(plist); if (length(plist) == 0) plist = connected_players(); endif if ((length > 0) && (length < length(plist))) plist = plist[1..length]; endif if ((ra > 1) && (rb < length(plist))) plist = plist[ra..rb]; endif endif for s in (args) if (s[1] == "!") if (!(s in this.groups)) player:tell("Couldn't match exclusion argument ", a, " to any groups."); elseif (s == "!idle") for o in (plist) if ((!(o in connected_players())) || ((o in connected_players()) && (idle_seconds(o) > (5 * 60)))) plist = setremove(plist, o); endif endfor elseif ((s == "!wizard") || (s == "!wizards")) for o in (plist) if (o.wizard) plist = setremove(plist, o); endif endfor elseif ((s == "!programmer") || (s == "!programmers")) for x in (plist) if (x.programmer) plist = setremove(plist, x); endif endfor elseif ((s == "!builder") || (s == "!builders")) for y in (plist) if (parent(y) == $builder) plist = setremove(plist, y); endif endfor endif endif endfor return plist; . ;return tostr("[bold][cyan]:\"get_players\" complete, writing :\"where\" any any any xdo[normal]"); @verb who:"where" any any any xdo @program who:where player:tell(); {cnum, nlist, where} = {0, {}, {}}; for who in (plist = this:get_players(@args)) name = $who_utils:Convsize(tostr("(", who, ") ", who:title()), 18) + " "; gender = $ansi_utils:center(who.gender, 11); status = $ansi_utils:Center(tostr("[", who.status, "]"), 10); location = 0; if (who.location != $nothing) location = (("(" + tostr(who.location)) + ") ") + who.location:title(); if (who.location == #48) location = ((("(" + tostr(#48.original[who in #48.active])) + ") ") + #48.original[who in #48.active]:title()) + " [yellow][Editing Verbs][normal]"; elseif (who.location == #47) location = ((("(" + tostr(#47.original[who in #47.active])) + ") ") + #47.original[who in #47.active]:title()) + " [yellow][Editing Notes][normal]"; elseif (who.location == #46) location = ((("(" + tostr(#46.original[who in #46.active])) + ") ") + #46.original[who in #46.active]:title()) + " [yellow][Editing Mail[normal]"; endif endif if (location == 0) location = $string_utils:center("[yellow]*ERROR*[normal]", (((player:linelen() - 21) - 10) - 9) - 3); else location = $who_utils:convsize(tostr($string_utils:right($string_utils:explode(location)[1], 7), " ", $string_utils:from_list($string_utils:explode(location)[2..$], " "), " "), (((player:linelen() - 21) - 10) - 9) - 4); endif where_line = ((name + gender) + status) + location; where = setadd(where, where_line); ((who in connected_players()) && (idle_seconds(who) < (5 * 60))) ? cnum = cnum + 1 | (cnum = cnum); endfor player:tell(",======Players====== ==Gender== ==Status== ", $string_utils:center("Location", player:linelen() - 44, "="), "."); for x in (where) player:tell("| ", x, " |"); endfor player:tell("`", $string_utils:center(p = tostr("[gray][[normal][cyan]", cnum, "[gray]|[normal][green]", length(plist), "[gray]][normal]"), 14 + length(p), "="), " ==Gender== ==Status== ", $string_utils:center("Location", player:linelen() - 44, "="), "'"); . ;return tostr("[bold][cyan]:\"where\" completed.[normal]"); ;return tostr("[bold][cyan]All verbs completed. Writing Help Files on $help:\"who where\"[normal]"); @prop $help.where {"*verbdoc*", $help, "where"} rc @prop $help.who {"*verbdoc*", $help, "who"} rc @verb $help:"who where" tnt xdo @edit $help:who "ret = {}; "for x in [1..length(help = {"You can use [cyan]verb[normal] to gather the following information on a person or persons:", " Number and name: The number of the person (in brackets) followed by their :title().", "", " Gender: The player's gender. Defaults to Neuter if the player's gender isn't Male or Female.", "", " Status: The player's status.", "", " Race: The player's race. Defaults to [gray]unset[normal] if the player hasn't set theirs yet.", "", " Location: Number of the player's location in brackets followed by the :title().", "", "Syntax:", " [cyan]verb [normal]. Groups must be preceeded by an asterisk ([bold]*[normal]), and must be one of the following: [red]*wizards[normal], [red]*programmers[normal], [red]*builders[normal]. Garbled groups will be ignored and the regular Where will be printed.", "", " [cyan]verb [normal]. You can enter one or more players instead of groups to get where on a number of specific players. IE: [cyan]verb Animel Squallmonger[normal] prints out where inforation for Animel and Squallmonger. Garbled names will be ignored and where will print out the regular Where listings.", "", " [cyan]verb [normal]. You can use a combination of the two to get results on groups and players together. Note that in all three cases, listings for a player will not be displayed more than once, even if they are located in more than one group, or they're listed in more than once.", "", " [cyan]verb [normal]. You can also include a numeric argument, which will limit the number of players listed. [cyan]verb *wizards 3[normal] returns the where list of the first 3 people that would normally be listed in [cyan]verb *wizards[normal].", "", " [cyan]verb [normal]. Ranges are in the format of a..b, where a is a starting number, and b is a finishing one (obviously, a must be larger than b). This will return a list of people from a to b. For example, [cyan]verb *all 3..6[normal] returns players 3, 4, 5 and 6 from *all (all players).", "", " [cyan]verb [normal]. In combination, you can use these two arguments to get a range of a to b of the first players in the Where listings. [cyan]verb *all 10 3..5[normal] returns the 3rd, 4th and 5th players of the first 10 in *all.", "", " [cyan]verb *builders Squallmonger *wizards 13 2..5[normal]. A final example of all the arguments put together. This returns the 2nd, 3rd, 4th and 5th of the first 13 players that fall into the groups of Builders and Wizards, as well as the player Squallmonger.", "", " [cyan]verb ![normal]. Just as you can use * to select only a certain type of people, you can use ! to invert that selection -- that is, you can type Where !idle, and /exclude/ all unidle people. The groups are: [cyan]!idle[normal], [cyan]!programmers[normal], [cyan]!builders[normal], and [cyan]!wizards[normal]."})] "ret = {@ret, $string_utils:subst(help[x], {{"verb",(verb)}})}; "endfor "return ret; com done ;return tostr("[bold][cyan]Help file written.[normal]"); ;return tostr("[bold][cyan]To add feature to #6 (and thus all players): [green];force_input(#6, \"@add-feature \");[bold][cyan].[normal]"); ;return tostr("[bold][cyan]Installation complete.[normal]"); ;return tostr("[bold][cyan]Report all comments/suggestions/complaints to: (MSN) crbrigg@hotmail.com, (ICQ) 152379478, (AIM) xAchillezX, or (EMAIL) crbrigg@hotmail.com/crbrigg@ns.sympatico.ca[normal]");