ANSI PC #95

Parent #6Owner #36Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: ANSI PC, apc

18 verbs · 60 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
ansi_optionthis none thisrxd#956
@ansi-o*ptionsany any anyrd#9531
set_ansi_optionthis none thisrxd#9517
notifythis none thisrx#9561
linesplitthis none thisrxd#9518
@ansi-t*estnone none nonerd#955
set_namethis none thisrxd#9512
sayany any anyrx#9510
@who whoany any anyrx#959
at_itemthis none thisrxd#9526
@moreany none nonerd#9533
set_aliasesthis none thisrxd#9517
titlethis none thisrx#951
confuncthis none thisrxd#9522
@ansi-s*tatusany any anyrd#95103
@ansi-titleany any anyrd#9570
set_ansi_titlethis none thisrxd#9529
emoteany any anyrx#9510

Properties

PropertyDefinerFlagsOwnerValue
ansi_options#95r#36{}
replace_codes#95r#36{}
features#6r#36<clear>
previous_connection#6#2<clear>
email_address#6#2<clear>
last_disconnect_time#6r#2<clear>
help#6rc#36#96
more_msg#6rc#36<clear>
linetask#6r#36<clear>
linesleft#6r#36<clear>
linebuffer#6#36<clear>
pagelen#6r#36<clear>
owned_objects#6r#2<clear>
linelen#6r#36<clear>
current_folder#6c#36<clear>
all_connect_places#6#2<clear>
last_connect_place#6#2<clear>
brief#6rc#36<clear>
lines#6c#36<clear>
page_absent_msg#6rc#36<clear>
pq#6rc#36<clear>
pqc#6rc#36<clear>
page_origin_msg#6rc#36<clear>
page_echo_msg#6rc#36<clear>
edit_options#6rc#36<clear>
last_connect_time#6r#2<clear>
ownership_quota#6#36<clear>
gender#6rc#36<clear>
prc#6rc#36<clear>
ppc#6rc#36<clear>
poc#6rc#36<clear>
psc#6rc#36<clear>
pr#6rc#36<clear>
pp#6rc#36<clear>
po#6rc#36<clear>
ps#6rc#36<clear>
home#6rc#36#62
password#6#2<clear>
gaglist#6rc#36<clear>
paranoid#6rc#36<clear>
display_options#6rc#36<clear>
verb_subs#6rc#36<clear>
first_connect_time#6r#2<clear>
size_quota#6#36<clear>
last_password_time#6#2<clear>
last_connect_attempt#6#2<clear>
page_count_start_time#6r#2<clear>
ping_task#6r#36<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#36<clear>
key#1c#360
aliases#1r#2{"ANSI PC", "apc"}
description#1rc#36"A player with the ability to see things in [red]c[bold][yellow]o[green]l[blue]o[purple]r[normal]."
object_size#1r#36{24511, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #6 generic player#102 subthing#1 Root Class

Children: #40 Generic Mail Receiving Player

Call graph

