Experimental Guinea Pig Class with Even More Features of Dubious Utility #5803
Aliases: pigs, guinea pigs
35 verbs · 35 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
@ss*how | any any any | rd | #5803 | 32 |
ways | none any any | | #5803 | 23 |
!* | any any any | r | #5803 | 19 |
@lastlog | any any any | rxd | #5803 | 55 |
boring | any any any | rd | #5803 | 15 |
acceptable | this none this | rxd | #5803 | 1 |
description | this none this | rxd | #5803 | 7 |
old# | any none none | r | #5803 | 41 |
party | none none none | | #5803 | 51 |
@dump(old) | any any any | r | #5803 | 131 |
heartbeat | this none this | rxd | #5803 | 11 |
@edit(old) | any any any | | #5803 | 11 |
all_connect_places | this none this | rxd | #5803 | 4 |
linesplit(old) | this none this | rxd | #5803 | 15 |
notify(old) | this none this | rxd | #5803 | 51 |
@pagelength(old) | any none none | r | #5803 | 26 |
@more(old) | any none none | rd | #5803 | 27 |
+* | any any any | rxd | #5803 | 43 |
eprint* | any any any | rd | #5803 | 14 |
@prettylist | any none none | r | #5803 | 29 |
@qsend(old) | this none this | rd | #5803 | 46 |
@qreply(old) | this none this | rd | #5803 | 37 |
@nprop*erty | any any any | r | #5803 | 55 |
@nlist | any any any | r | #5803 | 110 |
@nn(old) | this none this | rd | #5803 | 14 |
page | any any any | rx | #5803 | 123 |
page(old) | any any any | rx | #5803 | 90 |
plus(old) | this none this | rd | #5803 | 39 |
pc_option | this none this | | #5803 | 1 |
make_current_message(old) | this none this | rxd | #5803 | 33 |
set_current_message(old) | this none this | rxd | #5803 | 28 |
kill_current_message(old) | this none this | rxd | #5803 | 14 |
get_current_message(old) | this none this | rxd | #5803 | 18 |
update_idle_lists(old) | none none none | rxd | #5803 | 38 |
check_mail_lists(old) | none none none | rx | #5803 | 61 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
spoof_attribution | #5803 | rc | — | " (%n)" |
whisper_refusal_report | #5803 | rc | — | 1 |
whisper_receipt_state | #5803 | rc | — | 1 |
page_refusal_report | #5803 | rc | — | 1 |
page_receipt_state | #5803 | rc | — | 1 |
boring | #5803 | r | #68 | 0 |
remote_emote_prefix_msg | #5803 | rc | — | "(from %l)" |
5803_options | #5803 | rc | — | {} |
idle_messages | #5803 | | — | not readable (E_PERM) |
respond_to | #5803 | | — | not readable (E_PERM) |
moved_by | #5803 | | — | {} |
sessile | #5803 | | — | 0 |
witnessing | #5803 | | — | not readable (E_PERM) |
rooms | #5803 | | — | {{"Living", #17}, {"Dining", #28}, {"Library", #1670}, {"Pool", #1428}} |
messages_going | #5803 | | — | not readable (E_PERM) |
current_message | #5803 | | — | not readable (E_PERM) |
messages | #5803 | | — | not readable (E_PERM) |
features | #5803 | | — | {#55317, #30203, #40842, #26787} |
previous_connection | #5803 | | — | not readable (E_PERM) |
email_address | #5803 | | — | not readable (E_PERM) |
help | #5803 | | — | #11525 |
linebuffer | #5803 | | — | not readable (E_PERM) |
current_folder | #5803 | | — | not readable (E_PERM) |
all_connect_places | #5803 | | — | not readable (E_PERM) |
last_connect_place | #5803 | | — | not readable (E_PERM) |
lines | #5803 | | — | not readable (E_PERM) |
ownership_quota | #5803 | | — | not readable (E_PERM) |
password | #5803 | | — | not readable (E_PERM) |
size_quota | #5803 | | — | not readable (E_PERM) |
last_password_time | #5803 | | — | not readable (E_PERM) |
last_connect_attempt | #5803 | | — | not readable (E_PERM) |
key | #5803 | | — | not readable (E_PERM) |
aliases | #5803 | | — | {"pigs", "guinea pigs"} |
description | #5803 | | — | "You see a player who has access to state-of-the-art MOO editing tools and still hasn't bothered to do a bloody description." |
object_size | #5803 | | — | {49940, 1141286584} |
Ancestry
Ancestors (nearest first): #7069 Generic Player Class With Additional Features of Dubious Utility
Children: #8855 Player Class hacked with eval that does substitutions and assorted stuff
Call graph
Source
@ss*how
Referenced by
none
Source
1"A short version of @show that doesn't list properties or verbs."; 2set_task_perms(player); 3if ((player != this) || (dobjstr == "")) 4 player:notify(tostr("Usage: ", verb, " <object-or-property-or-verb>")); 5 return; 6endif 7if (index(dobjstr, ".") && (spec = $code_utils:parse_propref(dobjstr))) 8 if (valid(object = player.location:match_object(spec[1]))) 9 return $code_utils:show_property(object, spec[2]); 10 endif 11elseif (spec = $code_utils:parse_verbref(dobjstr)) 12 if (valid(object = player.location:match_object(spec[1]))) 13 return $code_utils:show_verbdef(object, spec[2]); 14 endif 15elseif (((dobjstr[1] == "$") && ((pname = dobjstr[2..length(dobjstr)]) in properties(#0))) && (typeof(#0.(pname)) == OBJ)) 16 if (valid(object = #0.(pname))) 17 return $code_utils:show_object(object, {}); 18 endif 19elseif ((dobjstr[1] == "$") && (spec = $code_utils:parse_propref(dobjstr))) 20 return $code_utils:show_property(#0, spec[2]); 21else 22 if (valid(object = player.location:match_object(dobjstr))) 23 return $code_utils:show_object(object, {}); 24 endif 25endif 26if (object == $failed_match) 27 player:notify(tostr("I see no \"", dobjstr, "\" here.")); 28elseif (object == $ambiguous_match) 29 player:notify(tostr("I don't know which \"", dobjstr, "\" you mean.")); 30else 31 player:notify(tostr(object, " does not exist.")); 32endif
ways
Referenced by
none
Source
1"This command lists all of the obvious exits from the current location. It takes no arguments."; 2exits = {}; 3if (#0 == (where = (iobjstr && (iobjstr != "here")) ? toobj(iobjstr) | player.location)) 4 player:tell("No such place: ", iobjstr); 5 return; 6elseif (!(valid(where) && ($room in $object_utils:ancestors(where)))) 7 player:tell((where == player.location) ? "You are not in a room." | "That is not actually a room."); 8 return; 9endif 10for e in (this:obvious_exits()) 11 if (valid(eo = where:match_exit(e))) 12 exits = setadd(exits, eo); 13 endif 14endfor 15enames = {}; 16for e in (exits) 17 en = e.aliases[1]; 18 for a in (listdelete(e.aliases, 1)) 19 en = (en + ",") + a; 20 endfor 21 enames = {@enames, ("(" + en) + ")"}; 22endfor 23player:tell($string_utils:english_list(enames, "none"), ".");
!*
Referenced by
none
Source
1"This is the polite spoof verb. `!<string>' announces an arbitrary string to the current location, except that if the string doesn't contain the player name somewhere as a distinct word, the player's .spoof_attribution property (with the substitutions of player.name for %n and % for %%) is appended and if the resulting strings *still* doesn't contain player.name, we append it."; 2if (player != this) 3 player:tell(("Sorry, you can't use " + this.name) + "'s ! verb"); 4 return; 5endif 6argstr = $code_utils:argstr(verb, args); 7if (length(verb) > 1) 8 msg = (verb[2..length(verb)] + " ") + argstr; 9else 10 msg = argstr; 11endif 12if (!$string_utils:index_delimited(msg, player.name)) 13 attrib = player.spoof_attribution; 14 msg = msg + $string_utils:subst(attrib, {{"%n", player.name}, {"%%", "%"}}); 15 if (!$string_utils:index_delimited(msg, player.name)) 16 msg = msg + player.name; 17 endif 18endif 19player.location:announce_all(msg);
@lastlog
Referenced by
none
Source
1"Syntax: @lastlog [from [#] (day|week|month)[s]]"; 2" @lastlog <player> [<player>...]"; 3""; 4"The first form prints the last login times for all players that logged in within the indicated period. Default period is the past week. The second form is now synonymous with @who."; 5if (caller != player) 6 return E_PERM; 7endif 8a_day = (24 * 60) * 60; 9a_week = 7 * a_day; 10a_month = 30 * a_day; 11if (dobjstr == "") 12 folks = players(); 13 from = a_week; 14else 15 this:("@who")(@$string_utils:words(dobjstr)); 16 return; 17endif 18if (prepstr != "") 19 n = 1; 20 if ((((prepstr != "from") || (!(w = $string_utils:explode(iobjstr)))) || ((length(w) > 1) && (!(n = tonum(w[1]))))) || (!(u = (wd = w[length(w)])[1..(wd[len = length(wd)] == "s") ? len - 1 | len] in {"day", "week", "month"}))) 21 player:tell("Usage: ", verb, " [<players>] [from [#] (day|week|month)[s]]"); 22 return; 23 endif 24 from = n * {a_day, a_week, a_month}[u]; 25endif 26day = week = month = ever = never = {}; 27now = time(); 28for x in (folks) 29 when = x.last_connect_time; 30 how_long = now - when; 31 if (from && (how_long > from)) 32 elseif (when == 0) 33 never = {@never, x}; 34 elseif (how_long < a_day) 35 day = {@day, x}; 36 elseif (how_long < a_week) 37 week = {@week, x}; 38 elseif (how_long < a_month) 39 month = {@month, x}; 40 else 41 ever = {@ever, x}; 42 endif 43endfor 44for entry in ({{day, "the last day"}, {week, "the last week"}, {month, "the last 30 days"}, {ever, "recorded history"}}) 45 if (entry[1]) 46 player:tell("Players who have connected within ", entry[2], ":"); 47 for x in (entry[1]) 48 player:tell(" ", x.name, " last connected ", ctime(x.last_connect_time), "."); 49 endfor 50 endif 51endfor 52if (never) 53 player:tell("Players who have not connected since connect-time accounting was established:"); 54 player:tell(" ", $string_utils:english_list($list_utils:map_prop(never, "name"))); 55endif
boring
Referenced by
none
Source
1"\"boring on\" makes you immune to food fights. \"boring off\" allows you to participate again."; 2if (argstr in {"on", "yes"}) 3 this.boring = 1; 4 player:tell("You are now boring."); 5elseif (argstr in {"off", "no"}) 6 this.boring = 0; 7 player:tell("You have become more interesting."); 8elseif (!argstr) 9 this.boring = !this.boring; 10 player:tell("Toggled boring state: status now ", this.boring ? "boring." | "interesting."); 11else 12 player:tell("Say what? Yes or No, On or Off."); 13 return; 14endif 15this.boring ? player:announce($string_utils:pronoun_sub("%N forms a transparent shield around %r, impervious to food.")) | player:announce(player.name, "'s transparent shield evaporates.");
acceptable
Referenced by
- #2693:acceptable line 1:
pass(
Source
1return pass(@args) && (this.boring ? !(#3452 in $object_utils:ancestors(args[1])) | 1);
description
Referenced by
- #2693:description line 2:
pass( - #2693:description line 4:
pass(
Source
1base = pass(@args); 2boring = this.boring && $string_Utils:pronoun_sub("%S %<seems> to have a transparent shield surrounding %o, rendering %o impervious to food fights.", this); 3if (typeof(base) == STR) 4 return boring ? tostr(base, " ", boring) | base; 5elseif (typeof(base) == LIST) 6 return {@base, @boring ? {boring} | {}}; 7endif
old#
Referenced by
none
Source
1"#string [exit|player|inventory] returns the object id corresponding to the object named by string. String is matched in the current room unless one of exit|player|inventory is given."; 2set_task_perms(player); 3if (!(whatstr = verb[2..dot = min(index(verb + ".", "."), index(verb + ":", ":")) - 1])) 4 player:tell("Usage: #string [exit|player|inventory]"); 5 return; 6elseif (!args) 7 what = player:my_match_object(whatstr); 8elseif (index("exits", args[1]) == 1) 9 what = player.location:match_exit(whatstr); 10elseif (index("inventory", args[1]) == 1) 11 what = player:match(whatstr); 12elseif (index("players", args[1]) == 1) 13 what = $string_utils:match_player(whatstr); 14 if ($command_utils:player_match_result(what, whatstr)[1]) 15 return; 16 endif 17else 18 player:tell(args[1], "? arg should be one of exits,inventory,players"); 19 return; 20endif 21if ((!valid(what)) && $match(whatstr, "^[0-9]+$")) 22 what = toobj(whatstr); 23endif 24if ($command_utils:object_match_failed(what, whatstr)) 25 return; 26endif 27while (index(verb, ".parent") == (dot + 1)) 28 what = parent(what); 29 dot = dot + 7; 30endwhile 31if (dot >= length(verb)) 32 player:tell("=> ", what, " (", what.name, ")"); 33elseif (!(value = $code_utils:eval_d(tostr("return ", what, verb[dot + 1..length(verb)], ";")))[1]) 34 player:tell_lines(value[2]); 35elseif (typeof(val = value[2]) == OBJ) 36 player:tell("=> ", val, " ", ((val < #0) && (val >= #-3)) ? $list_utils:assoc(val, {{$nothing, "<$nothing>"}, {$ambiguous_match, "<$ambiguous_match>"}, {$failed_match, "<$failed_match>"}})[2] | (valid(val) ? ("(" + val.name) + ")" | "<invalid>")); 37elseif (typeof(val) == ERR) 38 player:tell("=> ", $code_utils:error_name(val), " [", val, "]"); 39else 40 player:tell("=> ", $string_utils:print(value[2])); 41endif
party
Referenced by
none
Source
1"where's the party?"; 2"doesn't query about a room if you're already there."; 3"checks for custom :accept and :is_unlocked_for on the room and, if not present, tries calling :accept before giving the query."; 4rooms = {}; 5for p in (connected_players()) 6 if ($object_utils:connected(p)) 7 if ((valid(loc = p.location) && $object_utils:isa(loc, $generic_editor)) && (l = p in loc.active)) 8 loc = loc.original[l]; 9 $command_utils:suspend_if_needed(0, "... generating party listing ..."); 10 endif 11 if (i = $list_utils:iassoc_suspended(loc, rooms)) 12 rooms[i] = {loc, rooms[i][2] - 1, {@rooms[i][3], p}, min(rooms[i][4], idle_seconds(p))}; 13 else 14 rooms = {@rooms, {loc, -1, {p}, idle_seconds(p)}}; 15 endif 16 endif 17endfor 18rooms = $list_utils:sort_suspended(0, rooms, $list_utils:slice(rooms, 4)); 19rooms = $list_utils:sort_suspended(0, rooms, $list_utils:slice(rooms, 2)); 20for r in (rooms) 21 if (r[2] < -1) 22 player:tell(r[1].name, "(", r[1], ") --- ", $string_utils:from_seconds(r[4]), " idle, ", -r[2], " players:"); 23 l = tostr(" ", r[3][1].name, "(", r[3][1], ")"); 24 for p in (listdelete(r[3], 1)) 25 s = tostr(p.name, "(", p, ")"); 26 if ((length(s) + length(l)) > 72) 27 player:tell(l, ","); 28 l = " "; 29 else 30 l = tostr(l, ", "); 31 endif 32 l = l + s; 33 endfor 34 player:tell(l); 35 if (player.location == r[1]) 36 player:tell("You are already in this location."); 37 elseif (((a = $object_utils:has_verb(r[1], "accept")) && (a[1] != $room)) || ((u = $object_utils:has_verb(r[1], "is_unlocked_for")) && (u[1] != $root_class))) 38 player:tell("This room may have funky security apparatus."); 39 if ($command_utils:yes_or_no("Go there?")) 40 player:teleport(player, r[1]); 41 return; 42 endif 43 elseif (!r[1]:accept(player)) 44 player:tell("That location will not let you in."); 45 elseif ($command_utils:yes_or_no("Go there?")) 46 player:teleport(player, r[1]); 47 return; 48 endif 49 endif 50endfor 51player:tell("No more parties.");
@dump(old)
Referenced by
none
Source
1"@dump something [with [id=...] [noprops] [noverbs] [create]]"; 2"This spills out all properties and verbs on an object, calling suspend at appropriate intervals."; 3" id=#nnn -- specifies an idnumber to use in place of the object's actual id (for porting to another MOO)"; 4" noprops -- don't show properties."; 5" noverbs -- don't show verbs."; 6" create -- indicates that a @create command should be generated and all of the verbs be introduced with @verb rather than @args; the default assumption is that the object already exists and you're just doing this to have a look at it."; 7set_task_perms(player); 8dobj = player:my_match_object(dobjstr); 9if ($command_utils:object_match_failed(dobj, dobjstr)) 10 return; 11endif 12if (prepstr && (prepstr != "with")) 13 player:notify(tostr("Usage: ", verb, " something [with [id=...] [noprops] [noverbs] [create]]")); 14 return; 15endif 16targname = tostr(dobj); 17options = {"props", "verbs"}; 18create = 0; 19if (iobjstr) 20 for o in ($string_utils:explode(iobjstr)) 21 if (index(o, "id=") == 1) 22 targname = o[4..length(o)]; 23 elseif (o in {"noprops", "noverbs"}) 24 options = setremove(options, o[3..length(o)]); 25 elseif (o in {"create"}) 26 create = 1; 27 endif 28 endfor 29endif 30if (create) 31 parent = parent(dobj); 32 pstring = tostr(parent); 33 for p in (properties(#0)) 34 if (#0.(p) == parent) 35 pstring = "$" + p; 36 endif 37 endfor 38 player:notify(tostr("@create ", pstring, " named ", dobj.name, ":", $string_utils:from_list(dobj.aliases, ","))); 39endif 40for p in (("props" in options) ? properties(dobj) | {}) 41 pquoted = $string_utils:print(p); 42 info = property_info(dobj, p); 43 value = dobj.(p); 44 if (create) 45 uvalue = (typeof(value) == LIST) ? "{}" | 0; 46 player:notify(tostr("@prop ", targname, ".", pquoted, " ", uvalue || $string_utils:print_suspended(value), " ", info[2] || "\"\"", (info[1] == dobj.owner) ? "" | tostr(" ", info[1]))); 47 if (uvalue && value) 48 player:notify(tostr(";", targname, ".(", pquoted, ") = ", $string_utils:print_suspended(value))); 49 endif 50 else 51 if (info[2] != "rc") 52 player:notify(tostr("@chmod ", targname, ".", pquoted, " ", info[2])); 53 endif 54 if (info[1] != dobj.owner) 55 player:notify(tostr("@chown ", targname, ".", pquoted, " ", info[1])); 56 endif 57 player:notify(tostr(";", targname, ".(", pquoted, ") = ", $string_utils:print_suspended(value))); 58 endif 59 $command_utils:suspend_if_needed(0); 60endfor 61for a in (("props" in options) ? $object_utils:ancestors(dobj) | {}) 62 for p in (properties(a)) 63 $command_utils:suspend_if_needed(1); 64 pquoted = $string_utils:print(p); 65 value = dobj.(p); 66 avalue = a.(p); 67 if (typeof(value) == ERR) 68 player:notify(tostr("\"", targname, ".(", pquoted, ") => ", $code_utils:error_name(value), " (", value, ")")); 69 elseif ((typeof(avalue) == ERR) || (value != avalue)) 70 player:notify(tostr(";", targname, ".(", pquoted, ") = ", $string_utils:print_suspended(value))); 71 endif 72 endfor 73 $command_utils:suspend_if_needed(1); 74endfor 75if (!("verbs" in options)) 76 return; 77endif 78player:notify(""); 79v = tostr(0); 80while ((info = verb_info(dobj, v)) || (info == E_PERM)) 81 if (index(info[3], "(")) 82 player:tell("Skipping ", dobj, ":\"", v, "\"..."); 83 else 84 suspend(1); 85 if (typeof(info) == ERR) 86 player:notify(tostr("\"", dobj, ":", v, " --- ", info, "\";")); 87 else 88 if (i = index(vname = info[3], " ")) 89 vname = vname[1..i - 1]; 90 endif 91 if (vname[1] != "*") 92 vname = strsub(vname, "*", ""); 93 endif 94 args = verb_args(dobj, v); 95 prep = (args[2] in {"any", "none"}) ? args[2] | $code_utils:short_prep(args[2]); 96 perms = (info[2] != ((args == {"this", "none", "this"}) ? "rxd" | "rd")) ? info[2] || "\"\"" | ""; 97 if (create) 98 if (info[1] == dobj.owner) 99 tail = perms ? tostr(" ", perms) | ""; 100 else 101 tail = tostr(" ", perms || info[2], " ", info[1]); 102 endif 103 player:notify(tostr("@verb ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3], tail)); 104 else 105 player:notify(tostr("@args ", targname, ":\"", info[3], "\" ", args[1], " ", prep, " ", args[3])); 106 if (info[1] != dobj.owner) 107 player:notify(tostr("@chown ", targname, ":", vname, " ", info[1])); 108 endif 109 if (perms) 110 player:notify(tostr("@chmod ", targname, ":", vname, " ", perms)); 111 endif 112 endif 113 if (code = verb_code(dobj, v, 1, 1)) 114 player:notify(tostr("@program ", targname, ":", vname)); 115 for c in (code) 116 player:notify(c); 117 $command_utils:suspend_if_needed(0); 118 endfor 119 player:notify_lines({".", ""}); 120 endif 121 endif 122 endif 123 if (index(tostr(" ", info[3], " "), " * ")) 124 "... oh shit, we have a * verb. may as well forget trying to list..."; 125 "... the rest; they're invisible. set v to something nonstring."; 126 v = E_TYPE; 127 else 128 v = tostr(tonum(v) + 1); 129 endif 130 $command_utils:suspend_if_needed(0); 131endwhile
heartbeat
Referenced by
- #5803:heartbeat line 10:
this:heartbeat
Source
1":heartbeat([n]) -- starts up a task to print out the time every n minutes from now on unless you've been active during that minute. Good for people who like to stay idle for long periods of time and who want to have some means of dating occurences that show up at random in their EMACS buffers..."; 2set_task_perms(this); 3if ((((caller != this) && (caller_perms() != this)) && (!caller_perms().wizard)) || (!(this in connected_players()))) 4 return; 5elseif ((idle_seconds(this) > 60) && (output_delimiters(this) == {"", ""})) 6 notify(this, tostr(" - - - ", this:ctime()[12..16], " - - -")); 7endif 8n = args ? tonum(args[1]) | 1; 9fork ((60 * n) - (time() % (60 * n))) 10 this:heartbeat(n); 11endfork
@edit(old)
Referenced by
none
Source
1"a slightly more intelligent @edit."; 2"Calls the verb editor on verbs, the note editor on properties, and on anything else assumes it's an object for which you want to edit the .description."; 3if ((!args) || $code_utils:parse_verbref(args[1])) 4 $verb_editor:invoke(argstr, verb); 5elseif ($code_utils:parse_propref(dobjstr)) 6 $note_editor:invoke(dobjstr, verb); 7elseif (dobjstr) 8 $note_editor:invoke(dobjstr + ".description", verb); 9else 10 ((player in $note_editor.active) ? $note_editor | $verb_editor):invoke(dobjstr, verb); 11endif
all_connect_places
Referenced by
none
Source
1if (!$perm_utils:controls(caller_perms(), this)) 2 return E_PERM; 3endif 4return this.all_connect_places;
linesplit(old)
Referenced by
none
Source
1":linesplit(line,len) => list of substrings of line"; 2"used by :notify to split up long lines if .linelen>0"; 3line = args[1]; 4len = args[2]; 5cline = {}; 6while (length(line) > len) 7 cutoff = rindex(line[1..len], " "); 8 if (nospace = cutoff < ((4 * len) / 5)) 9 cutoff = len + 1; 10 nospace = line[cutoff] != " "; 11 endif 12 cline = {@cline, line[1..cutoff - 1]}; 13 line = (nospace ? " " | "") + line[cutoff..length(line)]; 14endwhile 15return {@cline, line};
notify(old)
Referenced by
none
Source
1set_task_perms(caller_perms()); 2line = args[1]; 3if (this.pagelen && (this in connected_players())) 4 if ((player == this) && (this.linetask[2] != task_id())) 5 "...player has started a new task..."; 6 "....linetask[2] is the taskid of the most recent player task..."; 7 if (this.linetask[2] != this.linetask[1]) 8 this.linesleft = this.pagelen - 2; 9 endif 10 this.linetask[2] = task_id(); 11 endif 12 "... digest the current line..."; 13 if (this.linelen) 14 lbuf = {@this.linebuffer, @this:linesplit(line, this.linelen)}; 15 else 16 lbuf = {@this.linebuffer, line}; 17 endif 18 llen = length(lbuf); 19 "... print out what we can..."; 20 if (this.linesleft) 21 howmany = min(this.linesleft, llen); 22 for l in (lbuf[1..howmany]) 23 notify(this, l); 24 endfor 25 this.linesleft = this.linesleft - howmany; 26 lbuf = lbuf[howmany + 1..llen]; 27 llen = llen - howmany; 28 endif 29 if (llen) 30 "...see if we need to say ***More***"; 31 if (this.linetask[1] != this.linetask[2]) 32 "....linetask[1] is the taskid of the most recent player task"; 33 "... for which ***More*** was printed..."; 34 this.linetask[1] = this.linetask[2]; 35 fork (0) 36 notify(this, strsub(this.more_msg, "%n", tostr(length(this.linebuffer)))); 37 endfork 38 endif 39 if (llen > 500) 40 "...way too much saved text, flush some of it..."; 41 lbuf = {"*** buffer overflow, lines flushed ***", @lbuf[llen - 99..llen]}; 42 endif 43 endif 44 this.linebuffer = lbuf; 45elseif (this.linelen) 46 for l in (this:linesplit(line, this.linelen)) 47 notify(this, l); 48 endfor 49else 50 notify(this, line); 51endif
@pagelength(old)
Referenced by
none
Source
1set_task_perms(player); 2"@pagelength number -- sets page buffering to that many lines (or 0 to turn off page buffering)"; 3if (!dobjstr) 4 notify(player, tostr("Usage: ", verb, " <number>")); 5 notify(player, tostr("Current page length is ", player.pagelen, ".")); 6 return; 7elseif (0 > (newlen = tonum(dobjstr))) 8 notify(player, "Page length can't be a negative number."); 9 return; 10elseif (newlen == 0) 11 player.pagelen = 0; 12 notify(player, "Page buffering off."); 13elseif (newlen < 5) 14 player.pagelen = 5; 15 notify(player, "Too small. Setting it to 5."); 16else 17 notify(player, tostr("Page length is now ", player.pagelen = newlen, ".")); 18endif 19if (this.linebuffer) 20 notify(this, strsub(this.more_msg, "%n", tostr(length(this.linebuffer)))); 21 player.linetask = {task_id(), task_id()}; 22 player.linesleft = 0; 23else 24 player.linetask = {0, task_id()}; 25 player.linesleft = player.pagelen - 2; 26endif
@more(old)
Referenced by
none
Source
1set_task_perms(player); 2if (!(lbuf = this.linebuffer)) 3 this.linesleft = this.pagelen - 2; 4 notify(this, "*** No more ***"); 5elseif (index("flush", dobjstr || "x") == 1) 6 this.linesleft = this.pagelen - 2; 7 notify(this, tostr("*** Flushed *** ", length(lbuf), " lines")); 8 this.linebuffer = {}; 9elseif ((index("rest", dobjstr || "x") == 1) || (!this.pagelen)) 10 this.linesleft = this.pagelen - 2; 11 for l in (lbuf) 12 notify(this, l); 13 endfor 14 this.linebuffer = {}; 15else 16 howmany = min(this.pagelen - 2, llen = length(lbuf = this.linebuffer)); 17 for l in (lbuf[1..howmany]) 18 notify(this, l); 19 endfor 20 this.linesleft = (this.pagelen - 2) - howmany; 21 this.linebuffer = lbuf[howmany + 1..llen]; 22 if (howmany < llen) 23 notify(this, strsub(this.more_msg, "%n", tostr(llen - howmany))); 24 this.linetask[1] = task_id(); 25 endif 26endif 27this.linetask[2] = task_id();
+*
Referenced by
none
Source
1"Copied from Rog (#4292):+ Tue Jun 28 16:19:42 1994 PDT"; 2"Copied from Puff (#1449):+ Sun Apr 25 11:31:11 1993 PDT"; 3"Copied from Experimental Guinea Pig Class with Even More Features of Dubious Utility (#5803):+ by Jonny (#3920) Fri Apr 23 20:04:14 1993 PDT"; 4"<Quinn's Page-Emote>"; 5"Usage: +<player> <emote>"; 6" or: ++<player> <emote> (possesive format)"; 7""; 8"Example: +Voluptua licks hungrily at your inner thigh."; 9" Shows: (from Nut-Hut) Glub licks hungrily at your inner thigh."; 10if ((!args) && (length(verb) < 3)) 11 player:tell("Usage: + <player> <emote> || ++ <player> <emote>"); 12 return; 13endif 14nargs = length(args); 15vl = length(verb); 16if ((verb == "+") || (verb == "++")) 17 sf = args[1]; 18 ms_str = $string_utils:first_word(argstr)[2]; 19else 20 sf = verb[rindex(verb, "+") + 1..vl]; 21 ms_str = argstr; 22endif 23who = $string_utils:match_player(sf); 24if ($command_utils:player_match_result(who, sf)[1]) 25 return; 26else 27 "pr = this:ep_prefix_msg();"; 28 pr = $string_utils:pronoun_sub(this.remote_emote_prefix_msg); 29 msg = tostr(player.name, (index(verb, "++") == 1) ? "" | " ", ms_str); 30 result = who:receive_page(tostr(pr, " ", msg)); 31 if (result == 2) 32 player:tell(who.name, " isn't connected."); 33 elseif (result == 1) 34 if (player:pc_option("remote_emote_noecho")) 35 player:tell(who.name, " has received your emote."); 36 else 37 player:tell("(to ", who.name, ") ", msg); 38 endif 39 else 40 player:tell(result); 41 player:tell(who.name, " refused your emote."); 42 endif 43endif
eprint*
Referenced by
none
Source
1"eprint <expression>"; 2"eprint<n> <expression>"; 3"does a pretty-print trying to confine the result to n columns (n defaults to .linelen)"; 4set_task_perms(player); 5e = #28888:eparse(argstr); 6width = tonum(verb[7..length(verb)]) || ((player:linelen() || 79) - 5); 7if (typeof(e) == STR) 8 player:notify(tostr(e)); 9elseif (e[2] <= width) 10 player:notify($string_utils:space(5) + #28888:print(e, "")); 11else 12 p = #28888:expand("", e, "", width, 0); 13 player:notify_lines(#28888:indent(5, @p)); 14endif
@prettylist
Referenced by
none
Source
1set_task_perms(player); 2if (!(spec = $code_utils:parse_verbref(args[1]))) 3 player:tell("Usage: ", verb, " <object>:<verb>"); 4 return; 5endif 6if ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 7 return; 8endif 9what = object; 10vname = spec[2]; 11while ((what != $nothing) && ((code = verb_code(what, vname, 1)) == E_VERBNF)) 12 what = parent(what); 13endwhile 14if (code == E_VERBNF) 15 player:notify("That object does not define that verb."); 16elseif (typeof(code) == ERR) 17 player:notify(tostr(code)); 18elseif (code == {}) 19 player:notify("That verb has not been programmed."); 20else 21 if (what != object) 22 player:notify(tostr("Object ", object, " does not define that verb, but its ancestor ", what, " does.")); 23 endif 24 maxlen = (player:linelen() * 7) / 8; 25 for line in (code) 26 player:notify_lines(#28888:do_line(line, maxlen)); 27 endfor 28 player:notify("."); 29endif
@qsend(old)
Referenced by
none
Source
1"Syntax: @quicksend player-or-mail-folder [subject=<text>] [<message>]"; 2"Sends player a quick message, without having to go to the mailroom."; 3"If no message is given, prompt for lines of message."; 4if (!args) 5 player:tell("Usage: @quicksend player-or-mail-folder message"); 6 return E_INVARG; 7endif 8recipient = $mail_agent:match_recipient(args[1]); 9if (this != player) 10 player:tell("You can't use ", this.pp, " @quicksend verb."); 11 return E_PERM; 12elseif ($mail_agent:match_failed(recipient, args[1])) 13 return; 14else 15 if ((length(args) > 1) && ((eq = index(args[2], "=")) && (index("subject", args[2][1..eq - 1]) == 1))) 16 subject = $string_utils:trim(args[2][eq + 1..length(args[2])]); 17 ws = $string_utils:word_start(argstr); 18 argstr = argstr[1..ws[1][2]] + argstr[ws[2][2] + 1..length(argstr)]; 19 args = listdelete(args, 2); 20 else 21 subject = ""; 22 endif 23 if (length(args) > 1) 24 message = argstr[index(argstr, " ") + 1..length(argstr)]; 25 else 26 if (!(subject || player:mail_option("nosubject"))) 27 player:tell("Subject:"); 28 subject = $command_utils:read(); 29 endif 30 player:tell("Enter lines of message:"); 31 message = $command_utils:read_lines(); 32 if (typeof(message) == ERR) 33 player:tell(message); 34 return; 35 elseif (!(message || subject)) 36 player:tell("Won't send a blank message."); 37 return; 38 endif 39 endif 40 result = $mail_agent:send_message(this, recipient, subject, message); 41 if (result && result[1]) 42 player:tell("@quicksend message sent to ", $mail_agent:name_list(@listdelete(result, 1)), "."); 43 else 44 player:tell("@quicksend not sent, for reasons the programmer doesn't fully comprehend."); 45 endif 46endif
@qreply(old)
Referenced by
none
Source
1"@qreply <msg> [on *<recipient>] [<flags>...]"; 2"like @reply only, as in @qsend, we prompt for the message text using "; 3"$command_utils:read_lines() rather than invoking the $mail_editor."; 4set_task_perms(who = valid(caller_perms()) ? caller_perms() | player); 5if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1))) 6 "...garbled..."; 7elseif ($seq_utils:size(p[2]) != 1) 8 player:notify("You can only answer *one* message at a time."); 9elseif (LIST != typeof(flags_replytos = $mail_editor:check_answer_flags(@p[4]))) 10 player:notify_lines({tostr("Usage: ", verb, " [message-# [on <recipient>]] [flags...]"), "where flags include any of:", " all reply to everyone", " sender reply to sender only", " include include the original message in your reply", " noinclude don't include the original in your reply"}); 11elseif ("include" in flags_replytos[1]) 12 player:notify("Can't include message on a @quickreply"); 13else 14 this:set_current_folder(p[1]); 15 if (to_subj = $mail_editor:parse_msg_headers(p[1]:messages_in_seq(p[2])[1][2], flags_replytos[1])) 16 player:notify(tostr("To: ", $mail_agent:name_list(@to_subj[1]))); 17 player:notify(tostr("Subject: ", hdrs = to_subj[2])); 18 if (replytos = flags_replytos[2]) 19 player:notify(tostr("Reply-to: ", $mail_agent:name_list(@replytos))); 20 hdrs = {hdrs, replytos}; 21 endif 22 player:notify("Enter lines of message:"); 23 message = $command_utils:read_lines(); 24 if (message) 25 result = $mail_agent:send_message(this, to_subj[1], hdrs, message); 26 if (result && result[1]) 27 player:notify(tostr("@quickreply message sent to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 28 else 29 player:notify("@quickreply not sent."); 30 endif 31 elseif (typeof(message) == ERR) 32 player:notify(tostr(message)); 33 else 34 player:notify("Won't send blank message."); 35 endif 36 endif 37endif
@nprop*erty
Referenced by
none
Source
1set_task_perms(player); 2nargs = length(args); 3usage = tostr("Usage: ", verb, " <object>.<prop-name> [<init_value> [<perms> [<owner>]]]"); 4if ((nargs < 1) || (!(spec = $code_utils:parse_propref(args[1])))) 5 player:notify(usage); 6 return; 7endif 8object = player:my_match_object(spec[1]); 9name = spec[2]; 10if ($command_utils:object_match_failed(object, spec[1])) 11 return; 12endif 13if (nargs < 2) 14 value = 0; 15else 16 valstr = argstr[$string_utils:word_start(argstr)[2][1]..length(argstr)]; 17 if (!((e = $string_utils:end_expression(valstr)) && ((v = player:eval_cmd_string(valstr[1..e])) && v[1]))) 18 player:notify(tostr("Syntax error in initial value.")); 19 return; 20 endif 21 value = v[2]; 22 args = {args[1], value, @$string_utils:words(valstr[e + 1..length(valstr)])}; 23 nargs = length(args); 24endif 25perms = (nargs < 3) ? "rc" | args[3]; 26if (nargs < 4) 27 owner = player; 28else 29 owner = $string_utils:match_player(args[4]); 30 if ($command_utils:player_match_result(owner, args[4])[1]) 31 return; 32 endif 33endif 34if (nargs > 4) 35 player:notify(usage); 36 return; 37endif 38e = $add_property(object, name, value, {owner, perms}); 39if (typeof(e) != ERR) 40 player:notify(tostr("Property added with value ", $string_utils:print(object.(name), 1), ".")); 41elseif (e != E_INVARG) 42 player:notify(tostr(e)); 43elseif ($object_utils:has_property(object, name)) 44 player:notify(tostr("Property ", object, ".", name, " already exists.")); 45else 46 for i in [1..length(perms)] 47 if (!index("rcw", perms[i])) 48 player:notify(tostr("Unknown permission bit: ", perms[i])); 49 return; 50 endif 51 endfor 52 "...the only other possibility..."; 53 player:notify("Property is already defined on one or more descendents."); 54 player:notify(tostr("Try @check-prop ", args[1])); 55endif
@nlist
Referenced by
none
Source
1"@list <obj>:<verb> [<dobj> <prep> <iobj>] [with(out) parens|numbers] [ranges] [upload]"; 2set_task_perms(player); 3pflag = player:prog_option("list_all_parens"); 4nflag = !player:prog_option("list_no_numbers"); 5upload = 0; 6argspec = {}; 7range = {}; 8spec = args ? $code_utils:parse_verbref(args[1]) | E_INVARG; 9args = spec ? listdelete(args, 1) | E_INVARG; 10while (args) 11 if (args[1] && ((index("without", args[1]) == 1) || (args[1] == "wo"))) 12 "...w,wi,wit,with => 1; wo,witho,withou,without => 0..."; 13 fval = !index(args[1], "o"); 14 if (index("parentheses", args[2]) == 1) 15 pflag = fval; 16 args = args[3..length(args)]; 17 elseif (index("numbers", args[2]) == 1) 18 nflag = fval; 19 args = args[3..length(args)]; 20 else 21 player:notify(tostr(args[1], " WHAT?")); 22 args = E_INVARG; 23 endif 24 elseif (index("0123456789", args[1][1]) || (index(args[1], "..") == 1)) 25 if (E_INVARG == (s = $seq_utils:from_string(args[1]))) 26 player:notify(tostr("Garbled range: ", args[1])); 27 args = E_INVARG; 28 else 29 range = $seq_utils:union(range, s); 30 args = listdelete(args, 1); 31 endif 32 elseif (index("upload", args[1]) == 1) 33 upload = 1; 34 args = listdelete(args, 1); 35 elseif (argspec) 36 "... second argspec? Not likely ..."; 37 player:notify(tostr(args[1], " unexpected.")); 38 args = E_INVARG; 39 elseif (typeof(pas = $code_utils:parse_argspec(@args)) == LIST) 40 argspec = pas[1]; 41 argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2]; 42 args = pas[2]; 43 else 44 "... argspec is bogus ..."; 45 player:notify(tostr(pas)); 46 args = E_INVARG; 47 endif 48endwhile 49if (upload) 50 nflag = 0; 51endif 52if (args == E_INVARG) 53 player:notify(tostr("Usage: ", verb, " <object>:<verb> [<dobj> <prep> <iobj>] [with|without parentheses|numbers]")); 54 return; 55elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 56 return; 57endif 58what = object; 59if (argspec) 60 vnum = $code_utils:find_verb_named(what, spec[2], 0); 61 while ((vnum < 0) ? valid(what = parent(what)) | (verb_args(what, vname = tostr(vnum)) != argspec)) 62 vnum = $code_utils:find_verb_named(what, spec[2], vnum + 1); 63 endwhile 64 code = (vnum < 0) ? E_VERBNF | verb_code(what, vname, pflag); 65else 66 vname = spec[2]; 67 while (valid(what) && ((code = verb_code(what, vname, pflag)) == E_VERBNF)) 68 what = parent(what); 69 endwhile 70endif 71if (code == E_VERBNF) 72 player:notify(tostr("That object does not define that verb", argspec ? " with those args." | ".")); 73elseif (typeof(code) == ERR) 74 player:notify(tostr(code)); 75elseif (code == {}) 76 player:notify("That verb has not been programmed."); 77elseif (!(lineseq = range ? $seq_utils:intersection(range, {1, length(code) + 1}) | {1, length(code) + 1})) 78 player:notify("That verb has no lines in that range."); 79else 80 if ((what != object) && (!upload)) 81 player:notify(tostr("Object ", object, " does not define that verb", argspec ? " with those args" | "", ", but its ancestor ", what, " does.")); 82 endif 83 info = verb_info(what, vname); 84 vargs = verb_args(what, vname); 85 if (index(vargs[2], "/")) 86 vargs[2] = upload ? $code_utils:short_prep(vargs[2]) | tostr("(", vargs[2], ")"); 87 endif 88 vargs = $string_utils:from_list(vargs, " "); 89 vnames = $string_utils:print(info[3]); 90 if (upload) 91 (what != object) && player:notify(tostr("@verb ", object, ":", vnames, " ", vargs, " ", info[2] || "\"\"")); 92 player:notify(tostr("@program ", object, ":", spec[2], " ", argspec ? vargs | "")); 93 (what != object) && player:notify(tostr("/* Definition from ", what, " */")); 94 else 95 player:notify(tostr(what, ":", vnames, " ", vargs)); 96 endif 97 for k in [1..length(lineseq) / 2] 98 for i in [lineseq[(2 * k) - 1]..lineseq[2 * k] - 1] 99 if (nflag) 100 player:notify(tostr(" "[1..i < 10], i, ": ", code[i])); 101 else 102 player:notify(code[i]); 103 endif 104 $command_utils:suspend_if_needed(0); 105 endfor 106 endfor 107 if (upload) 108 player:notify("."); 109 endif 110endif
@nn(old)
Referenced by
none
Source
1"@nn -- reads the first new message on the first mail_recipient (in .current_message) where new mail exists."; 2set_task_perms(player); 3cm = this.current_message; 4cm[1..2] = {}; 5for n in (cm) 6 if ((n[3] < n[1].last_msg_date) && ((nlength = n[1]:length_all_msgs()) && ((next = n[1]:length_date_le(n[3]) + 1) <= nlength))) 7 this:set_current_folder(folder = n[1]); 8 this._mail_task = task_id(); 9 cur = folder:display_seq_full({next, next + 1}, tostr("Message %d", " on ", $mail_agent:name(folder), ":")); 10 this:set_current_message(folder, @cur); 11 return; 12 endif 13endfor 14player:tell("No News (is good news)");
page
Referenced by
Source
1"Copied from Puff (#1449):multipage Sun Apr 25 11:37:19 1993 PDT"; 2"Copied from Experimental Guinea Pig Class with Even More Features of Dubious Utility (#5803):page by Geust (#24442) Mon Apr 19 17:40:02 1993 PDT"; 3"Usage: page <player[s]>[ [with ]<message>]"; 4"If paging multiple players, the list must be in quotation marks."; 5"Send a usage message if no arguments are given."; 6nargs = length(args); 7if (nargs < 1) 8 player:notify(tostr("Usage: ", verb, " <player[s]> [[with ]<message>]")); 9 return; 10endif 11"Parse and match the names of the recipients."; 12who_all = $string_utils:match_player(names = $string_utils:explode(args[1])); 13if ($command_utils:player_match_result(who_all, names)[1]) 14 return; 15endif 16who_all = $list_utils:remove_duplicates(who_all); 17"Check for gagged recipients."; 18if (gagged = $set_utils:intersection(this.gaglist, who_all)) 19 if (length(gagged) > 1) 20 player:notify(tostr("You have ", $string_utils:title_list(gagged), " @gagged. If you paged them, they wouldn't be able to answer you.")); 21 else 22 player:notify($string_utils:pronoun_sub("You have %n @gagged. If you paged %o, %s wouldn't be able to answer you.", gagged[1])); 23 endif 24 return; 25endif 26"Get the pager's page_origin_msg."; 27header = player:page_origin_msg(); 28"Build the text of the message."; 29text = ""; 30if (nargs > 1) 31 if (argstr[1] == "\"") 32 argstr[1..1] = ""; 33 argstr[1..index(argstr, "\"") + 1] = ""; 34 else 35 argstr[1..index(argstr, " ")] = ""; 36 endif 37 while (argstr[1] == " ") 38 argstr[1..1] = ""; 39 endwhile 40 if ((index(argstr, "with ") == 1) && (nargs > 2)) 41 argstr[1..5] = ""; 42 while (argstr[1] == " ") 43 argstr[1..1] = ""; 44 endwhile 45 endif 46 if (((length(argstr) > 1) && (index(argstr, "\"") == 1)) && (rindex(argstr, "\"") == length(argstr))) 47 "Strip excess quotes."; 48 argstr = argstr[2..$ - 1]; 49 endif 50 text = tostr($string_utils:pronoun_sub(($string_utils:index_delimited(header, player.name) ? "%S" | "%N") + " %<pages>, \""), argstr, "\""); 51endif 52iobj = player; 53"Get the vanilla page_echo_msg for comparison later."; 54if (length(who_all) == 1) 55 dobj = who_all[1]; 56endif 57pem = $player.page_echo_msg; 58"Send the page."; 59echoes = {}; 60refused = {}; 61unconnected = {}; 62for who in (who_all) 63 "for pronoun_sub's benefit..."; 64 dobj = who; 65 text ? response = who:receive_page(header, text) | (response = who:receive_page(header)); 66 if (response == 0) 67 refused = {@refused, who}; 68 elseif (response == 2) 69 unconnected = {@unconnected, who}; 70 elseif (response == 1) 71 echoes = {@echoes, who}; 72 else 73 echoes = {@echoes, who}; 74 endif 75endfor 76"Get the page_echo_msg for each player who received the page."; 77vanilla = {}; 78idle = {}; 79for who in (echoes) 80 "Get the page_echo_msg"; 81 dobj = who; 82 echo = who:page_echo_msg(); 83 if (echo == pem) 84 "If the echo is equal to a vanilla, standard echo, add the player to vanilla."; 85 vanilla = {@vanilla, who}; 86 elseif (subs = match(echo, "Your message has been sent%. %(.+%( seems? to be .+%)%), though%.")) 87 "If it's vanilla with an idle message on the end, add the player to vanilla, but also add the player and idle message to idle."; 88 vanilla = {@vanilla, who}; 89 idle = {@idle, tostr(substitute("%1", subs))}; 90 else 91 "If it's neither, then pass the echo to the pager."; 92 player:notify(echo); 93 endif 94endfor 95"Build a message to handle the players with vanilla echoes."; 96if (length(who_all) > 1) 97 vanilla_echo = ("Your message was received by " + $string_utils:title_list(vanilla)) + "."; 98else 99 vanilla_echo = "Your message has been sent."; 100endif 101if (length(idle) == 1) 102 vanilla_echo = ((vanilla_echo + " ") + idle[1]) + ", though."; 103elseif (length(idle) > 1) 104 vanilla_echo = (vanilla_echo + $string_utils:english_listc(idle)) + ", though."; 105endif 106if (length(vanilla) > 0) 107 "Tell it to the player."; 108 player:notify(vanilla_echo); 109endif 110"Handle refused messages."; 111if (length(refused) > 0) 112 player:notify(tostr($string_utils:title_listc(refused), " refused your message.")); 113endif 114"Handle unconnected messages."; 115if (length(unconnected) > 1) 116 player:notify(tostr($string_utils:title_listc(unconnected), " are not currently logged in.")); 117elseif (length(unconnected) == 1) 118 message = unconnected[1]:page_absent_msg(); 119 if (typeof(message) != STR) 120 message = $string_utils:pronoun_sub("%N is not currently logged in.", unconnected[1]); 121 endif 122 player:notify(message); 123endif
page(old)
Referenced by
none
Source
1"Usage: page <player[s]>[ [with ]<message>]"; 2"If paging multiple players, the list must be in quotation marks."; 3nargs = length(args); 4if (nargs < 1) 5 player:notify(tostr("Usage: ", verb, " <player[s]> [[with ]<message>]")); 6 return; 7endif 8who_all = $string_utils:match_player(names = $string_utils:explode(args[1])); 9if ($command_utils:player_match_result(who_all, names)[1]) 10 return; 11endif 12who_all = $list_utils:remove_duplicates(who_all); 13for who in (who_all) 14 if (!(who in connected_players())) 15 unconnected = {1}; 16 if (msg = who:page_absent_msg()) 17 player:notify(msg); 18 else 19 unconnected = setadd(unconnected, who); 20 endif 21 endif 22endfor 23if (unconnected) 24 if (unconnected = listdelete(unconnected, 1)) 25 if (length(unconnected) > 1) 26 player:notify(tostr($string_utils:title_listc(unconnected), " are not currently logged in.")); 27 else 28 player:notify($string_utils:pronoun_sub("%N %<is> not currently logged in."), unconnected[1]); 29 endif 30 endif 31 return; 32endif 33if (gagged = $set_utils:intersection(this.gaglist, who_all)) 34 if (length(gagged) > 1) 35 player:notify(tostr("You have ", $string_utils:title_list(gagged), " @gagged. If you paged them, they wouldn't be able to answer you.")); 36 else 37 player:notify($string_utils:pronoun_sub("You have %n @gagged. If you paged %o, %s wouldn't be able to answer you.", gagged[1])); 38 endif 39 return; 40endif 41text = ""; 42if (nargs > 1) 43 if (argstr[1] == "\"") 44 argstr[1..1] = ""; 45 argstr[1..index(argstr, "\"") + 1] = ""; 46 else 47 argstr[1..index(argstr, " ")] = ""; 48 endif 49 while (argstr[1] == " ") 50 argstr[1..1] = ""; 51 endwhile 52 if ((index(argstr, "with ") == 1) && (nargs > 2)) 53 argstr[1..5] = ""; 54 while (argstr[1] == " ") 55 argstr[1..1] = ""; 56 endwhile 57 endif 58 text = tostr($string_utils:pronoun_sub(($string_utils:index_delimited(player:page_origin_msg(), player.name) ? "%S" | "%N") + " %<pages>, \""), argstr, "\""); 59endif 60iobj = player; 61pem = $player.page_echo_msg; 62standard_echo = 0; 63for who in (who_all) 64 "for pronoun_sub's benefit..."; 65 dobj = who; 66 header = player:page_origin_msg(); 67 text ? who:receive_page(header, text) | who:receive_page(header); 68 echo = who:page_echo_msg(); 69 if (echo == pem) 70 standard_echo = standard_echo + 1; 71 elseif (subs = $match(echo, "Your message has been sent%. %(.+%( seems? to be .+%)%), though%.")) 72 standard_echo = standard_echo + 1; 73 if (idles) 74 idles = listappend(idles, tostr(who:title(), substitute("%2", subs))); 75 else 76 idles = {substitute("%1", subs)}; 77 endif 78 else 79 player:notify(echo); 80 endif 81endfor 82if (standard_echo) 83 if (standard_echo > 1) 84 pem = tostr("Your message has been sent (", standard_echo, " times)."); 85 endif 86 if (idles) 87 pem = tostr(pem, " ", $string_utils:english_list(idles), ", though."); 88 endif 89 player:notify(pem); 90endif
plus(old)
Referenced by
none
Source
1"Copied from Experimental Guinea Pig Class with Even More Features of Dubious Utility (#5803):+ by Jay (#3920) Tue Jun 28 16:05:11 1994 PDT"; 2"Copied from Puff (#1449):+ Sun Apr 25 11:31:11 1993 PDT"; 3"Copied from Experimental Guinea Pig Class with Even More Features of Dubious Utility (#5803):+ by Jonny (#3920) Fri Apr 23 20:04:14 1993 PDT"; 4"<Quinn's Page-Emote>"; 5"Usage: +<player> <emote>"; 6" or: ++<player> <emote> (possesive format)"; 7""; 8"Example: +Voluptua licks hungrily at your inner thigh."; 9" Shows: (from Nut-Hut) Glub licks hungrily at your inner thigh."; 10if ((!args) && (length(verb) < 3)) 11 player:tell("Usage: + <player> <emote> || ++ <player> <emote>"); 12 return; 13endif 14nargs = length(args); 15vl = length(verb); 16if ((verb == "+") || (verb == "++")) 17 sf = args[1]; 18 ms_str = $string_utils:from_list(args[2..nargs], " "); 19else 20 sf = verb[rindex(verb, "+") + 1..vl]; 21 ms_str = argstr; 22endif 23who = $string_utils:match_player(sf); 24if ($command_utils:player_match_result(who, sf)[1]) 25 return; 26else 27 "pr = this:ep_prefix_msg();"; 28 pr = $string_utils:pronoun_sub(this.remote_emote_prefix_msg); 29 div = index(verb, "++") ? "" | " "; 30 result = who:receive_page(tostr(pr, " ", player.name, div, ms_str)); 31 if (result == 2) 32 player:tell(who.name, " isn't connected."); 33 elseif (result == 1) 34 player:tell(who.name, " has received your emote."); 35 else 36 player:tell(result); 37 player:tell(who.name, " refused your emote."); 38 endif 39endif
pc_option
Referenced by
none
Source
1return 0;
make_current_message(old)
Referenced by
none
Source
1":make_current_message(recipient[,index])"; 2"starts a new current_message record for recipient."; 3"index, if given, indicates where recipient is to be"; 4" placed (n = at or after nth entry in .current_message)."; 5recip = args[1]; 6for x in (listdelete(this.idle_messages, 1)) 7 if (x[1] == recip) 8 this.idle_messages = setremove(this.idle_messages, x); 9 this.current_message = setadd(this.current_message, x); 10 endif 11endfor 12cm = this.current_message; 13if (length(args) > 1) 14 i = max(2, min(args[2], length(cm))); 15else 16 i = 0; 17endif 18if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 19 return $error:raise(E_PERM); 20elseif (recip == this) 21 "...self..."; 22elseif (j = $list_utils:iassoc(recip, cm)) 23 "...already present..."; 24 if (i) 25 if (j < i) 26 this.current_message = {@cm[1..j - 1], @cm[j + 1..i], cm[j], @cm[i + 1..length(cm)]}; 27 elseif (j > (i + 1)) 28 this.current_message = {@cm[1..i], cm[j], @cm[i + 1..j - 1], @cm[j + 1..length(cm)]}; 29 endif 30 endif 31else 32 this.current_message = listappend(cm, {recip, 0, 0}, @i ? {i} | {}); 33endif
set_current_message(old)
Referenced by
none
Source
1":set_current_message(recipient[,number[,date]])"; 2"Returns the new {number,last-read-date} pair for recipient."; 3if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 4 return $error:raise(E_PERM); 5endif 6recip = args[1]; 7for x in (listdelete(this.idle_messages, 1)) 8 if (x[1] == recip) 9 this.idle_messages = setremove(this.idle_messages, x); 10 this.current_message = setadd(this.current_message, x); 11 endif 12endfor 13number = {@args, E_NONE}[2]; 14date = {@args, 0, 0}[3]; 15cm = this.current_message; 16if (recip == this) 17 this.current_message[2] = max(date, cm[2]); 18 if (number != E_NONE) 19 this.current_message[1] = number; 20 endif 21 return this.current_message[1..2]; 22elseif (i = $list_utils:iassoc(recip, cm)) 23 return (this.current_message[i] = {recip, (number == E_NONE) ? cm[i][2] | number, max(date, cm[i][3])})[2..3]; 24else 25 entry = {recip, (number != E_NONE) && number, date}; 26 this.current_message = {@cm, entry}; 27 return entry[2..3]; 28endif
kill_current_message(old)
Referenced by
none
Source
1":kill_current_message(recipient)"; 2"entirely forgets current message for this recipient..."; 3"Returns true iff successful."; 4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 5 return $error:raise(E_PERM); 6elseif ((recip = args[1]) == this) 7 return; 8elseif (i = $list_utils:iassoc(recip, cm = this.current_message)) 9 this.current_message = listdelete(cm, i); 10 return 1; 11elseif (i = $list_utils:iassoc(recip, cm = this.idle_messages)) 12 this.idle_messages = listdelete(cm, i); 13 return 1; 14endif
get_current_message(old)
Referenced by
none
Source
1":get_current_message([recipient])"; 2" => {msg_num, last_read_date} for the given recipient."; 3" => 0 if we have no record of that recipient."; 4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 5 $error:raise(E_PERM); 6elseif ((!args) || (args[1] == this)) 7 if (length(this.current_message) < 2) 8 "Whoops, this got trashed---fix it up!"; 9 this.current_message = {0, time(), @this.current_message}; 10 endif 11 return this.current_message[1..2]; 12elseif (a = $list_utils:assoc_suspended(args[1], this.current_message)) 13 return a[2..3]; 14elseif (a = $list_utils:assoc_suspended(args[1], this.idle_messages)) 15 return a[2..3]; 16else 17 return 0; 18endif
update_idle_lists(old)
Referenced by
none
Source
1if ((caller == this) || $perm_utils:controls(caller_perms(), this)) 2 set_task_perms(this.owner); 3 thr = time() - this:mail_option("idle_threshold"); 4 idle = this.idle_messages; 5 current = this.current_message; 6 c = $list_utils:slice(current[3..length(current)], 1); 7 for x in (listdelete(idle, 1)) 8 if (x[1] in c) 9 idle = setremove(idle, x); 10 endif 11 endfor 12 for x in ({@idle, @current}) 13 if (typeof(x) == LIST) 14 rcpt = x[1]; 15 if ($mail_agent:is_recipient(rcpt)) 16 if (rcpt == $news) 17 this.idle_messages = setremove(this.idle_messages, x); 18 this.current_message = setadd(this.current_message, x); 19 elseif ((rcpt.last_msg_date < thr) && (rcpt.last_msg_date <= x[3])) 20 this.idle_messages = setadd(this.idle_messages, x); 21 this.current_message = setremove(this.current_message, x); 22 else 23 this.idle_messages = setremove(this.idle_messages, x); 24 this.current_message = setadd(this.current_message, x); 25 endif 26 else 27 this.idle_messages = setremove(this.idle_messages, x); 28 this.current_message = setremove(this.current_message, x); 29 player:notify(tostr("Bogus recipient ", rcpt, " removed from your subscription lists.")); 30 endif 31 $command_utils:suspend_if_needed(0); 32 endif 33 endfor 34 if (verb == "@update-mail") 35 player:notify("Idle mail lists updated."); 36 endif 37 this.idle_messages[1] = time(); 38endif
check_mail_lists(old)
Referenced by
none
Source
1set_task_perms((caller == this) ? this.owner | caller_perms()); 2which = {}; 3thr = (n = this:mail_option("idle_threshold")) ? time() - n | 0; 4all = verb == "@subscribed"; 5if ((chk = this:mail_option("idle_check")) && ((chk + this.idle_messages[1]) < time())) 6 this:update_idle_lists(); 7endif 8cm = this.current_message; 9cm[1..2] = ((verb == "@rn") || (verb == "@rn-full")) ? {{this, @cm[1..2]}} | {}; 10fast = this:mail_option("fast_check") && (verb != "@rn-full"); 11for n in (cm) 12 rcpt = n[1]; 13 if (rcpt == $news) 14 "... $news is handled separately ..."; 15 elseif ($mail_agent:is_recipient(rcpt)) 16 if (thr && (rcpt.last_msg_date < thr)) 17 this.idle_messages = setadd(this.idle_messages, n); 18 this.current_message = setremove(this.current_message, n); 19 endif 20 if (fast) 21 if (rcpt == this) 22 nmsgs = ((m = this.messages) && (m[length(m)][2][1] > n[3])) ? $maxint | 0; 23 else 24 nmsgs = (n[1].last_msg_date > n[3]) ? $maxint | 0; 25 endif 26 else 27 nmsgs = n[1]:length_date_gt(n[3]); 28 endif 29 if (nmsgs || all) 30 which = {@which, {n[1], nmsgs}}; 31 endif 32 else 33 player:notify(tostr("Bogus recipient ", rcpt, " removed from .current_message.")); 34 this.current_message = setremove(this.current_message, n); 35 endif 36 $command_utils:suspend_if_needed(0); 37endfor 38if (which) 39 player:notify(tostr((verb == "@subscribed") ? "You are subscribed to the following" | "There is new activity on the following", (length(which) > 1) ? " lists:" | " list:")); 40 for w in (which) 41 name = (w[1] == this) ? " me" | $mail_agent:name(w[1]); 42 player:notify(tostr($string_utils:left(" " + name, 40), " ", (w[2] == $maxint) ? "has" | w[2], " new message", (w[2] == 1) ? "" | "s")); 43 $command_utils:suspend_if_needed(0); 44 endfor 45 if (all) 46 for w in (this.idle_messages) 47 if (typeof(w) == LIST) 48 player:notify(tostr($string_utils:left(" " + $mail_agent:name(w[1]), 40), " [dormant]")); 49 $command_utils:suspend_if_needed(0); 50 endif 51 endfor 52 endif 53 if (verb != "check_mail_lists") 54 player:notify("-- End of listing"); 55 endif 56elseif ((verb == "@rn") || (verb == "@rn-full")) 57 player:notify("No new activity on any of your lists."); 58elseif (verb == "@subscribed") 59 player:notify("You aren't subscribed to any mailing lists."); 60endif 61return which;