command utilities #48
Aliases: Generic Utilities Package
19 verbs · 16 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
object_match_failed | this none this | rxd | #48 | 22 |
player_match_result player_match_failed | this none this | rxd | #48 | 45 |
read | this none this | rxd | #48 | 19 |
read_lines | this none this | rxd | #48 | 29 |
yes_or_no | this none this | rxd | #48 | 20 |
read_lines_escape | this none this | rxd | #48 | 43 |
suspend | this none this | rxd | #48 | 49 |
running_out_of_time | this none this | rxd | #48 | 3 |
suspend_if_needed sin | this none this | rxd | #48 | 17 |
dump_lines | this none this | rxd | #48 | 18 |
explain_syntax | this none this | rxd | #48 | 18 |
do_huh | this none this | rxd | #48 | 35 |
task_info | this none this | rxd | #48 | 12 |
init_for_core | this none this | rxd | #48 | 4 |
kill_if_laggy | this none this | rxd | #48 | 6 |
validate_feature | this none this | rxd | #48 | 5 |
sin_on | this none this | rxd | #48 | 17 |
sin_off | this none this | rxd | #48 | 1 |
tell_eta | this none this | rxd | #48 | 18 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
lag_samples | #48 | r | #361 | {} |
feature_task | #48 | | #29 | list of 9{610622534, "prognet", {"who"}, "who", #-3, "who", "", #-1, ""} |
sin_notify | #48 | rc | #361 | {#35757} |
megatrace | #48 | rc | #361 | {} |
run_megatrace | #48 | rc | #361 | 0 |
help_msg | #72 | rc | #361 | list of 38{"$command_utils is the repository for verbs that are of general usefulness to authors of all sorts of commands. For more details about any of these verbs, use `help $command_utils:<verb-name>'.", "", "Detecting and Handling Failures in Matching", "-------------------------------------------", ":object_match_failed(match_result, name)", " Test whether or not a :match_object() call failed and print messages if so.", ":player_match_failed(match_result, name)", " Test whether or not a :match_player() call failed and print messages if so.", ":player_match_result(match_results, names)", " ...similar to :player_match_failed, but does a whole list at once.", "", "Reading Input from the Player", "-----------------------------", ":read() -- Read one line of input from the player and return it.", ":yes_or_no([prompt])", " -- Prompt for and read a `yes' or `no' answer.", ":read_lines() -- Read zero or more lines of input from the player.", ":dump_lines(lines) ", " -- Return list of lines quoted so that feeding them to ", " :read_lines() will reproduce the original lines.", ":read_lines_escape(escapes[,help])", " -- Like read_lines, except you can provide more escapes", " to terminate the read.", "", "Feature Objects", "---------------", ":validate_feature -- compare command line against feature verb argument spec", "", "Utilities for Suspending", "------------------------", ":running_out_of_time()", " -- Return true if we're low on ticks or seconds.", ":suspend_if_needed(time)", " -- Suspend (and return true) if we're running out of time.", "", "Client Support for Lengthy Commands", "-----------------------------------", ":suspend(args) -- Handle PREFIX and SUFFIX for clients in long commands."} |
aliases | #1 | rc | #361 | <clear> |
description | #1 | rc | #361 | {"This is the command utilities utility package. See `help $command_utils' for more details."} |
object_size | #1 | r | #29 | {22112, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #72 Generic Utilities Package → #1 root
Children: none
Call graph
Source
object_match_failed
Referenced by
- #2:@create line 29:
$cu:object_match_failed - #2:@recycle line 5:
$command_utils:object_match_failed - #2:@recreate line 12:
$command_utils:object_match_failed - #2:@recreate line 28:
$command_utils:object_match_failed - #2:@unlock line 3:
$command_utils:object_match_failed - #2:@kids line 7:
$command_utils:object_match_failed - #2:@c*ontents line 12:
$command_utils:object_match_failed - #2:@par*ents line 10:
$command_utils:object_match_failed - #2:@location*s line 6:
$command_utils:object_match_failed - #2:@chparent line 2:
$command_utils:object_match_failed - #2:@chparent line 4:
$command_utils:object_match_failed - #2:@check-chp*arent line 7:
$command_utils:object_match_failed - #2:@check-chp*arent line 9:
$command_utils:object_match_failed - #2:@set*prop line 12:
$command_utils:object_match_failed - #2:@addalias*# line 37:
$command_utils:object_match_failed - #2:@addalias*# line 79:
$command_utils:object_match_failed - #2:@rmalias*# line 23:
$command_utils:object_match_failed - #2:@rmalias*# line 69:
$command_utils:object_match_failed - #2:@chmod*# line 97:
$command_utils:object_match_failed - #2:#* line 31:
$command_utils:object_match_failed - #2:@d*isplay line 30:
$command_utils:object_match_failed - #2:@s*how line 26:
$command_utils:object_match_failed - #2:@move line 21:
$command_utils:object_match_failed - #2:@add-feature line 14:
$command_utils:object_match_failed - #6:@rename*# line 12:
$command_utils:object_match_failed - #6:@rename*# line 43:
$command_utils:object_match_failed - #6:@rename*# line 61:
$command_utils:object_match_failed - #6:@desc*ribe line 3:
$command_utils:object_match_failed - #6:@mess*ages line 7:
$command_utils:object_match_failed - #6:ex*amine line 10:
$command_utils:object_match_failed - #8:p*ut line 8:
$command_utils:object_match_failed - #8:re*move line 7:
$command_utils:object_match_failed - #13:get_topic line 5:
$command_utils:object_match_failed - #13:dump_topic line 4:
$command_utils:object_match_failed - #33:ready line 38:
$cu:object_match_failed - #33:@random line 6:
$cu:object_match_failed - #40:note_match_failed line 8:
$command_utils:object_match_failed - #41:com*pile line 23:
$command_utils:object_match_failed - #41:parse_invoke line 23:
$command_utils:object_match_failed - #43:y*ank line 27:
$command_utils:object_match_failed - #43:y*ank line 56:
$command_utils:object_match_failed - #43:y*ank line 70:
$command_utils:object_match_failed - #49:@chown*# line 17:
$command_utils:object_match_failed - #49:@chown*# line 45:
$command_utils:object_match_failed - #49:@chown*# line 56:
$command_utils:object_match_failed - #49:@untoad line 7:
$command_utils:object_match_failed - #49:@corify line 11:
$command_utils:object_match_failed - #49:@old-grant line 31:
$command_utils:object_match_failed - #50:@prop*erty line 18:
$command_utils:object_match_failed - #50:@chmod*# line 96:
$command_utils:object_match_failed - #50:@args*# line 12:
$command_utils:object_match_failed - #50:@rmprop*erty line 8:
$command_utils:object_match_failed - #50:@verb line 13:
$command_utils:object_match_failed - #50:@rmverb*# line 4:
$command_utils:object_match_failed - #50:@copy line 18:
$command_utils:object_match_failed - #50:@copy line 24:
$command_utils:object_match_failed - #50:@copy line 28:
$command_utils:object_match_failed - #50:@prog*ram line 14:
$command_utils:object_match_failed - #50:@d*isplay line 30:
$command_utils:object_match_failed - #50:@s*how line 29:
$command_utils:object_match_failed - #50:@check-p*roperty line 6:
$command_utils:object_match_failed - #50:@clearp*roperty line 6:
$command_utils:object_match_failed - #50:@disown line 8:
$command_utils:object_match_failed - #50:@disown line 17:
$command_utils:object_match_failed - #50:@disown line 21:
$command_utils:object_match_failed - #50:@dump line 13:
$command_utils:object_match_failed - #50:@list*# line 71:
$command_utils:object_match_failed - #50:@verbs* line 19:
$command_utils:object_match_failed - #50:@exam*ine line 12:
$command_utils:object_match_failed - #50:@messages_old line 8:
$command_utils:object_match_failed - #50:_@prog line 14:
$command_utils:object_match_failed - #50:@desc*ribe line 3:
$command_utils:object_match_failed - #50:@add-feature line 13:
$command_utils:object_match_failed - #50:@remove-feature line 11:
$command_utils:object_match_failed - #50:@writeprop line 7:
$cu:object_match_failed - #50:@canedit line 62:
$command_utils:object_match_failed - #50:@disassemble line 6:
$command_utils:object_match_failed - #50:@chown*# line 28:
$command_utils:object_match_failed - #50:@chown*# line 71:
$command_utils:object_match_failed - #50:@chown*# line 101:
$command_utils:object_match_failed - #71:parse_dig_room line 10:
$command_utils:object_match_failed - #107:l*ook line 47:
$command_utils:object_match_failed - #107:l*ook line 60:
$command_utils:object_match_failed - #107:spare line 17:
$cu:object_match_failed - #113:@nnlist line 4:
$command_utils:object_match_failed - #312:@add-package line 3:
$command_utils:object_match_failed - #317:@addex line 17:
$command_utils:object_match_failed - #336:@* line 15:
$command_utils:object_match_failed
Source
1"Usage: object_match_failed(object, string)"; 2"Prints a message if string does not match object. Generally used after object is derived from a :match_object(string)."; 3{match_result, string} = args; 4tell = $perm_utils:controls(caller_perms(), player) ? "notify" | "tell"; 5if ((index(string, "#") == 1) && ($code_utils:toobj(string) != E_TYPE)) 6"...avoid the `I don't know which `#-2' you mean' message..."; 7if (!valid(match_result)) 8player:(tell)(tostr(string, " does not exist.")); 9endif 10return !valid(match_result); 11elseif (match_result == $nothing) 12player:(tell)("You must give the name of some object."); 13elseif (match_result == $failed_match) 14player:(tell)(tostr("I see no \"", string, "\" here.")); 15elseif (match_result == $ambiguous_match) 16player:(tell)(tostr("I don't know which \"", string, "\" you mean.")); 17elseif (!valid(match_result)) 18player:(tell)(tostr(match_result, " does not exist.")); 19else 20return 0; 21endif 22return 1;
player_match_result player_match_failed
Referenced by
- #2:@audit line 6:
$command_utils:player_match_result - #2:@count line 3:
$command_utils:player_match_result - #2:@countDB line 3:
$command_utils:player_match_result - #2:@measure line 40:
$command_utils:player_match_failed - #2:@measure line 76:
$command_utils:player_match_failed - #2:@features line 4:
$command_utils:player_match_failed - #2:@w*h*o line 4:
$command_utils:player_match_result - #2:#* line 22:
$command_utils:player_match_failed - #4:w*ho line 13:
$command_utils:player_match_result - #4:who(vanilla) line 6:
$command_utils:player_match_result - #6:@age line 8:
$command_utils:player_match_failed - #17:do_register line 9:
$command_utils:player_match_failed - #33:@add-notify line 8:
$command_utils:player_match_failed - #33:@add-notify line 21:
$command_utils:player_match_failed - #39:pri*nt line 3:
$command_utils:player_match_result - #43:lis*t line 16:
$command_utils:player_match_result - #49:@chown*# line 14:
$command_utils:player_match_result - #49:@programmer line 5:
$command_utils:player_match_result - #49:@toad line 17:
$command_utils:player_match_failed - #49:@quota line 8:
$command_utils:player_match_result - #49:kill_aux_wizard_parse line 19:
$command_utils:player_match_failed - #49:@net-who line 13:
$command_utils:player_match_result - #49:@newt line 9:
$command_utils:player_match_failed - #49:@unnewt line 8:
$command_utils:player_match_failed - #49:@new-password line 6:
$command_utils:player_match_failed - #49:@temp-newt line 4:
$command_utils:player_match_failed - #49:@deprog*rammer line 31:
$command_utils:player_match_failed - #49:@old-grant line 13:
$command_utils:player_match_failed - #50:@prop*erty line 42:
$command_utils:player_match_result - #50:@verb line 51:
$command_utils:player_match_result - #50:@forked line 17:
$command_utils:player_match_result - #50:@kill line 24:
$command_utils:player_match_result - #50:@pros*pectus line 4:
$command_utils:player_match_result - #50:@forked-v*erbose line 17:
$command_utils:player_match_result - #50:@find line 25:
$command_utils:player_match_result - #50:@chown*# line 13:
$command_utils:player_match_result - #89:@join_old line 12:
$command_utils:player_match_result
Source
1":player_match_failed(result,string)"; 2" is exactly like :object_match_failed(result,string)"; 3" except that its messages are more suitable for player searches."; 4":player_match_result(results,strings)"; 5" handles a list of results, also presumably from $string_utils:match_player(strings), printing messages to player for *each* of the nonmatching strings. It returns a list, an overall result (true if some string didn't match --- just like player_match_failed), followed by the list players that matched."; 6""; 7"An optional 3rd arg gives an identifying string to prefix to each of the nasty messages."; 8if (valid(player)) 9tell = $perm_utils:controls(caller_perms(), player) ? "notify" | "tell"; 10plyr = player; 11else 12tell = "notify"; 13plyr = $login; 14endif 15"..."; 16{match_results, strings, ?cmdid = ""} = args; 17pmf = verb == "player_match_failed"; 18if (typeof(match_results) == OBJ) 19match_results = {match_results}; 20strings = {strings}; 21endif 22pset = {}; 23bombed = 0; 24for i in [1..length(match_results)] 25if (valid(result = match_results[i])) 26pset = setadd(pset, match_results[i]); 27elseif (result == $nothing) 28"... player_match_result quietly skips over blank strings"; 29if (pmf) 30plyr:(tell)("You must give the name of some player."); 31bombed = 1; 32endif 33elseif (result == $failed_match) 34plyr:(tell)(tostr(cmdid, "\"", strings[i], "\" is not the name of any player.")); 35bombed = 1; 36elseif (result == $ambiguous_match) 37lst = $player_db:find_all(strings[i]); 38plyr:(tell)(tostr(cmdid, "\"", strings[i], "\" could refer to ", (length(lst) > 20) ? tostr("any of ", length(lst), " players") | $string_utils:english_list($list_utils:map_arg(2, $string_utils, "pronoun_sub", "%n (%#)", lst), "no one", " or "), ".")); 39bombed = 1; 40else 41plyr:(tell)(tostr(result, " does not exist.")); 42bombed = 1; 43endif 44endfor 45return pmf ? bombed | {bombed, @pset};
read
Referenced by
- #17:newt_player line 12:
$command_utils:read - #33:@quick*send line 44:
$command_utils:read - #39:parse_invoke line 17:
$command_utils:read - #49:@toad line 51:
$command_utils:read - #49:@deprog*rammer line 26:
$command_utils:read - #50:@receive-dump line 2:
$cu:read - #50:@receive-dump line 13:
$cu:read - #50:@receive-dump line 17:
$cu:read - #50:@port line 13:
$cu:read - #50:@port line 14:
$cu:read - #50:@rp-award line 16:
$cu:read - #95:@setup line 8:
$cu:read - #95:@setup line 14:
$cu:read - #95:@setup line 23:
$cu:read - #103:do_setup line 11:
$cu:read - #107:@setup line 10:
$command_utils:read - #107:@setup line 15:
$command_utils:read - #111:@setup line 24:
$cu:read - #111:@setup line 42:
$cu:read - #111:@setup line 44:
$cu:read - #174:display_menu line 14:
$cu:read - #202:@merge-icons line 18:
$cu:read - #293:_@comment line 34:
$command_utils:read - #293:_@vote line 25:
$command_utils:read - #293:_@type line 45:
$command_utils:read - #293:_@assign line 14:
$cu:read - #293:_@retitle line 17:
$command_utils:read - #293:_@annotate line 18:
$command_utils:read - #293:_@attach line 16:
$cu:read - #293:_@mailban line 25:
$command_utils:read - #293:_@commentban line 17:
$command_utils:read - #317:@addex line 33:
$cu:read - #334:addnote line 10:
$cu:read - #334:addnote line 28:
$cu:read - #334:addnote line 36:
$cu:read
Source
1"$command_utils:read() -- read a line of input from the player and return it"; 2"Optional argument is a prompt portion to replace `a line of input' in the prompt."; 3""; 4"Returns E_PERM if the current task is not a command task that has never called suspend()."; 5{?prompt = "a line of input"} = args; 6c = callers(); 7p = c[$][5]; 8p:notify(((((($ansi.cyan + $ansi.bold_on) + prompt) + " ") + $ansi.bold_off) + "[or `@abort' to abort.]") + $ansi.reset); 9try 10ans = read(); 11(!p.programmer) && (ans = $ansi:strip(ans)); 12if ($string_utils:trim(ans) == "@abort") 13p:notify(">> Command Aborted <<"); 14kill_task(task_id()); 15endif 16return ans; 17except error (ANY) 18return error[1]; 19endtry
read_lines
Referenced by
- #33:@@sendmail line 17:
$command_utils:read_lines - #33:@@sendmail line 21:
$command_utils:read_lines - #33:@@sendmail line 24:
$command_utils:read_lines - #33:@quick*send line 60:
$command_utils:read_lines - #39:init_session line 13:
$command_utils:read_lines - #43:enter line 4:
$command_utils:read_lines - #49:@log line 10:
$command_utils:read_lines - #50:@prog*ram line 85:
$command_utils:read_lines - #50:@assume-form line 15:
$cu:read_lines - #50:_@prog line 85:
$command_utils:read_lines - #50:@writeprop line 29:
$command_utils:read_lines - #84:@paste line 15:
$command_utils:read_lines - #84:@pasteto line 15:
$command_utils:read_lines
Source
1"$command_utils:read_lines([max]) -- read zero or more lines of input"; 2""; 3"Returns a list of strings, the (up to MAX, if given) lines typed by the player. Returns E_PERM if the current task is not a command task that has never called suspend()."; 4"In order that one may enter arbitrary lines, including \"@abort\" or \".\", if the first character in an input line is `.' and there is some nonwhitespace afterwords, the `.' is dropped and the rest of the line is taken verbatim, so that, e.g., \".@abort\" enters as \"@abort\" and \"..\" enters as \".\"."; 5{?max = 0} = args; 6c = callers(); 7p = c[$][5]; 8p:notify(tostr("[Type", max ? tostr(" up to ", max) | "", " lines of input; use `.' to end or `@abort' to abort the command.]")); 9ans = {}; 10while (1) 11try 12line = read(); 13if ((line[1..min(6, $)] == "@abort") && ((tail = line[7..$]) == $string_utils:space(tail))) 14p:notify(">> Command Aborted <<"); 15kill_task(task_id()); 16elseif ((!line) || (line[1] != ".")) 17ans = {@ans, line}; 18elseif ((tail = line[2..$]) == $string_utils:space(tail)) 19return ans; 20else 21ans = {@ans, tail}; 22endif 23if (max && (length(ans) >= max)) 24return ans; 25endif 26except error (ANY) 27return error[1]; 28endtry 29endwhile
yes_or_no
Referenced by
- #2:@recycle line 10:
$cu:yes_or_no - #2:@recycle line 15:
$command_utils:yes_or_no - #2:@chparent line 14:
$command_utils:yes_or_no - #2:@measure line 18:
$command_utils:yes_or_no - #2:@measure line 103:
$command_utils:yes_or_no - #2:@make-cliff line 14:
$command_utils:yes_or_no - #2:@make-door line 5:
$command_utils:yes_or_no - #2:@Make-stairs line 27:
$command_utils:yes_or_no - #2:@make-hole line 5:
$command_utils:yes_or_no - #6:@gender line 15:
$command_utils:yes_or_no - #6:@registerme line 30:
$command_utils:yes_or_no - #6:@registerme line 39:
$command_utils:yes_or_no - #6:resign_backup line 6:
$cu:yes_or_no - #9:repair line 6:
$command_utils:yes_or_no - #9:repair line 8:
$command_utils:yes_or_no - #9:repair line 10:
$command_utils:yes_or_no - #17:do_register line 18:
$command_utils:yes_or_no - #17:do_new_password line 17:
$command_utils:yes_or_no - #17:do_new_password line 23:
$command_utils:yes_or_no - #17:do_make_player line 18:
$command_utils:yes_or_no - #17:do_make_player line 27:
$command_utils:yes_or_no - #21:do_audit line 9:
$command_utils:yes_or_no - #33:@mail line 8:
$command_utils:yes_or_no - #33:@read line 12:
$command_utils:yes_or_no - #33:@rmm*ail line 6:
$command_utils:yes_or_no - #33:@subscribe*-quick line 19:
$command_utils:yes_or_no - #33:@netforw*ard line 15:
$command_utils:yes_or_no - #33:@resend line 47:
$command_utils:yes_or_no - #33:@read-all-new*-mail line 38:
$command_utils:yes_or_no - #37:convert_to_issue_list line 9:
$cu:yes_or_no - #38:_parse_from line 18:
$command_utils:yes_or_no - #40:note_text line 15:
$cu:yes_or_no - #43:invoke line 25:
$command_utils:yes_or_no - #49:@programmer line 8:
$command_utils:yes_or_no - #49:@blacklist line 61:
$command_utils:yes_or_no - #49:@blacklist line 62:
$command_utils:yes_or_no - #49:@blacklist line 92:
$command_utils:yes_or_no - #49:@blacklist line 93:
$command_utils:yes_or_no - #49:@blacklist line 125:
$command_utils:yes_or_no - #49:@blacklist line 140:
$command_utils:yes_or_no - #49:check_site_entries line 22:
$command_utils:yes_or_no - #49:check_site_entries line 40:
$command_utils:yes_or_no - #49:@shutdown line 16:
$command_utils:yes_or_no - #49:@recycle-recursive line 16:
$cu:yes_or_no - #49:@run-profiler line 11:
$cu:yes_or_no - #50:@pardon line 10:
$cu:yes_or_no - #50:@chatban line 13:
$cu:yes_or_no - #50:@port line 8:
$cu:yes_or_no - #50:@revert-form line 7:
$cu:yes_or_no - #50:@canedit line 80:
$cu:yes_or_no - #50:@adderror line 11:
$cu:yes_or_no - #50:@task*s line 261:
$cu:yes_or_no - #96:@initialize line 14:
$command_utils:yes_or_no - #111:@setup line 7:
$cu:yes_or_no - #113:@megasub*stitute line 37:
$cu:yes_or_no - #150:@log-beat line 4:
$cu:yes_or_no - #167:biz_disband line 7:
$cu:yes_or_no - #167:biz_disband line 26:
$cu:yes_or_no - #167:biz_disband line 33:
$cu:yes_or_no - #167:biz_resign line 5:
$cu:yes_or_no - #167:biz_promote line 16:
$cu:yes_or_no - #167:biz_demote line 21:
$cu:yes_or_no - #167:biz_voteout line 20:
$cu:yes_or_no - #167:biz_voteout line 53:
$cu:yes_or_no - #202:@merge-icons line 11:
$cu:yes_or_no - #293:_parse_to line 19:
$command_utils:yes_or_no - #293:_@comment line 18:
$cu:yes_or_no - #293:_@vote line 16:
$cu:yes_or_no - #293:_@type line 71:
$cu:yes_or_no - #293:_@assign line 22:
$cu:yes_or_no - #293:_@combine line 21:
$cu:yes_or_no - #293:_@annotate line 11:
$cu:yes_or_no - #293:_@attach line 12:
$cu:yes_or_no - #293:_@mailban line 27:
$cu:yes_or_no - #293:_@commentban line 19:
$cu:yes_or_no - #317:@whohas line 48:
$cu:yes_or_no - #317:@allitems line 23:
$cu:yes_or_no - #317:@countarmor line 14:
$cu:yes_or_no - #317:@ofind+ line 24:
$cu:yes_or_no - #317:@addex line 86:
$cu:yes_or_no - #317:@ff line 24:
$cu:yes_or_no - #334:del*ete line 32:
$command_utils:yes_or_no - #334:bury line 43:
$command_utils:yes_or_no
Source
1":yes-or-no([prompt]) -- prompts the player for a yes or no answer and returns a true value iff the player enters a line of input that is some prefix of \"yes\""; 2""; 3"Returns E_NONE if the player enters a blank line, E_INVARG, if the player enters something that isn't a prefix of \"yes\" or \"no\", and E_PERM if the current task is not a command task that has never called suspend()."; 4c = callers(); 5p = c[$][5]; 6p:notify(tostr(args ? args[1] + " " | "", ($ansi.cyan + "[ Enter 'yes' or 'no': ]") + $ansi.reset)); 7try 8ans = read(@((caller == p) || $perm_utils:controls(caller_perms(), p)) ? {p} | {}); 9if (ans = $string_utils:trim(ans)) 10if (ans == "@abort") 11p:notify(">> Command Aborted <<"); 12kill_task(task_id()); 13endif 14return (index("yes", ans) == 1) || ((index("no", ans) != 1) && E_INVARG); 15else 16return E_NONE; 17endif 18except error (ANY) 19return error[1]; 20endtry
read_lines_escape
Referenced by
- #2:@set-note-text line 2:
$command_utils:read_lines_escape - #33:@quickr*eply line 25:
$command_utils:read_lines_escape - #33:@quick*send line 53:
$command_utils:read_lines_escape - #50:@prog*ram line 89:
$command_utils:read_lines_escape - #50:_@prog line 89:
$command_utils:read_lines_escape
Source
1"$command_utils:read_lines_escape(escapes[,help]) -- read zero or more lines of input"; 2""; 3"Similar to :read_lines() except that help is available and one may specify other escape sequences to terminate the read."; 4" escapes should be either a string or list of strings; this specifies which inputs other from `.' or `@abort' should terminate the read (... don't use anything beginning with a `.')."; 5" help should be a string or list of strings to be printed in response to the player typing `?'; the first line of the help text should be a general comment about what the input text should be used for. Successive lines should describe the effects of the alternative escapes."; 6"Returns {end,list-of-strings-input} where end is the particular line that terminated this input or 0 if input terminated normally with `.'. Returns E_PERM if the current task is not a command task that has never called suspend(). "; 7"@abort and lines beginning with `.' are treated exactly as with :read_lines()"; 8{escapes, ?help = "You are currently in a read loop."} = args; 9c = callers(); 10p = c[$][5]; 11escapes = {".", "@abort", @(typeof(escapes) == LIST) ? escapes | {escapes}}; 12p:notify(tostr("[Type lines of input; `?' for help; end with `", $string_utils:english_list(escapes, "", "' or `", "', `", ""), "'.]")); 13ans = {}; 14escapes[1..0] = {"?"}; 15"... set up the help text..."; 16if (typeof(help) != LIST) 17help = {help}; 18endif 19help[2..1] = {"Type `.' on a line by itself to finish.", "Anything else with a leading period is entered with the period removed.", "Type `@abort' to abort the command completely."}; 20while (1) 21try 22line = read(); 23if ((trimline = $string_utils:trimr(line)) in escapes) 24if (trimline == ".") 25return {0, ans}; 26elseif (trimline == "@abort") 27p:notify(">> Command Aborted <<"); 28kill_task(task_id()); 29elseif (trimline == "?") 30p:notify_lines(help); 31else 32return {trimline, ans}; 33endif 34else 35if (line && (line[1] == ".")) 36line[1..1] = ""; 37endif 38ans = {@ans, line}; 39endif 40except error (ANY) 41return error[1]; 42endtry 43endwhile
suspend
Referenced by
none
Source
1"Suspend, using output_delimiters() in case a client needs to keep track"; 2"of the output of the current command."; 3"Args are TIME, amount of time to suspend, and optional (misnamed) OUTPUT."; 4"If given no OUTPUT, just do a suspend."; 5"If OUTPUT is neither list nor string, suspend and return output_delimiters"; 6"If OUTPUT is a list, it should be in the output_delimiters() format:"; 7" {PREFIX, SUFFIX}. Use these to handle that client stuff."; 8"If OUTPUT is a string, it should be SUFFIX (output_delimiters[2])"; 9""; 10"Proper usage:"; 11"The first time you want to suspend, use"; 12" output_delimiters = $command_utils:suspend(time, x);"; 13"where x is some non-zero number."; 14"Following, use"; 15" $command_utils:suspend(time, output_delimiters);"; 16"To wrap things up, use"; 17" $command_utils:suspend(time, output_delimiters[2]);"; 18"You'll probably want time == 0 most of the time."; 19"Note: Using this from verbs called by other verbs could get pretty weird."; 20{time, ?output = 0} = args; 21set_task_perms(caller_perms()); 22value = 0; 23if (!output) 24suspend(time); 25else 26if (typeof(output) == LIST) 27PREFIX = output[1]; 28SUFFIX = output[2]; 29if (PREFIX) 30player:tell(output[2]); 31endif 32suspend(time); 33if (SUFFIX) 34player:tell(output[1]); 35endif 36elseif (typeof(output) == STR) 37if (output) 38player:tell(output); 39endif 40else 41output = output_delimiters(player); 42suspend(time); 43if (output != {"", ""}) 44player:tell(output[1]); 45endif 46value = output; 47endif 48endif 49return output;
running_out_of_time
Referenced by
- #2:@countDB line 9:
$command_utils:running_out_of_time - #6:my_huh line 43:
$command_utils:running_out_of_time - #9:receive_batch line 9:
$command_utils:running_out_of_time - #9:renumber line 39:
$command_utils:running_out_of_time - #9:__fix line 12:
$command_utils:running_out_of_time - #11:prune line 38:
$command_utils:running_out_of_time - #17:_set_property_flags line 6:
$command_utils:running_out_of_time - #32:suspend_restart line 5:
$command_utils:running_out_of_time - #37:__fix line 8:
$command_utils:running_out_of_time - #38:rm_message_seq line 8:
$command_utils:running_out_of_time - #43:lis*t line 47:
$command_utils:running_out_of_time - #49:make-core-database line 76:
$command_utils:running_out_of_time - #49:mcd_2 line 21:
$command_utils:running_out_of_time - #49:@players line 32:
$command_utils:running_out_of_time - #49:__fix line 14:
$command_utils:running_out_of_time - #49:coredat line 45:
$command_utils:running_out_of_time - #50:@db*size line 5:
$command_utils:running_out_of_time - #50:@exam*ine line 49:
$command_utils:running_out_of_time - #50:@exam*ine line 58:
$command_utils:running_out_of_time - #51:find_verbs_containing line 16:
$command_utils:running_out_of_time - #51:_find_verbs_containing line 17:
$command_utils:running_out_of_time - #51:find_verbs_matching line 16:
$command_utils:running_out_of_time - #51:show_who_listing line 102:
$command_utils:running_out_of_time - #66:suspend_if_needed line 2:
$command_utils:running_out_of_time - #90:who_html line 111:
$command_utils:running_out_of_time
Source
1"Return true if we're running out of ticks or seconds."; 2return (ticks_left() < 4000) || (seconds_left() < 2); 3"If this verb is changed make sure to change :suspend_if_needed as well.";
suspend_if_needed sin
Referenced by
- #1:init_for_core line 4:
$command_utils:suspend_if_needed - #1:tell_lines_suspended line 5:
$command_utils:suspend_if_needed - #1:examine_verbs line 43:
$command_utils:suspend_if_needed - #1:named line 5:
$cu:sin - #1:occupants_suspended line 17:
$cu:sin - #1:occupants_suspended line 26:
$cu:sin - #2:@verify-owned line 10:
$command_utils:suspend_if_needed - #2:@check-chp*arent line 22:
$command_utils:suspend_if_needed - #2:@measure line 55:
$command_utils:suspend_if_needed - #2:@measure line 89:
$command_utils:suspend_if_needed - #2:?* line 42:
$command_utils:suspend_if_needed - #2:@ch*eck-full line 50:
$command_utils:suspend_if_needed - #2:tell_mytree line 57:
$cu:sin - #2:tell_mytree line 76:
$cu:sin - #2:@d*isplay line 150:
$command_utils:suspend_if_needed - #2:@d*isplay line 183:
$command_utils:suspend_if_needed - #3:player_integration_msg_backup line 14:
$cu:sin - #3:player_integration_msg_backup line 30:
$cu:sin - #3:broadcast_noise line 35:
$cu:sin - #3:broadcast_noise line 40:
$cu:sin - #3:_update_map line 18:
$cu:sin - #3:_update_map line 21:
$cu:sin - #3:_update_map line 29:
$cu:sin - #3:_update_map line 32:
$cu:sin - #3:spy_report line 6:
$cu:sin - #3:_link_map line 24:
$cu:sin - #3:_link_map line 28:
$cu:sin - #3:_room_map_list line 25:
$cu:sin - #3:_descriptive_map_old line 33:
$cu:sin - #3:announce_admins line 6:
$cu:sin - #3:list_exits_long line 10:
$cu:sin - #3:tell_map_backup line 74:
$cu:sin - #3:tell_map_old line 77:
$cu:sin - #5:find_recipe line 9:
$cu:sin - #6:linesplit line 4:
$cu:sin - #6:notify_lines_suspended line 4:
$command_utils:suspend_if_needed - #6:recycle line 12:
$command_utils:suspend_if_needed - #6:gear line 130:
$cu:sin - #6:gear line 132:
$cu:sin - #9:messages_in_seq line 15:
$command_utils:suspend_if_needed - #9:display_seq_headers line 17:
$command_utils:suspend_if_needed - #9:display_seq_full line 18:
$command_utils:suspend_if_needed - #9:rm_message_seq line 10:
$command_utils:suspend_if_needed - #9:from_msg_seq line 22:
$command_utils:suspend_if_needed - #9:%from_msg_seq line 24:
$command_utils:suspend_if_needed - #9:to_msg_seq line 23:
$command_utils:suspend_if_needed - #9:%to_msg_seq line 24:
$command_utils:suspend_if_needed - #9:subject_msg_seq line 17:
$command_utils:suspend_if_needed - #9:body_msg_seq line 25:
$command_utils:suspend_if_needed - #9:_repair line 5:
$command_utils:suspend_if_needed - #9:_repair line 12:
$command_utils:suspend_if_needed - #9:_repair line 34:
$command_utils:suspend_if_needed - #9:_repair line 40:
$command_utils:suspend_if_needed - #9:_repair line 51:
$command_utils:suspend_if_needed - #9:_repair line 60:
$command_utils:suspend_if_needed - #11:prune line 25:
$command_utils:suspend_if_needed - #11:prune line 34:
$command_utils:suspend_if_needed - #12:init_for_core line 6:
$command_utils:suspend_if_needed - #17:unset_player line 27:
$command_utils:suspend_if_needed - #17:initialize_owned line 12:
$command_utils:suspend_if_needed - #17:verify_owned_objects line 14:
$command_utils:suspend_if_needed - #17:show_missing_help line 7:
$command_utils:suspend_if_needed - #17:show_missing_help line 16:
$command_utils:suspend_if_needed - #17:show_netwho_listing line 15:
$command_utils:suspend_if_needed - #17:show_netwho_listing line 46:
$command_utils:suspend_if_needed - #17:show_netwho_listing line 58:
$command_utils:suspend_if_needed - #17:grant_object line 19:
$command_utils:suspend_if_needed - #17:expire_mail_players line 6:
$cu:sin - #17:flush_editors line 10:
$command_utils:suspend_if_needed - #17:recursive_recycle line 10:
$cu:suspend_if_needed - #17:recursive_chown line 8:
$cu:sin - #17:recursive_chown line 11:
$cu:sin - #17:move_prop_down line 17:
$cu:sin - #17:move_prop_down line 23:
$cu:sin - #17:move_prop_up line 12:
$cu:sin - #17:move_prop_up line 14:
$cu:sin - #17:move_prop_up line 26:
$cu:sin - #17:move_prop_up line 32:
$cu:sin - #19:difference_suspended line 8:
$command_utils:suspend_if_needed - #20:from_value_suspended line 11:
$command_utils:suspend_if_needed - #20:from_value_suspended line 25:
$command_utils:suspend_if_needed - #20:columnize_suspended line 13:
$command_utils:suspend_if_needed - #20:match_suspended line 37:
$command_utils:suspend_if_needed - #20:message_db line 14:
$cu:sin - #20:random_word line 25:
$cu:sin - #20:make_table line 37:
$cu:sin - #20:word_wrap line 41:
$cu:sin - #20:properties_like line 17:
$cu:sin - #20:crapsum line 8:
$cu:sin - #21:object_audit_string line 10:
$command_utils:suspend_if_needed - #21:do_audit line 17:
$command_utils:suspend_if_needed - #21:do_audit line 31:
$command_utils:suspend_if_needed - #23:display_seq_headers line 19:
$command_utils:suspend_if_needed - #23:from_msg_seq line 22:
$command_utils:suspend_if_needed - #23:to_msg_seq line 21:
$command_utils:suspend_if_needed - #23:%to_msg_seq line 22:
$command_utils:suspend_if_needed - #24:sort_topics line 11:
$command_utils:suspend_if_needed - #24:index line 3:
$command_utils:suspend_if_needed - #27:extract line 9:
$command_utils:suspend_if_needed - #27:levenshtein line 21:
$cu:sin - #30:_every_key line 10:
$command_utils:suspend_if_needed - #30:_every_key line 12:
$command_utils:suspend_if_needed - #30:clearall line 23:
$command_utils:suspend_if_needed - #33:@subscribe*-quick line 24:
$command_utils:suspend_if_needed - #33:mail_catch_up line 6:
$command_utils:suspend_if_needed - #33:@rn line 34:
$command_utils:suspend_if_needed - #33:@rn line 41:
$command_utils:suspend_if_needed - #33:format_for_netforward line 17:
$command_utils:suspend_if_needed - #33:format_for_netforward_debug line 17:
$command_utils:suspend_if_needed - #33:@refile line 19:
$command_utils:suspend_if_needed - #33:@mail-all-new*-mail line 19:
$command_utils:suspend_if_needed - #33:@read-all-new*-mail line 33:
$command_utils:suspend_if_needed - #35:english_time line 28:
$command_utils:suspend_if_needed - #35:english_time_rounded line 29:
$command_utils:suspend_if_needed - #37:look_self line 47:
$command_utils:suspend_if_needed - #37:date_sort line 11:
$command_utils:suspend_if_needed - #37:__check line 3:
$command_utils:suspend_if_needed - #38:sends_to line 11:
$command_utils:suspend_if_needed - #38:touch line 6:
$command_utils:suspend_if_needed - #38:match line 33:
$command_utils:suspend_if_needed - #38:rm_message_seq line 18:
$command_utils:suspend_if_needed - #38:rm_message_seq line 20:
$command_utils:suspend_if_needed - #38:rm_message_seq line 22:
$command_utils:suspend_if_needed - #38:parse_message_seq line 25:
$command_utils:suspend_if_needed - #38:from_msg_seq line 21:
$command_utils:suspend_if_needed - #38:%from_msg_seq line 23:
$command_utils:suspend_if_needed - #38:to_msg_seq line 22:
$command_utils:suspend_if_needed - #38:%to_msg_seq line 23:
$command_utils:suspend_if_needed - #38:subject_msg_seq line 17:
$command_utils:suspend_if_needed - #38:body_msg_seq line 22:
$command_utils:suspend_if_needed - #38:display_message_improved line 37:
$cu:sin - #38:display_message_improved line 60:
$cu:sin - #40:can_all_edit line 6:
$cu:sin - #40:can_all_edit line 14:
$cu:sin - #40:can_all_edit line 26:
$cu:sin - #41:@queue-grep line 18:
$cu:sin - #41:@queue-grep line 20:
$cu:sin - #45:property_conflicts line 27:
$command_utils:suspend_if_needed - #45:property_conflicts line 29:
$command_utils:suspend_if_needed - #45:all_properties_suspended line 13:
$command_utils:suspend_if_needed - #45:descendants_suspended line 11:
$cu:sin - #45:branches_suspended line 14:
$command_utils:suspend_if_needed - #45:fertile_branches line 10:
$cu:sin - #45:fertile_kids_suspended line 7:
$cu:sin - #45:fertile_descendants_suspended line 4:
$cu:sin - #45:objects_with_verb line 13:
$cu:sin - #45:objects_with_verb line 20:
$cu:sin - #45:tree_properties line 25:
$cu:sin - #45:limited_children_suspended line 2:
$cu:sin - #47:range line 8:
$cu:sin - #47:sort line 7:
$cu:sin - #47:sort_suspended line 17:
$command_utils:suspend_if_needed - #47:sort_alist_suspended line 7:
$command_utils:suspend_if_needed - #47:sort_alist_suspended line 19:
$command_utils:suspend_if_needed - #47:flatten line 9:
$cu:sin - #47:_reverse_suspended line 3:
$command_utils:suspend_if_needed - #47:assoc_suspended line 14:
cu:suspend_if_needed - #47:amerge_suspended line 19:
$cu:sin - #47:sort_cardinal_suspended line 19:
$cu:sin - #47:group_objects line 20:
$cu:sin - #47:remove_if line 15:
$cu:sin - #49:make-core-database line 127:
$command_utils:suspend_if_needed - #49:mcd_2 line 46:
$command_utils:suspend_if_needed - #49:mcd_2 line 64:
$command_utils:suspend_if_needed - #49:mcd_2 line 88:
$command_utils:suspend_if_needed - #49:@players line 104:
$command_utils:suspend_if_needed - #49:@guests line 39:
$command_utils:suspend_if_needed - #49:@guests line 42:
$command_utils:suspend_if_needed - #49:@guests line 56:
$command_utils:suspend_if_needed - #49:display_list line 16:
$command_utils:suspend_if_needed - #49:display_list line 23:
$command_utils:suspend_if_needed - #49:@shutdown line 38:
$command_utils:suspend_if_needed - #49:@prog-check line 37:
$cu:sin - #49:@old-grant line 41:
$command_utils:suspend_if_needed - #49:coredat line 95:
$command_utils:suspend_if_needed - #50:@forked line 15:
$command_utils:suspend_if_needed - #50:@forked line 29:
$command_utils:suspend_if_needed - #50:@kill line 89:
$command_utils:suspend_if_needed - #50:@kill line 101:
$command_utils:suspend_if_needed - #50:@kill line 112:
$command_utils:suspend_if_needed - #50:@kill line 123:
$command_utils:suspend_if_needed - #50:@d*isplay line 150:
$command_utils:suspend_if_needed - #50:@d*isplay line 183:
$command_utils:suspend_if_needed - #50:@list*# line 129:
$command_utils:suspend_if_needed - #50:@forked-v*erbose line 15:
$command_utils:suspend_if_needed - #50:@forked-v*erbose line 29:
$command_utils:suspend_if_needed - #50:whodo line 5:
$cu:sin - #50:whodo line 25:
$cu:sin - #50:@current-daily-gain line 21:
$cu:sin - #50:@current-daily-gain line 23:
$cu:sin - #50:@current-daily-gain line 26:
$cu:sin - #50:@rhistory line 34:
$cu:sin - #50:@port line 30:
$cu:sin - #50:find_property line 20:
$cu:sin - #50:find_property line 31:
$cu:sin - #50:find_verb line 20:
$cu:sin - #50:find_verb line 31:
$cu:sin - #50:@canedit line 12:
$cu:sin - #50:@canedit line 21:
$cu:sin - #50:@canedit line 44:
$cu:sin - #50:@canedit line 55:
$cu:sin - #50:seccheck line 51:
$cu:sin - #51:show_object line 29:
$command_utils:suspend_if_needed - #51:show_object line 37:
$command_utils:suspend_if_needed - #51:show_object line 45:
$command_utils:suspend_if_needed - #51:show_object line 57:
$command_utils:suspend_if_needed - #51:_find_verbs_matching line 17:
$cu:sin - #51:help_db_search line 8:
$command_utils:suspend_if_needed - #51:verbname_match line 15:
$cu:sin - #51:show_who_listing line 53:
$command_utils:suspend_if_needed - #51:callers_text line 25:
$command_utils:suspend_if_needed - #51:dump_properties line 30:
$command_utils:suspend_if_needed - #51:dump_properties line 34:
$command_utils:suspend_if_needed - #51:dump_properties line 47:
$command_utils:suspend_if_needed - #51:dump_verbs line 45:
$command_utils:suspend_if_needed - #51:dump_verbs line 58:
$command_utils:suspend_if_needed - #53:news_display_seq_full line 12:
$command_utils:suspend_if_needed - #53:touch line 7:
$command_utils:suspend_if_needed - #54:weight line 7:
$cu:sin - #57:reclaim_lost_souls line 15:
$command_utils:suspend_if_needed - #64:init_for_core line 9:
$command_utils:suspend_if_needed - #65:cleanup line 12:
$command_utils:suspend_if_needed - #65:replace line 29:
$command_utils:suspend_if_needed - #65:replace line 39:
$command_utils:suspend_if_needed - #65:cleanup_list line 16:
$command_utils:suspend_if_needed - #65:clean_status line 6:
$command_utils:suspend_if_needed - #65:move_players_home line 26:
$command_utils:suspend_if_needed - #66:raw_sendmail line 21:
$cu:sin - #66:suspend_if_needed line 4:
$command_utils:suspend_if_needed - #69:get line 23:
$command_utils:suspend_if_needed - #69:get line 29:
$command_utils:suspend_if_needed - #69:get line 32:
$command_utils:suspend_if_needed - #74:init_for_core line 6:
$command_utils:suspend_if_needed - #74:gc line 24:
$command_utils:suspend_if_needed - #75:value_bytes line 8:
$command_utils:suspend_if_needed - #75:summarize_one_user line 49:
$command_utils:suspend_if_needed - #75:measurement_task line 16:
$command_utils:suspend_if_needed - #75:measurement_task_body line 17:
$command_utils:suspend_if_needed - #75:measurement_task_body line 52:
$command_utils:suspend_if_needed - #77:list line 8:
$command_utils:suspend_if_needed - #80:put_data line 12:
$command_utils:suspend_if_needed - #80:listen line 10:
$command_utils:suspend_if_needed - #84:@paste line 24:
$command_utils:suspend_if_needed - #90:do_login_command line 113:
$cu:sin - #90:do_login_command line 132:
$cu:sin - #90:who_html line 50:
$command_utils:suspend_if_needed - #90:get_help_topic line 41:
$command_utils:suspend_if_needed - #95:edps line 24:
$cu:sin - #95:tree_tag line 12:
$cu:sin - #96:calc_best line 6:
$cu:sin - #98:aggregate_names line 6:
$cu:sin - #98:aggregate_names_bold line 6:
$cu:sin - #103:_old_draw_map line 39:
$cu:sin - #103:draw_map_www line 24:
$cu:sin - #103:draw_map_www line 68:
$cu:sin - #103:draw_map_www line 89:
$cu:sin - #103:get_html_icon line 5:
$cu:sin - #103:fill_bottle line 32:
$cu:sin - #103:handle_aborted_task line 42:
$cu:sin - #103:handle_aborted_task line 63:
$cu:sin - #103:set_recipes line 5:
$cu:sin - #103:meat_raper line 13:
$cu:sin - #106:on_spawn line 2:
$cu:sin - #106:forget_enemies line 3:
$cu:sin - #106:forget_enemies line 14:
$cu:sin - #106:_compile line 17:
$cu:sin - #107:at*tack line 9:
$cu:sin - #107:show_score_full line 119:
$cu:sin - #107:_resist line 31:
$cu:sin - #111:weight_old line 7:
$cu:sin - #111:weight line 15:
$cu:sin - #113:@vloc line 25:
$command_utils:suspend_if_needed - #113:@leaves line 13:
$cu:sin - #114:find_all_paths line 14:
$command_utils:suspend_if_needed - #114:do_reset line 10:
$command_utils:suspend_if_needed - #114:do_reset line 17:
$cu:sin - #114:do_reset line 21:
$cu:sin - #114:on_reset line 4:
$cu:sin - #114:on_reset line 12:
$cu:sin - #114:on_reset line 40:
$cu:sin - #114:on_reset line 44:
$cu:sin - #114:announce_all line 5:
$cu:sin - #114:calculate_offset line 62:
$cu:sin - #114:find_reset_listeners line 6:
$cu:sin - #114:find_reset_listeners line 18:
$cu:sin - #114:find_transitions line 21:
$cu:sin - #114:unhibernate line 8:
$cu:sin - #114:_www line 11:
$cu:sin - #114:_www line 33:
$cu:sin - #114:reset_map line 4:
$cu:sin - #114:spy_report line 6:
$cu:sin - #114:@list-costs line 3:
$cu:sin - #114:store_sorted_rooms_by_z line 6:
$cu:sin - #114:chown line 7:
$cu:sin - #114:chown line 9:
$cu:sin - #114:announce_low_sky line 20:
$cu:sin - #114:random_ground line 3:
$cu:sin - #119:become_adoor line 25:
$cu:sin - #142:_spawn line 6:
$cu:sin - #142:_compile line 11:
$cu:sin - #142:_compile line 26:
$cu:sin - #146:tell_contents line 37:
$cu:sin - #147:tell_recipes line 24:
$cu:sin - #150:register_all line 20:
$cu:sin - #150:register_all_long line 6:
$cu:sin - #150:@h-areas line 19:
$cu:sin - #150:squeeze line 5:
$cu:sin - #150:megacheck line 20:
$cu:sin - #150:inspect line 20:
$cu:sin - #150:service_queue_old line 15:
$cu:sin - #150:@analyze-beat line 37:
$cu:sin - #150:@show-analysis line 4:
$cu:sin - #150:@show-analysis line 10:
$cu:sin - #166:remove_from line 9:
$cu:sin - #166:remove_from_all line 12:
$cu:sin - #166:change_value line 6:
$cu:sin - #167:recycle line 6:
$cu:sin - #167:heartbeat line 7:
$cu:sin - #167:disband_cleanup line 6:
$cu:sin - #167:old_cleanup line 7:
$cu:sin - #184:_start line 35:
$cu:sin - #186:_clean line 13:
$cu:sin - #186:_clean line 35:
$cu:sin - #186:tell_contents line 30:
$cu:sin - #186:tell_contents line 32:
$cu:sin - #187:_push line 2:
$cu:sin - #188:_globify line 4:
$cu:sin - #188:occupants_suspended line 4:
$cu:sin - #188:occupants_old_old line 8:
$cu:sin - #202:@reset-maps line 20:
$cu:sin - #202:store_sorted_rooms_by_z line 4:
$cu:sin - #202:store_sorted_rooms_by_z line 9:
$cu:sin - #204:validate line 11:
$cu:sin - #214:average_pressures line 6:
$cu:sin - #214:update_wind_room line 4:
$cu:sin - #214:drift_clouds line 5:
$cu:sin - #214:disperse_clouds line 4:
$cu:sin - #246:graphical_bar line 14:
$cu:sin - #247:visit_room line 15:
$cu:sin - #253:_changelog_object line 19:
$cu:sin - #253:_changelog_verb line 14:
$cu:sin - #253:_changelog_all line 7:
$cu:sin - #253:_changelog_all line 21:
$cu:sin - #253:_changelog_critical line 8:
$cu:sin - #253:_changelog_critical line 21:
$cu:sin - #253:_changelog_critical line 32:
$cu:sin - #256:_flow line 68:
$cu:sin - #283:look_self line 10:
$cu:sin - #283:look_self line 24:
$cu:sin - #283:reset line 20:
$cu:sin - #283:reset line 27:
$cu:sin - #290:parse line 47:
$command_utils:suspend_if_needed - #290:parse_element_to_hash line 30:
$cu:sin - #293:_pms line 27:
$command_utils:suspend_if_needed - #293:display_top_seq line 43:
$cu:sin - #293:parse_message_seq line 33:
$command_utils:suspend_if_needed - #293:pms_old line 33:
$command_utils:suspend_if_needed - #317:@countweapons line 19:
$cu:sin - #317:@countweapons line 44:
$cu:sin - #317:@countweapons line 54:
$cu:sin - #317:allitems line 17:
$cu:sin - #317:allitems line 24:
$cu:sin - #317:allitems line 37:
$cu:sin - #317:allitems line 39:
$cu:sin - #317:totalvalue line 14:
$cu:sin - #317:calc_topvalue line 22:
$cu:sin - #317:calc_topvalue line 33:
$cu:sin - #317:@topvalue line 14:
$cu:sin - #317:@topvalue line 23:
$cu:sin - #317:@topvalue line 36:
$cu:sin - #317:@whohas line 56:
$cu:sin - #317:@whohas line 93:
$cu:sin - #317:@whohas line 104:
$cu:sin - #317:@whohas line 173:
$cu:sin - #317:@allitems line 36:
$cu:sin - #317:@allitems line 45:
$cu:sin - #317:@allitems line 58:
$cu:sin - #317:@allitems line 69:
$cu:sin - #317:@allitems line 100:
$cu:sin - #317:@allitems line 114:
$cu:sin - #317:@countarmor line 9:
$cu:sin - #317:@countarmor line 27:
$cu:sin - #317:@countarmor line 48:
$cu:sin - #317:@countarmor line 58:
$cu:sin - #317:_ofind line 19:
$cu:sin - #317:_ofind line 21:
$cu:sin - #317:_ofind line 48:
$cu:sin - #317:_ofind line 60:
$cu:sin - #317:@monsters line 53:
$cu:sin - #317:@monsters line 84:
$cu:sin - #317:@positions line 13:
$cu:sin - #317:@positions line 23:
$cu:sin - #317:@monsters-xp line 13:
$cu:sin - #317:@monsters-xp line 44:
$cu:sin - #317:@monsters-new line 14:
$cu:sin - #317:@monsters-new line 55:
$cu:sin - #317:@checkloot line 11:
$cu:sin - #317:@spy line 28:
$cu:sin - #317:@spy line 33:
$cu:sin - #317:@spy line 40:
$cu:sin - #317:@spy line 47:
$cu:sin - #317:@spy line 54:
$cu:sin - #317:@aspy line 20:
$cu:sin - #317:@aspy line 26:
$cu:sin - #317:@rspy line 21:
$cu:sin - #317:@rspy line 27:
$cu:sin - #317:@uspy line 2:
$cu:sin - #317:@uspy line 12:
$cu:sin - #317:@uspy line 18:
$cu:sin - #317:@pathto line 53:
$cu:sin - #317:update_fertile line 14:
$cu:sin - #317:match_for_spawn line 23:
$cu:sin - #317:monster_for_spawn line 23:
$cu:sin - #317:update_sources line 10:
$cu:sin - #317:update_sources line 12:
$cu:sin - #317:update_sources line 28:
$cu:sin - #317:update_sources line 30:
$cu:sin - #317:update_sources line 43:
$cu:sin - #317:update_sources line 62:
$cu:sin - #317:update_sources line 78:
$cu:sin - #317:update_sources line 80:
$cu:sin - #317:update_sources line 93:
$cu:sin - #317:update_sources line 107:
$cu:sin - #317:update_sources line 109:
$cu:sin - #317:update_sources line 122:
$cu:sin - #317:update_sources line 146:
$cu:sin - #317:update_sources line 148:
$cu:sin - #317:u2 line 6:
$cu:sin - #317:@actor-check line 16:
$cu:sin - #317:child_counts line 20:
$cu:sin - #317:_bigtree line 10:
$cu:sin - #317:@my line 23:
$cu:sin - #317:@checkspeciesquests line 17:
$cu:sin - #317:@findunsecureobjects line 15:
$cu:sin - #317:@compare line 19:
$cu:sin - #324:do_get line 19:
$command_utils:suspend_if_needed - #334:instantiate line 13:
$command_utils:suspend_if_needed - #334:instantiate line 26:
$command_utils:suspend_if_needed - #334:instantiate line 65:
$command_utils:suspend_if_needed - #334:del*ete line 37:
$cu:sin - #334:furnish line 7:
$cu:sin - #334:_itemize_costs line 4:
$cu:sin - #334:uninstantiate line 21:
$cu:sin - #334:uninstantiate line 26:
$cu:sin - #334:uninstantiate line 30:
$cu:sin - #334:bury_room line 8:
$cu:sin - #334:bury_room line 17:
$cu:sin - #334:instantiate_new line 12:
$command_utils:suspend_if_needed - #334:instantiate_new line 25:
$command_utils:suspend_if_needed - #334:instantiate_new line 54:
$command_utils:suspend_if_needed - #334:path_exists line 21:
$cu:sin - #334:instantiate_old line 16:
$command_utils:suspend_if_needed - #334:instantiate_old line 29:
$command_utils:suspend_if_needed - #334:instantiate_old line 57:
$command_utils:suspend_if_needed - #338:fill_from line 20:
$cu:sin - #345:_clean line 15:
$cu:sin
Source
1"Usage: $command_utils:suspend_if_needed(<time>[, @<announcement>])"; 2"See if we're running out of ticks or seconds, and if so suspend(<time>) and return true. If more than one arg is given, print the remainder with player:tell."; 3if ((ticks_left() < 10000) || (seconds_left() < 2)) 4"Note: above computation should be the same as :running_out_of_time."; 5{?time = 1, @ann} = args; 6if (ann && valid(player)) 7player:tell(tostr(@ann)); 8endif 9amount = max(time, min(toint($flywheel.ema), 10)); 10set_task_perms(caller_perms()); 11"this is trying to back off according to lag..."; 12suspend(amount); 13for x in (this.sin_notify) 14`x:sin_notify(amount) ! ANY => 0'; 15endfor 16return 1; 17endif
dump_lines
Referenced by
- #13:dump_topic line 11:
$command_utils:dump_lines - #14:dump_topic line 5:
$command_utils:dump_lines - #24:dump_topic line 3:
$command_utils:dump_lines - #43:invoke_local_editor line 15:
$command_utils:dump_lines - #52:dump_topic line 4:
$command_utils:dump_lines
Source
1":dump_lines(text) => text `.'-quoted for :read_lines()"; 2" text is assumed to be a list of strings"; 3"Returns a corresponding list of strings which, when read via :read_lines, "; 4"produces the original list of strings (essentially, any strings beginning "; 5"with a period \".\" have the period doubled)."; 6"The list returned includes a final \".\""; 7text = args[1]; 8newtext = {}; 9i = lasti = 0; 10for line in (text) 11if (match(line, "^%(%.%| *@abort *$%)")) 12newtext = {@newtext, @(i > lasti) ? text[lasti + 1..i] | {}, "." + line}; 13lasti = i = i + 1; 14else 15i = i + 1; 16endif 17endfor 18return {@newtext, @(i > lasti) ? text[lasti + 1..i] | {}, "."};
explain_syntax
Referenced by
- #48:do_huh line 32:
this:explain_syntax
Source
1":explain_syntax(here,verb,args)"; 2verb = args[2]; 3for x in ({player, args[1], @valid(dobj) ? {dobj} | {}, @valid(iobj) ? {iobj} | {}}) 4what = x; 5while (hv = $object_utils:has_verb(what, verb)) 6what = hv[1]; 7i = 1; 8while (i = $code_utils:find_verb_named(what, verb, i)) 9if (evs = $code_utils:explain_verb_syntax(x, verb, @verb_args(what, i))) 10player:tell("Try this instead: ", evs); 11return 1; 12endif 13i = i + 1; 14endwhile 15what = parent(what); 16endwhile 17endfor 18return 0;
do_huh
Referenced by
- #1:huh line 2:
$command_utils:do_huh
Source
1":do_huh(verb,args) what :huh should do by default."; 2{verb, args} = args; 3if ($perm_utils:controls(caller_perms(), player) || (caller_perms() == player)) 4this.feature_task = {task_id(), verb, args, argstr, dobj, dobjstr, prepstr, iobj, iobjstr}; 5endif 6set_task_perms(cp = caller_perms()); 7notify = $perm_utils:controls(cp, player) ? "notify" | "tell"; 8if (verb == "") 9"should only happen if a player types backslash"; 10player:(notify)("I don't understand that."); 11return; 12endif 13if (player:my_huh(verb, args)) 14"... the player found something funky to do ..."; 15elseif (caller:here_huh(verb, args)) 16"... the room found something funky to do ..."; 17elseif (player:last_huh(verb, args)) 18"... player's second round found something to do ..."; 19elseif (dobj == $ambiguous_match) 20if (iobj == $ambiguous_match) 21player:(notify)(tostr("I don't understand that (\"", dobjstr, "\" and \"", iobjstr, "\" are both ambiguous names).")); 22else 23player:(notify)(tostr("I don't understand that (\"", dobjstr, "\" is an ambiguous name).")); 24endif 25elseif (iobj == $ambiguous_match) 26player:(notify)(tostr("I don't understand that (\"", iobjstr, "\" is an ambiguous name).")); 27else 28player:(notify)("I don't understand that."); 29" player:my_explain_syntax(caller, verb, args) || (caller:here_explain_syntax(caller, verb, args) || this:explain_syntax(caller, verb, args));"; 30if (!($ou:has_verb(player, "my_explain_syntax") && player:my_explain_syntax(caller, verb, args))) 31if (!($ou:has_verb(caller, "here_explain_syntax") && caller:here_explain_syntax(caller, verb, args))) 32this:explain_syntax(caller, verb, args); 33endif 34endif 35endif
task_info
Referenced by
none
Source
1"task_info(task id)"; 2"Return info (the same info supplied by queued_tasks()) about a given task id, or E_INVARG if there's no such task queued."; 3"WIZARDLY"; 4set_task_perms(caller_perms()); 5tasks = queued_tasks(); 6task_id = args[1]; 7for task in (tasks) 8if (task[1] == task_id) 9return task; 10endif 11endfor 12return E_INVARG;
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2this.lag_samples = {}; 3this.feature_task = "hey, neat, no feature verbs have been run yet!"; 4endif
kill_if_laggy
Referenced by
- #77:list line 7:
$command_utils:kill_if_laggy
Source
1"Kills this task if the current lag is greater than args[1]. Args[2..n] will be passed to player:tell."; 2cutoff = args[1]; 3if ($login:current_lag() > cutoff) 4player:tell(@listdelete(args, 1)); 5kill_task(task_id()); 6endif
validate_feature
Referenced by
none
Source
1":validate_feature(verb, args)"; 2" (where `verb' and `args' are the arguments passed to :my_huh)"; 3" returns true or false based on whether this is the same command typed by the user (comparing it against $command_utils.feature_task, set by $command_utils:do_huh)."; 4" assumes that the :my_huh parsing has not suspended"; 5return {task_id(), @args, argstr, dobj, dobjstr, prepstr, iobj, iobjstr} == this.feature_task;
sin_on
Referenced by
none
Source
1"Usage: $command_utils:suspend_if_needed(<time>[, @<announcement>])"; 2"See if we're running out of ticks or seconds, and if so suspend(<time>) and return true. If more than one arg is given, print the remainder with player:tell."; 3if ((ticks_left() < 10000) || (seconds_left() < 2)) 4"Note: above computation should be the same as :running_out_of_time."; 5{?time = 1, @ann} = args; 6if (ann && valid(player)) 7player:tell(tostr(@ann)); 8endif 9amount = max(time, min(toint($flywheel.ema), 10)); 10set_task_perms(caller_perms()); 11"this is trying to back off according to lag..."; 12suspend(amount); 13for x in (this.sin_notify) 14`x:sin_notify(amount) ! ANY => 0'; 15endfor 16return 1; 17endif
sin_off
Referenced by
none
Source
1return 0;
tell_eta
Referenced by
none
Source
1"$cu:tell_eta(FLOAT pct_done, INT time_started [, STR what, [, OBJ who|net]]) => 0"; 2"tells 'who' how much is done, and when this will end. who defaults to player, what defaults to the name of the calling verb."; 3{pct, start, ?what = callers()[1][2], ?who = player} = args; 4elapsed = time() - start; 5if (elapsed > 0) 6pct_per_sec = pct / tofloat(elapsed); 7total = toint(100.0 / pct_per_sec); 8est_remain = $tu:dhms(total - elapsed); 9else 10est_remain = "???"; 11endif 12bar = `$rpg:gbar(toint(pct), 100, 20, 0, $ansi.magenta) ! ANY => ""'; 13msg = tostr($ansi.magenta, " | ", bar, $ansi.magenta, " ", what, " ", floatstr(pct, 1), "% [ETA ", est_remain, "]", $ansi.reset); 14if (is_a(who, $net)) 15who:announce(this, msg, 1); 16else 17who:tell(msg); 18endif