calls n95_0 #95:ansi_option n55_17 #55:assoc n95_0->n55_17 n95_1 #95:@ansi-o*ptions n56_4 #56:yes_or_no n95_1->n56_4 n32_36 #32:player_wrap_off n95_1->n32_36 n6_18 #6:tell n95_1->n6_18 n6_11 #6:notify_lines n95_1->n6_11 n68_6 #68:show n95_1->n68_6 n68_2 #68:parse n95_1->n68_2 n6_10 #6:notify n95_1->n6_10 n95_2 #95:set_ansi_option n95_1->n95_2 n42_0 #42:controls n95_2->n42_0 n32_32 #32:update_player_codes n95_2->n32_32 n95_3 #95:notify n95_3->n6_10 n95_3->n42_0 n95_4 #95:linesplit n95_3->n95_4 n32_1 #32:index n95_4->n32_1 n32_16 #32:cutoff_locs n95_4->n32_16 n95_5 #95:@ansi-t*est n95_5->n6_11 n95_5->n6_10 n20_3 #20:centre n95_5->n20_3 n6_13 #6:linelen n95_5->n6_13 n20_71 #20:redirect_ansi n95_5->n20_71 n95_6 #95:set_name n95_6->n6_10 n95_6->n42_0 n6_47 #6:set_name n95_6->n6_47 n32_3 #32:delete n95_6->n32_3 n95_7 #95:say n95_7->n6_18 n52_3 #52:has_callable_verb n95_7->n52_3 n20_73 #20:get_say_verb n95_7->n20_73 n59_39 #59:argstr n95_7->n59_39 n32_23 #32:terminate_normal n95_7->n32_23 n35_0 #35:verb_sub n95_7->n35_0 n32_29 #32:ansi_title n95_7->n32_29 n95_8 #95:@who n6_40 #6:@who n95_8->n6_40 n56_1 #56:player_match_result n95_8->n56_1 n20_20 #20:match_player n95_8->n20_20 n95_9 #95:at_item n95_9->n6_13 n95_9->n20_71 n32_0 #32:length n95_9->n32_0 n95_10 #95:@more n6_14 #6:@more n95_10->n6_14 n95_11 #95:set_aliases n95_11->n6_10 n95_11->n42_0 n95_11->n32_3 n6_48 #6:set_aliases n95_11->n6_48 n95_12 #95:title n102_4 #102:title n95_12->n102_4 n95_13 #95:confunc n95_13->n95_0 n95_13->n42_0 n95_13->n95_3 n95_13->n6_13 n95_13->n20_71 n52_5 #52:isa n95_13->n52_5 n50_68 #50:fill_string n95_13->n50_68 n6_1 #6:confunc n95_13->n6_1 n95_14 #95:@ansi-s*tatus n95_14->n56_4 n95_14->n6_18 n95_14->n6_11 n95_14->n6_10 n95_14->n6_13 n95_14->n50_68

Showing 48 of 63 verbs; 15 not shown.

Source

ansi_option

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

Source

1":ansi_option(name) => returns the value of the specified @ansi option";
2if ((a = args[1]) == "escape")
3return (i = $list_utils:assoc(a, this.ansi_options)) ? i[2] | 0;
4else
5return !(!(a in this.ansi_options));
6endif

@ansi-o*ptions

Spec any any anyFlags rdOwner #36Definer #95

Referenced by

none

Source

1"@ansi-option <option> [is] <value>   sets <option> to <value>";
2"@ansi-option <option>=<value>        sets <option> to <value>";
3"@ansi-option +<option>     sets <option>   (usually equiv. to <option>=1";
4"@ansi-option -<option>     resets <option> (equiv. to <option>=0)";
5"@ansi-option !<option>     resets <option> (equiv. to <option>=0)";
6"@ansi-option <option>      displays value of <option>";
7if ((args && (args[1] == "+html")) && (player.linelen > 0))
8if (!$command_utils:yes_or_no("Long URLs will not work with word wrap on. Do you REALLY NEED word wrap?"))
9$ansi_utils:player_wrap_off();
10else
11return player:tell("No change was made. Sorry, HTML will not parse correctly with word wrap turned on.");
12endif
13endif
14if (!args)
15player:notify_lines({"Current ANSI options:", "", @$ansi_options:show(this.ansi_options, $ansi_options.names)});
16return;
17elseif (typeof(presult = $ansi_options:parse(args)) == STR)
18player:notify(presult);
19return;
20else
21if (length(presult) > 1)
22if (typeof(sresult = this:set_ansi_option(@presult)) == STR)
23player:notify(sresult);
24return;
25elseif (!sresult)
26player:notify("No change.");
27return;
28endif
29endif
30player:notify_lines($ansi_options:show(this.ansi_options, presult[1]));
31endif

set_ansi_option

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

Source

1":set_ansi_option(oname,value)";
2"Changes the value of the named option.";
3"Returns a string error if something goes wrong.";
4if (!((caller == this) || $perm_utils:controls(caller_perms(), this)))
5return tostr(E_PERM);
6endif
7foo_options = "ansi_options";
8"...";
9if (typeof(s = #0.(foo_options):set(this.(foo_options), @args)) == STR)
10return s;
11elseif (s == this.(foo_options))
12return 0;
13else
14this.(foo_options) = s;
15$ansi_utils:update_player_codes(this);
16return 1;
17endif

notify

Spec this none thisFlags rxOwner #2Definer #95

Referenced by

Source

1if (!((caller == this) || $perm_utils:controls(caller_perms(), this)))
2return E_PERM;
3endif
4line = args[1];
5if (!valid(au = $ansi_utils))
6return pass(@args);
7elseif ("normal" in ((typeof(z = this.replace_codes) == NUM) ? au.replace_code_pointers[z] | z))
8line = au:terminate_normal(line);
9endif
10if (this.pagelen)
11if (!(this in connected_players()))
12"...drop it on the floor...";
13return 0;
14endif
15"...need wizard perms if this and this.owner are different, since...";
16"...only this can notify() and only this.owner can read .linebuffer...";
17if ((player == this) && (this.linetask[2] != task_id()))
18"...player has started a new task...";
19"....linetask[2] is the taskid of the most recent player task...";
20(this.linetask[2] != this.linetask[1]) && (this.linesleft = this.pagelen - 2);
21this.linetask[2] = task_id();
22endif
23"... digest the current line...";
24li = this.linelen ? this:linesplit(line, abs(this.linelen)) | {line};
25lbuf = {@this.linebuffer, @li};
26"... print out what we can...";
27if (this.linesleft)
28howmany = min(this.linesleft, length(lbuf));
29for l in (lbuf[1..howmany])
30au:notify(this, l);
31"notify(this, l, nocr);";
32endfor
33this.linesleft = this.linesleft - howmany;
34lbuf[1..howmany] = {};
35endif
36if (lbuf)
37"...see if we need to say ***More***";
38if (this.linetask[1] != this.linetask[2])
39"....linetask[1] is the taskid of the most recent player task";
40"...   for which ***More*** was printed...";
41this.linetask[1] = this.linetask[2];
42fork (0)
43notify(this, strsub(this.more_msg, "%n", tostr(length(this.linebuffer))));
44endfork
45endif
46llen = length(lbuf);
47if (llen > 500)
48"...way too much saved text, flush some of it...";
49lbuf[1..llen - 100] = {"*** buffer overflow, lines flushed ***"};
50endif
51endif
52this.linebuffer = lbuf;
53else
54if (this.linelen > 0)
55for l in (this:linesplit(line, this.linelen))
56au:notify(this, l);
57endfor
58else
59au:notify(this, line);
60endif
61endif

linesplit

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

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 = {};
6au = $ansi_utils;
7"..this should eventually return E_RANGE or \"\" and stop...";
8while (z = au:cutoff(line, 1, len + 1))
9cutoff = au:rindex(z[1..length(z) - 1], " ");
10if (nospace = cutoff < ((4 * len) / 5))
11cutoff = len + 1;
12nospace = index(au:cutoff(line, cutoff, cutoff), " ");
13endif
14q = au:cutoff_locs(line, 1, cutoff - 1, 1);
15cline = {@cline, line[q[1]..q[2]]};
16line[q[1]..q[2]] = nospace ? " " | "";
17endwhile
18return {@cline, line};

@ansi-t*est

Spec none none noneFlags rdOwner #36Definer #95

Referenced by

none

Source

1"Usage:  @ansi-test";
2"Displays a screen that uses all of the ANSI codes possible.  Useful for testing which codes your terminal program is capable of displaying.";
3player:notify($string_utils:center(tostr(" ANSI Test Screen "), l = player:linelen(), "-"));
4player:notify_lines($ansi_utils.test_screen);
5player:notify($string_utils:space(l, "-"));

set_name

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

Source

1"This makes sure that people don't have color codes in their name. They shouldn't, anyway since it makes it hard to identify them (especially if they use black.)";
2if (!($perm_utils:controls(caller_perms(), this) || (caller == this)))
3return E_PERM;
4elseif (!is_player(this))
5"we don't worry about the names of player classes.";
6return pass(@args);
7elseif ((name = args[1]) != $ansi_utils:delete(name))
8player:notify("Sorry, you can't have color codes in your name. It messes up the db listings and people might not know how to address you if you didn't have your normal name as an alias. You can make a :title, though.");
9return E_INVARG;
10else
11return pass(@args);
12endif

say

Spec any any anyFlags rxOwner #36Definer #95

Referenced by

none

Source

1if ($object_utils:has_callable_verb(player.location, "say") != {#3})
2"Idiot-proofed it against porting wizards who change $room to something other than #3 (since :say would not be defined on $room.) Clueful wizards can change this.";
3return player.location:(verb)(@args);
4endif
5sayverb = $string_utils:get_say_verb(argstr);
6argstr = $code_utils:argstr(verb, args, argstr);
7au = $ansi_utils;
8argstr = au:terminate_normal(argstr);
9player:tell("You ", $you:verb_sub(sayverb), ", \"", argstr, "\"");
10player.location:announce(tostr(au:ansi_title(player), " ", $gender_utils:get_conj(sayverb, player), ", \"", argstr, "\""));

@who who

Spec any any anyFlags rxOwner #36Definer #95

Referenced by

none

Source

1"Redirects calls to @who to $ansi_utils:show_who_listing.";
2if (caller != player)
3return E_PERM;
4elseif (!(valid(au = $ansi_utils) && au.active))
5return pass(@args);
6endif
7argstr = prepstr = dobjstr = iobjstr = "";
8plyrs = args ? listdelete($command_utils:player_match_result($string_utils:match_player(args), args), 1) | connected_players();
9au:show_who_listing(plyrs);

at_item

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

none

Source

1"'at_item (<location>, <party>)' - Given a location and a list of the people there, return a string displaying the information. Override this if you want to change the format of each line of @at's output.";
2loc = args[1];
3party = args[2];
4su = $string_utils;
5number = this.at_number ? su:right(tostr(loc), 7) + " " | "";
6room = su:left(valid(loc) ? loc.name | "[Nowhere]", this.at_room_width);
7($ansi_utils:length(room) > this.at_room_width) && (room = $ansi_utils:cutoff(room, 1, this.at_room_width));
8text = (number + room) + " ";
9if (party)
10filler = su:space(length(text) - 2);
11line = text;
12text = {};
13for who in (party)
14name = " " + (valid(who) ? who.name | "[Nobody]");
15if (($ansi_utils:length(line) + $ansi_utils:length(name)) > this:linelen())
16text = {@text, line};
17line = filler + name;
18else
19line = line + name;
20endif
21endfor
22text = {@text, line};
23else
24text = text + " [deserted]";
25endif
26return text;

@more

Spec any none noneFlags rdOwner #2Definer #95

Referenced by

none

Source

1if (player != this)
2"... somebody's being sneaky...";
3"... Can't do set_task_perms(player) since we need to be `this'...";
4"... to notify and `this.owner' to change +c properties...";
5return;
6elseif (!(valid(au = $ansi_utils) && au.active))
7return pass(@args);
8elseif (!(lbuf = this.linebuffer))
9this.linesleft = this.pagelen - 2;
10notify(this, "*** No more ***");
11elseif (index("flush", dobjstr || "x") == 1)
12this.linesleft = this.pagelen - 2;
13notify(this, tostr("*** Flushed ***  ", length(lbuf), " lines"));
14this.linebuffer = {};
15elseif ((index("rest", dobjstr || "x") == 1) || (!this.pagelen))
16this.linesleft = this.pagelen - 2;
17for l in (lbuf)
18au:notify(this, l);
19endfor
20this.linebuffer = {};
21else
22howmany = min(this.pagelen - 2, llen = length(lbuf = this.linebuffer));
23for l in (lbuf[1..howmany])
24au:notify(this, l);
25endfor
26this.linesleft = (this.pagelen - 2) - howmany;
27this.linebuffer = lbuf[howmany + 1..llen];
28if (howmany < llen)
29notify(this, strsub(this.more_msg, "%n", tostr(llen - howmany)));
30this.linetask[1] = task_id();
31endif
32endif
33this.linetask[2] = task_id();

set_aliases

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

none

Source

1"This makes sure that people don't have color codes in their aliases. They shouldn't, anyway since it makes it hard to identify them (especially if they use black.)";
2if (!($perm_utils:controls(caller_perms(), this) || (caller == this)))
3return E_PERM;
4elseif (!is_player(this))
5"we don't worry about the names of player classes.";
6return pass(@args);
7else
8for name in (aliases = args[1])
9if (name != $ansi_utils:delete(name))
10aliases = setremove(aliases, name);
11endif
12endfor
13if (aliases != args[1])
14player:notify("Sorry, you can't have color codes in your aliases.");
15endif
16return pass(aliases);
17endif

title

Spec this none thisFlags rxOwner #36Definer #95

Referenced by

none

Source

1return valid(au = $ansi_utils) ? au:ansi_title(this, pass(@args)) | pass(@args);

confunc

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

Source

1if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) && (caller != #0))
2return E_PERM;
3else
4au = $ansi_utils;
5if (au.active)
6this:notify(tostr("ANSI Version ", au.version, " is currently active.  Type \"?ansi-intro\" for more information."));
7endif
8if (((mess = au.status_message) && (!$object_utils:isa(this, $guest))) && (!this:ansi_option("no_connect_status")))
9fork (0)
10line = $string_utils:space((l = this:linelen()) - 2, "*");
11btmmsg = "Type \"@ansi-o +no_connect_status\" to ignore this message.";
12this:notify(line);
13for a in ((typeof(mess) == LIST) ? {"ANSI Message:", @mess, btmmsg} | {"ANSI Message: " + mess, btmmsg})
14for b in ($generic_editor:fill_string(a, l - 2))
15this:notify("* " + b);
16endfor
17endfor
18this:notify(line);
19endfork
20endif
21return pass(@args);
22endif

@ansi-s*tatus

Spec any any anyFlags rdOwner #36Definer #95

Referenced by

none

Source

1"Usage:";
2"  @ansi-status                   - Displays various information about the";
3"                                   status of the ANSI system.";
4"  @ansi-status version           - Only displays the version number.";
5"  @ansi-status message           - Only displays the ANSI message.";
6"Trusted users only:";
7"  @ansi-status activate          - Activates the ANSI system.";
8"  @ansi-status deactivate        - Deactivates the ANSI system.";
9"  @ansi-status message <message> - Sets the ANSI message to <message>.";
10"  @ansi-status input             - Same as 'message' but lets you input";
11"                                   more than one line.";
12"  @ansi-status clear             - Clears the ANSI message.";
13"  @ansi-status diagnostic        - Runs the ANSI self-diagnostic and";
14"                                   reports the results.";
15"  @ansi-status diagnostic fix    - Same as above but fixes anything it can.";
16"  @ansi-status update            - Updates all the caches, this should be";
17"                                   run every once in a while.  See";
18"                                   'help $ansi_utils:update_all' for more info.";
19au = $ansi_utils;
20if (args)
21subcommand = args[1];
22args[1..1] = {};
23else
24subcommand = "";
25endif
26trusts = au:trusts(player);
27show = 0;
28if (player != this)
29player:tell(E_PERM);
30elseif (!subcommand)
31player:notify_lines($ansi_utils:ansi_status());
32trusts && player:notify("You are trusted by the ANSI system.");
33show = 1;
34elseif (subcommand == "help")
35player:notify_lines($code_utils:verb_documentation());
36elseif (subcommand == "version")
37player:notify(tostr("Currently running ANSI Version ", au.version, "."));
38elseif (subcommand == "message")
39if (!args)
40show = 1;
41elseif (trusts)
42message = $string_utils:from_list(args, " ");
43au.status_message = message;
44player:notify("Message set to:  " + message);
45if ($command_utils:yes_or_no("Notify users?"))
46notify = tostr("The ANSI status message was just set by ", player.name, "; type \"@ansi-status message\" to see it.");
47for x in (setremove($object_utils:leaves_suspended($ansi_pc), player))
48x:tell(notify);
49endfor
50endif
51else
52player:notify("The message can only be set by trusted users, type \"@ansi-status message\" to see the message.");
53endif
54elseif (!trusts)
55player:notify(tostr("The subcommand \"", subcommand, "\" either doesn't exist or is limited to trusted users only."));
56elseif (subcommand == "input")
57player:notify("What do you want to set the message to?");
58message = $command_utils:read_lines();
59au.status_message = message;
60player:notify("Message set to:");
61player:notify_lines(message);
62if ($command_utils:yes_or_no("Notify users?"))
63notify = tostr("The ANSI status message was just set by ", player.name, "; type \"@ansi-status message\" to see it.");
64for x in (setremove($object_utils:leaves_suspended($ansi_pc), player))
65x:notify(notify);
66endfor
67endif
68elseif (subcommand == "clear")
69au.status_message = "";
70player:notify("Cleared status message.");
71elseif (subcommand in {"activate", "active", "on"})
72player:notify(au.active ? "The ANSI system is already active." | "The ANSI system has been activated.");
73au.active = 1;
74elseif (subcommand in {"deactivate", "deactive", "off"})
75player:notify(au.active ? "The ANSI system has been deactivated, type \"@ansi-status activate\" to reactivate it." | "The ANSI system is not active.");
76au.active = 0;
77elseif (subcommand == "diagnostic")
78status = au:self_diagnostic(fix = index(tostr(@args), "fix"), player);
79player:notify(tostr("Diagnostic completed, ", fix ? "fixed" | "found", " ", status, " problem", (status == 1) ? "" | "s", "."));
80elseif (subcommand == "update")
81player:notify("Updating caches...");
82au:update_all();
83player:notify("Done updating caches.");
84else
85player:notify("Invalid subcommand: " + subcommand);
86endif
87if (show)
88if (m = au.status_message)
89ml = player:linelen() - 14;
90lines = {};
91for a in ((typeof(m) == LIST) ? m | {m})
92for b in ($generic_editor:fill_string(a, ml))
93lines = {@lines, b};
94endfor
95endfor
96player:notify("ANSI message: " + lines[1]);
97for x in (listdelete(lines, 1))
98player:notify("              " + x);
99endfor
100else
101player:notify("There is no ANSI message set.");
102endif
103endif

@ansi-title

Spec any any anyFlags rdOwner #36Definer #95

Referenced by

none

Source

1"Usage:";
2"  @ansi-title                 - Displays your current ANSI title settings";
3"  @ansi-title <name>          - Displays the title you have set for <name>";
4"  @ansi-title <name> is <new> - Sets <new> as the title for <name>";
5"  @ansi-title is <new>        - Sets <new> as the title for your current name";
6"  @ansi-title <obj> is <new>  - Sets <new> as the title for the object";
7name = dobjstr || this.name;
8if (player != this)
9player:tell(E_PERM);
10elseif (((valid(dobj) && iobjstr) && (prepstr == "is")) && (player.wizard || (dobj.owner == player)))
11name = dobj.name;
12if ($object_utils:has_property(dobj, "ansi_title"))
13t = $ansi_utils:terminate_normal(iobjstr);
14dobj.ansi_title = {{name, t}};
15player:notify(tostr("The substring ", name, " will be replaced with ", t, "."));
16else
17player:notify("That doesn't have any ANSI title you can set.");
18endif
19elseif (!argstr)
20if (typeof(this.ansi_title) != LIST)
21player:notify("Your ANSI title seems to be screwed up, resetting it.");
22this:set_ansi_title({});
23elseif (!this.ansi_title)
24player:notify("You don't have any ANSI titles set.");
25else
26player:notify("Current ANSI title substrings:");
27l = player:linelen() - 21;
28for x in (this.ansi_title)
29z = $generic_editor:fill_string($string_utils:english_list((typeof(x[2]) == LIST) ? x[2] | {x[2]}), l);
30player:notify(tostr("   ", $string_utils:left(x[1], 15), " - ", z[1]));
31for i in (listdelete(z, 1))
32player:notify("                     " + i);
33endfor
34endfor
35player:notify(tostr("Your current name is set to ", $ansi_utils:ansi_title(player), "."));
36endif
37elseif (iobjstr && (prepstr != "is"))
38player:notify_lines($code_utils:verb_documentation());
39elseif (!prepstr)
40if (i = $list_utils:assoc(name, this.ansi_title))
41player:notify(tostr("The substring ", name, " will be replaced with ", i[2], "."));
42else
43player:notify(tostr("There is no set replacement for the substring ", name, "."));
44endif
45elseif ($ansi_utils:contains_codes(name))
46player:notify("The replacement string shouldn't contain ANSI codes.");
47else
48at = this.ansi_title;
49i = $list_utils:iassoc(name, at);
50if (iobjstr)
51if (i)
52at[i][2] = iobjstr;
53else
54at = listappend(at, {name, iobjstr});
55endif
56elseif (i)
57at = listdelete(at, i);
58endif
59if (typeof(result = this:set_ansi_title(at)) != ERR)
60if (iobjstr)
61player:notify(tostr("Substring ", name, " will be replaced with ", iobjstr, "."));
62else
63player:notify(tostr("Cleared substring ", name, "."));
64endif
65elseif (result == E_NACC)
66player:notify("The replacement string must be the same as the string replaced except for the ANSI strings.");
67else
68player:notify(tostr("Error: ", result));
69endif
70endif

set_ansi_title

Spec this none thisFlags rxdOwner #36Definer #95

Referenced by

Source

1":set_ansi_title (LIST title_list)";
2tl = args[1];
3if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
4return E_PERM;
5elseif (typeof(tl) != LIST)
6return E_INVARG;
7else
8au = $ansi_utils;
9for x in [1..length(tl)]
10if (!(((typeof(tl[x]) == LIST) && (length(tl[x]) == 2)) && (typeof(tl[x][1]) == STR)))
11return E_INVARG;
12elseif (typeof(tl[x][2]) == LIST)
13for y in [1..length(tl[x][2])]
14if (typeof(tl[x][2][y]) != STR)
15return E_INVARG;
16elseif (tl[x][1] != strsub(au:delete(tl[x][2][y]), " ", "_"))
17return E_NACC;
18else
19tl[x][2][y] = au:terminate_normal(tl[x][2][y]);
20endif
21endfor
22elseif (tl[x][1] != strsub(au:delete(tl[x][2]), " ", "_"))
23return E_NACC;
24else
25tl[x][2] = au:terminate_normal(tl[x][2]);
26endif
27endfor
28this.ansi_title = tl;
29endif

emote

Spec any any anyFlags rxOwner #36Definer #95

Referenced by

none

Source

1if ($object_utils:has_callable_verb(player.location, "say") != {#3})
2"Idiot-proofed it against porting wizards who change $room to something other than #3 (since :say would not be defined on $room.) Clueful wizards can change this.";
3return player.location:(verb)(@args);
4endif
5if (argstr && (argstr[1] == ":"))
6argstr[1..1] = "";
7else
8argstr[1..0] = " ";
9endif
10player.location:announce_all($ansi_utils:ansi_title(player), argstr);