generic programmer #50
Aliases: generic, programmer
97 verbs · 203 properties · 4 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
@prop*erty | any any any | rxd | #50 | 69 |
@chmod*# | any any any | rxd | #50 | 96 |
@args*# | any any any | rxd | #50 | 49 |
eval*-d | any any any | rxd | #50 | 26 |
@rmprop*erty | any any any | rxd | #50 | 18 |
@verb | any any any | rxd | #50 | 64 |
@rmverb*# | any none none | rxd | #50 | 50 |
@forked | any none none | rxd | #50 | 43 |
@kill @killq*uiet | any none none | rxd | #50 | 132 |
@copy @copy-x @copy-move | any at/to any | rxd | #50 | 91 |
_kill_task_message | this none this | rxd | #50 | 3 |
@prog*ram @program# @prog# | any any any | rxd | #50 | 110 |
@setenv | any any any | rxd | #50 | 14 |
@pros*pectus pros*pectus | any any any | rxd | #50 | 15 |
@d*isplay | any none none | rxd | #50 | 212 |
@db*size | none none none | rxd | #50 | 13 |
@gethelp | any any any | rxd | #50 | 37 |
@grep @egrep | any any any | rxd | #50 | 29 |
@s*how | any any any | rxd | #50 | 29 |
@check-p*roperty | any none none | rxd | #50 | 15 |
set_eval_env | this none this | rxd | #50 | 18 |
@clearp*roperty @clprop*erty | any none none | rxd | #50 | 20 |
@disown @disinherit | any any any | rxd | #50 | 34 |
eval_cmd_string | this none this | rxd | #50 | 24 |
@dump | any any any | rxd | #50 | 50 |
eval_value_to_string | this none this | rxd | #50 | 8 |
@progo*ptions @prog-o*ptions @programmero*ptions @programmer-o*ptions | any any any | rxd | #50 | 29 |
prog_option | this none this | rxd | #50 | 7 |
set_prog_option | this none this | rxd | #50 | 19 |
@list*# | any any any | rxd | #50 | 142 |
set_eval_subs | none none none | rxd | #50 | 13 |
@verbs* v verbs | any none none | rxd | #50 | 22 |
@forked-v*erbose | any none none | rxd | #50 | 44 |
@prop*erties @props | any none none | rxd | #50 | 22 |
walkto | any none none | rxd | #50 | 32 |
@proped*it | any none none | rxd | #50 | 15 |
@exam*ine | any none none | rxd | #50 | 110 |
@shout | any any any | rxd | #50 | 13 |
@copy-msg @copymsg @msg-copy @msgcopy | any at/to any | rxd | #50 | 12 |
@who-solved | any none none | rxd | #50 | 8 |
die_disable | this none this | rxd | #50 | 5 |
sizeup | any none none | rxd | #50 | 20 |
@rooms | none none none | rxd | #50 | 7 |
murder | any none none | rxd | #50 | 33 |
res*urrect | any none none | rxd | #50 | 18 |
hall healall | none none none | rxd | #50 | 5 |
whodo | none none none | rxd | #50 | 34 |
_kick | this none this | rxd | #50 | 67 |
kick | any any any | rxd | #50 | 10 |
heal | any none none | rxd | #50 | 57 |
paramedic pm | none none none | rxd | #50 | 153 |
@pardon | any none none | rxd | #50 | 16 |
@chatban | any none none | rxd | #50 | 22 |
debug_tell | this none this | rxd | #50 | 10 |
@tap | any none none | rxd | #50 | 4 |
@untap | any none none | rxd | #50 | 4 |
heal_msg | this none this | rxd | #50 | 1 |
heal_self_msg | this none this | rxd | #50 | 1 |
@extract @kidnap | any none none | rxd | #50 | 16 |
@current-daily-gain @cdg | none none none | rxd | #50 | 28 |
@messages_old any none none | any none none | rxd | #50 | 42 |
@rhistory | any none none | rxd | #50 | 35 |
@receive-dump | none none none | rxd | #50 | 25 |
@port | any none none | rxd | #50 | 41 |
@bored*! | none none none | rxd | #50 | 11 |
@assume-form | any none none | rxd | #50 | 24 |
@revert-form @reveal-form | none none none | rxd | #50 | 15 |
examine_names | this none this | rxd | #50 | 12 |
@got | any none none | rxd | #50 | 8 |
!* | any any any | rxd | #50 | 35 |
_@prog | this none this | rxd | #50 | 110 |
@desc*ribe | any as any | rxd | #50 | 16 |
@quit @forcequit @forcejoyquit | none none none | rxd | #50 | 4 |
@add-feature @addfeature | any none none | rxd | #50 | 35 |
@remove-feature @rmfeature | any none none | rxd | #50 | 21 |
@find | any none none | rxd | #50 | 29 |
find_property | this none this | rxd | #50 | 35 |
find_verb | this none this | rxd | #50 | 35 |
find_verbs_on | this none this | rxd | #50 | 2 |
find_properties_on | this none this | rxd | #50 | 2 |
find_help | this none this | rxd | #50 | 41 |
property_inherited_from | this none this | rxd | #50 | 12 |
@rp-award | any at/to any | rxd | #50 | 19 |
@donation | any none none | rxd | #50 | 15 |
@changelog @cl | any none none | rxd | #50 | 26 |
@pathto | any none none | rxd | #50 | 19 |
@writeprop | any any any | rxd | #50 | 37 |
@canedit | any any any | rxd | #50 | 96 |
@type @status @assign @combine @retitle @annotate | any any any | rd | #50 | 15 |
@mine | any none none | rxd | #50 | 25 |
@disassemble | any none none | rxd | #50 | 22 |
@functions | none none none | rxd | #50 | 29 |
@adderror | any any any | rxd | #50 | 21 |
@task*s @killtask*s | any any any | rxd | #50 | 271 |
@chown*# | any any any | rxd | #50 | 125 |
emergency_tell | this none this | rxd | #50 | 5 |
seccheck | any none none | rxd | #50 | 90 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
eval_subs | #50 | r | #29 | {} |
eval_ticks | #50 | r | #29 | 45 |
prog_options | #50 | rc | #361 | {} |
event_debug_filter | #50 | rc | #361 | {} |
progkill_msg | #50 | rc | #361 | "%DN waves %p hand distractedly at %dt." |
progburn_msg | #50 | rc | #361 | "%DN waves %p hand distractedly at %dt. %DT bursts into flames." |
proglight_msg | #50 | rc | #361 | "%DN touches %p finger to %dt, which bursts into flames." |
heal_msg | #50 | rc | #361 | "%N places %p hand on %dt." |
heal_self_msg | #50 | rc | #361 | "%N tilts %p head to one side, then the other, stretching a bit." |
revert_form_msg | #50 | rc | #361 | "The form of %name% fades away, revealing %DT." |
eval_env | #50 | r | #361 | "here=player.location;me=player" |
build_options | #2 | rc | #361 | <clear> |
who_visible | #2 | rc | #361 | <clear> |
join_msg | #89 | rc | #361 | <clear> |
object_port_msg | #89 | rc | #361 | "%N %<teleports> you." |
victim_port_msg | #89 | rc | #361 | "%N %<teleports> you." |
thing_arrive_msg | #89 | rc | #361 | <clear> |
othing_port_msg | #89 | rc | #361 | <clear> |
thing_port_msg | #89 | rc | #361 | <clear> |
player_arrive_msg | #89 | rc | #361 | <clear> |
oplayer_port_msg | #89 | rc | #361 | <clear> |
player_port_msg | #89 | rc | #361 | <clear> |
self_arrive_msg | #89 | rc | #361 | "%N %<teleports> in." |
oself_port_msg | #89 | rc | #361 | "%N %<teleports> out." |
self_port_msg | #89 | rc | #361 | <clear> |
real_name | #89 | rc | #361 | <clear> |
real_aliases | #89 | rc | #361 | <clear> |
zots | #89 | rc | #361 | <clear> |
bedroom | #89 | rc | #361 | <clear> |
chillmin | #89 | rc | #361 | <clear> |
_mail_task | #33 | rc | #361 | <clear> |
messages_going | #33 | c | #361 | <clear> |
mail_lists | #33 | rc | #361 | <clear> |
mail_notify | #33 | rc | #361 | <clear> |
mail_forward | #33 | rc | #361 | <clear> |
mail_options | #33 | rc | #361 | {} |
message_keep_date | #33 | rc | #361 | <clear> |
messages_kept | #33 | rc | #361 | <clear> |
current_message | #33 | c | #361 | <clear> |
messages | #33 | c | #361 | <clear> |
mail_hack | #33 | rc | #361 | <clear> |
barcolor | #33 | rc | #361 | <clear> |
autowield | #33 | rc | #361 | <clear> |
bug | #33 | rc | #361 | <clear> |
readied_weapon | #33 | rc | #361 | <clear> |
unread_mail | #33 | rc | #361 | <clear> |
features | #6 | r | #29 | {#84, #170, #113, #149, #317, #310, #318} |
previous_connection | #6 | | #361 | <clear> |
email_address | #6 | | #361 | <clear> |
last_disconnect_time | #6 | r | #361 | <clear> |
help | #6 | rc | #361 | #22 |
more_msg | #6 | rc | #361 | <clear> |
linetask | #6 | r | #29 | <clear> |
linesleft | #6 | r | #29 | <clear> |
linebuffer | #6 | | #29 | <clear> |
pagelen | #6 | r | #29 | <clear> |
owned_objects | #6 | r | #361 | <clear> |
linelen | #6 | r | #29 | <clear> |
current_folder | #6 | c | #361 | <clear> |
all_connect_places | #6 | | #361 | <clear> |
last_connect_place | #6 | | #361 | <clear> |
lines | #6 | c | #361 | <clear> |
page_absent_msg | #6 | rc | #361 | <clear> |
page_origin_msg | #6 | rc | #361 | <clear> |
page_echo_msg | #6 | rc | #361 | <clear> |
edit_options | #6 | rc | #361 | <clear> |
last_connect_time | #6 | r | #361 | <clear> |
ownership_quota | #6 | | #29 | 0 |
password | #6 | | #361 | <clear> |
paranoid | #6 | rc | #361 | <clear> |
display_options | #6 | rc | #361 | <clear> |
verb_subs | #6 | rc | #361 | <clear> |
first_connect_time | #6 | r | #361 | <clear> |
size_quota | #6 | | #29 | <clear> |
last_password_time | #6 | | #361 | <clear> |
last_connect_attempt | #6 | | #361 | <clear> |
prefs | #6 | rc | #361 | <clear> |
ansi | #6 | rc | #361 | <clear> |
last_hit_meter | #6 | rc | #361 | "~1b[1m~1b[37m[~1b[32m|||||||||||||||||||||||||||||~1b[31m*~1b[37m~1b[1m]~1b[0m" |
doing_msg | #6 | rc | #361 | <clear> |
xp_total | #6 | rc | #361 | <clear> |
party | #6 | rc | #361 | <clear> |
rooms | #6 | r | #361 | <clear> |
client | #6 | rc | #361 | <clear> |
last_death_time | #6 | rc | #361 | <clear> |
default_weapon | #6 | rc | #361 | <clear> |
thirst | #6 | rc | #361 | <clear> |
may_chat | #6 | rc | #361 | <clear> |
idlemsg | #6 | rc | #361 | <clear> |
eula | #6 | rc | #361 | <clear> |
birthdate | #6 | rc | #361 | <clear> |
bad_words | #6 | rc | #361 | <clear> |
char_start_time | #6 | rc | #361 | <clear> |
rumors | #6 | rc | #361 | <clear> |
last_broadcast | #6 | rc | #361 | <clear> |
ansihack | #6 | rc | #361 | <clear> |
last_death_callers | #6 | rc | #361 | <clear> |
char_extra_epochs | #6 | rc | #361 | <clear> |
code_name | #6 | rc | #361 | <clear> |
code_plural | #6 | rc | #361 | <clear> |
changeable_properties | #6 | rc | #361 | <clear> |
out_of_band_session | #6 | r | #29 | <clear> |
private_aliases | #6 | rc | #361 | <clear> |
quests_open | #6 | rc | #361 | <clear> |
quests | #6 | rc | #361 | <clear> |
page_receive_msg | #6 | rc | #361 | <clear> |
page_msg | #6 | rc | #361 | <clear> |
focus_skills | #6 | rc | #361 | <clear> |
skillpoints | #100 | rc | #361 | <clear> |
xp | #100 | rc | #361 | <clear> |
mutations | #100 | rc | #361 | <clear> |
mutation_slots | #100 | rc | #361 | <clear> |
char_start_age | #100 | rc | #361 | <clear> |
char_extra_age | #100 | rc | #361 | <clear> |
hands | #107 | rc | #361 | <clear> |
wielding | #107 | rc | #361 | <clear> |
health | #107 | rc | #361 | 30 |
unarmed_weapon | #107 | rc | #361 | <clear> |
size | #107 | rc | #361 | <clear> |
posture | #107 | rc | #361 | "standing" |
gender | #107 | rc | #361 | <clear> |
respawn | #107 | rc | #361 | #2800 |
corpse | #107 | rc | #361 | <clear> |
has_proper_name | #107 | rc | #361 | <clear> |
die_msg | #107 | rc | #361 | <clear> |
body_parts | #107 | rc | #361 | <clear> |
wearing | #107 | rc | #361 | <clear> |
armor | #107 | rc | #361 | <clear> |
last_swing_message | #107 | rc | #361 | <clear> |
health_max | #107 | rc | #361 | 30 |
fighting | #107 | rc | #361 | {} |
last_dodge_time | #107 | rc | #361 | <clear> |
following | #107 | rc | #361 | <clear> |
icon | #107 | rc | #361 | <clear> |
say_msg | #107 | rc | #361 | <clear> |
say_to_msg | #107 | rc | #361 | <clear> |
afterlife | #107 | rc | #361 | <clear> |
get_msg | #107 | rc | #361 | <clear> |
drop_msg | #107 | rc | #361 | <clear> |
blood | #107 | rc | #361 | <clear> |
squeals | #107 | rc | #361 | <clear> |
prc | #107 | rc | #361 | <clear> |
ppc | #107 | rc | #361 | <clear> |
poc | #107 | rc | #361 | <clear> |
psc | #107 | rc | #361 | <clear> |
pr | #107 | rc | #361 | <clear> |
pp | #107 | rc | #361 | <clear> |
po | #107 | rc | #361 | <clear> |
ps | #107 | rc | #361 | <clear> |
pq | #107 | rc | #361 | <clear> |
pqc | #107 | rc | #361 | <clear> |
brief | #107 | rc | #361 | <clear> |
knockout | #107 | rc | #361 | <clear> |
knockout_msg | #107 | rc | #361 | <clear> |
body | #107 | rc | #361 | <clear> |
wake_msg | #107 | rc | #361 | <clear> |
owake_msg | #107 | rc | #361 | <clear> |
oknockout_msg | #107 | rc | #361 | <clear> |
friends | #107 | rc | #361 | <clear> |
home | #107 | rc | #361 | <clear> |
respawn_msg | #107 | rc | #361 | <clear> |
move_action | #107 | rc | #361 | <clear> |
heart | #107 | rc | #361 | -1 |
last_heartbeat | #107 | rc | #361 | <clear> |
dead | #107 | rc | #361 | <clear> |
_tohit_next | #107 | rc | #361 | <clear> |
last_words_msg | #107 | rc | #361 | <clear> |
attacked | #107 | rc | #361 | <clear> |
opens_doors | #107 | rc | #361 | <clear> |
movable_by_explosion | #107 | rc | #361 | <clear> |
obscured | #107 | rc | #361 | <clear> |
obscured_desc_msg | #107 | rc | #361 | <clear> |
cooldowns | #107 | rc | #361 | <clear> |
combat_rounds | #107 | rc | #361 | <clear> |
encumbrance | #107 | rc | #361 | <clear> |
respawn_handler | #107 | rc | #361 | <clear> |
distant_form_msg | #107 | rc | #361 | <clear> |
block_msg | #107 | rc | #361 | <clear> |
attack_on_block | #107 | rc | #361 | <clear> |
last_stunned | #107 | rc | #361 | <clear> |
nude_descs | #107 | rc | #361 | <clear> |
skills | #107 | rc | #361 | <clear> |
explode_msg | #107 | rc | #361 | <clear> |
death_listeners | #107 | rc | #361 | <clear> |
queue | #92 | r | #361 | <clear> |
preemptible | #92 | r | #361 | <clear> |
executing | #92 | r | #361 | <clear> |
process_queue | #92 | r | #361 | <clear> |
help_msg | #92 | rc | #361 | <clear> |
last_action | #92 | r | #361 | <clear> |
article | #92 | rc | #361 | <clear> |
last_last_action | #92 | rc | #361 | <clear> |
action_count | #92 | rc | #361 | <clear> |
aliases | #1 | r | #362 | {"generic", "programmer"} |
description | #1 | rc | #361 | "You see a player who is too experienced to have any excuse for not having a description." |
object_size | #1 | r | #29 | {157169, 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): #2 generic builder → #89 generic immortal → #33 generic normal player → #6 generic player → #100 generic RPG player → #154 generic living creature → #107 generic creature → #92 generic actor → #1 root
Children: #29 Hacker, #49 generic wizard, #65 housekeeper, #329 Hench-Creator
Call graph
Showing 48 of 235 verbs; 187 not shown.
Source
@prop*erty
Referenced by
none
Source
1set_task_perms(player); 2if (!player.programmer) 3player:notify("You need to be a programmer to do this."); 4player:notify("If you want to become a programmer, talk to a wizard."); 5return; 6elseif (!$quota_utils:property_addition_permitted(player)) 7player:tell("Property addition not permitted because quota exceeded."); 8return; 9endif 10nargs = length(args); 11usage = tostr("Usage: ", verb, " <object>.<prop-name> [<init_value> [<perms> [<owner>]]]"); 12if ((nargs < 1) || (!(spec = $code_utils:parse_propref(args[1])))) 13player:notify(usage); 14return; 15endif 16object = player:my_match_object(spec[1]); 17name = spec[2]; 18if ($command_utils:object_match_failed(object, spec[1])) 19return; 20endif 21if (nargs < 2) 22value = 0; 23else 24q = $string_utils:prefix_to_value(argstr[$string_utils:word_start(argstr)[2][1]..$]); 25if (q[1] == 0) 26player:notify(tostr("Syntax error in initial value: ", q[2])); 27return; 28endif 29value = q[2]; 30args = {args[1], value, @$string_utils:words(q[1])}; 31nargs = length(args); 32endif 33default = player:prog_option("@prop_flags"); 34if (!default) 35default = "rc"; 36endif 37perms = (nargs < 3) ? default | $perm_utils:apply(default, args[3]); 38if (nargs < 4) 39owner = player; 40else 41owner = $string_utils:match_player(args[4]); 42if ($command_utils:player_match_result(owner, args[4])[1]) 43return; 44endif 45endif 46if (nargs > 4) 47player:notify(usage); 48return; 49endif 50try 51add_property(object, name, value, {owner, perms}); 52player:notify(tostr("Property added with value ", toliteral(object.(name)), ".")); 53except (E_INVARG) 54if ($object_utils:has_property(object, name)) 55player:notify(tostr("Property ", object, ".", name, " already exists.")); 56else 57for i in [1..length(perms)] 58if (!index("rcw", perms[i])) 59player:notify(tostr("Unknown permission bit: ", perms[i])); 60return; 61endif 62endfor 63"...the only other possibility..."; 64player:notify("Property is already defined on one or more descendents."); 65player:notify(tostr("Try @check-prop ", args[1])); 66endif 67except e (ANY) 68player:notify(e[2]); 69endtry
@chmod*#
Referenced by
none
Source
1set_task_perms(player); 2bynumber = verb == "@chmod#"; 3if (length(args) != 2) 4player:notify(tostr("Usage: ", verb, " <object-or-property-or-verb> <permissions>")); 5return; 6endif 7{what, perms} = args; 8if (spec = $code_utils:parse_verbref(what)) 9if (!player.programmer) 10player:notify("You need to be a programmer to do this."); 11player:notify("If you want to become a programmer, talk to a wizard."); 12return; 13endif 14if (valid(object = player:my_match_object(spec[1]))) 15vname = spec[2]; 16if (bynumber) 17vname = $code_utils:toint(vname); 18if (vname == E_TYPE) 19return player:notify("Verb number expected."); 20elseif ((vname < 1) || `vname > length(verbs(object)) ! E_PERM => 0') 21return player:notify("Verb number out of range."); 22endif 23endif 24try 25info = verb_info(object, vname); 26if (!valid(owner = info[1])) 27player:notify(tostr("That verb is owned by an invalid object (", owner, "); it needs to be @chowned.")); 28elseif (!is_player(owner)) 29player:notify(tostr("That verb is owned by a non-player object (", owner.name, ", ", owner, "); it needs to be @chowned.")); 30else 31info[2] = perms = $perm_utils:apply(info[2], perms); 32try 33result = set_verb_info(object, vname, info); 34player:notify(tostr("Verb permissions set to \"", perms, "\".")); 35except (E_INVARG) 36player:notify(tostr("\"", perms, "\" is not a valid permissions string for a verb.")); 37except e (ANY) 38player:notify(e[2]); 39endtry 40endif 41except (E_VERBNF) 42player:notify("That object does not define that verb."); 43except error (ANY) 44player:notify(error[2]); 45endtry 46return; 47endif 48elseif (bynumber) 49return player:notify("@chmod# can only be used for verbs."); 50elseif (index(what, ".") && (spec = $code_utils:parse_propref(what))) 51if (valid(object = player:my_match_object(spec[1]))) 52pname = spec[2]; 53try 54info = property_info(object, pname); 55info[2] = perms = $perm_utils:apply(info[2], perms); 56try 57result = set_property_info(object, pname, info); 58player:notify(tostr("Property permissions set to \"", perms, "\".")); 59except (E_INVARG) 60player:notify(tostr("\"", perms, "\" is not a valid permissions string for a property.")); 61except error (ANY) 62player:notify(error[2]); 63endtry 64except (E_PROPNF) 65player:notify("That object does not have that property."); 66except error (ANY) 67player:notify(error[2]); 68endtry 69return; 70endif 71elseif (valid(object = player:my_match_object(what))) 72perms = $perm_utils:apply(((object.r ? "r" | "") + (object.w ? "w" | "")) + (object.f ? "f" | ""), perms); 73r = w = f = 0; 74for i in [1..length(perms)] 75if (perms[i] == "r") 76r = 1; 77elseif (perms[i] == "w") 78w = 1; 79elseif (perms[i] == "f") 80f = 1; 81else 82player:notify(tostr("\"", perms, "\" is not a valid permissions string for an object.")); 83return; 84endif 85endfor 86try 87object.r = r; 88object.w = w; 89object.f = f; 90player:notify(tostr("Object permissions set to \"", perms, "\".")); 91except (E_PERM) 92player:notify("Permission denied."); 93endtry 94return; 95endif 96$command_utils:object_match_failed(object, what);
@args*#
Referenced by
none
Source
1if (player != caller) 2return; 3endif 4set_task_perms(player); 5if (!player.programmer) 6player:notify("You need to be a programmer to do this."); 7player:notify("If you want to become a programmer, talk to a wizard."); 8return; 9endif 10if (!(args && (spec = $code_utils:parse_verbref(args[1])))) 11player:notify(tostr(args ? ("\"" + args[1]) + "\"? " | "", "<object>:<verb> expected.")); 12elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 13"...can't find object..."; 14else 15if (verb == "@args#") 16name = $code_utils:toint(spec[2]); 17if (name == E_TYPE) 18return player:notify("Verb number expected."); 19elseif ((name < 1) || `name > length(verbs(object)) ! E_PERM => 0') 20return player:notify("Verb number out of range."); 21endif 22endif 23try 24info = verb_args(object, name = spec[2]); 25if (typeof(pas = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST) 26"...arg spec is bogus..."; 27player:notify(tostr(pas)); 28elseif (!(newargs = pas[1])) 29player:notify($string_utils:from_list(info, " ")); 30elseif (pas[2]) 31player:notify(tostr("\"", pas[2][1], "\" unexpected.")); 32else 33info[2] = info[2][1..index(info[2] + "/", "/") - 1]; 34info = {@newargs, @info[length(newargs) + 1..$]}; 35try 36result = set_verb_args(object, name, info); 37player:notify("Verb arguments changed."); 38except (E_INVARG) 39player:notify(tostr("\"", info[2], "\" is not a valid preposition (?)")); 40except error (ANY) 41player:notify(error[2]); 42endtry 43endif 44except (E_VERBNF) 45player:notify("That object does not have a verb with that name."); 46except error (ANY) 47player:notify(error[2]); 48endtry 49endif
eval*-d
Referenced by
none
Source
1"A MOO-code evaluator. Type `;CODE' or `eval CODE'."; 2"Calls player:eval_cmd_string to first transform CODE in any way appropriate (e.g., prefixing .eval_env) and then do the actual evaluation. See documentation for this:eval_cmd_string"; 3"If you set your .eval_time property to 1, you find out how many ticks and seconds you used."; 4"If eval-d is used, the evaluation is performed as if the debug flag were unset."; 5if (player != this) 6player:tell("I don't understand that."); 7return; 8elseif (!player.programmer) 9player:tell("You need to be a programmer to eval code."); 10return; 11endif 12set_task_perms(player); 13r = player:eval_cmd_string(argstr, verb != "eval-d"); 14if (r[1]) 15player:notify(this:eval_value_to_string(r[2]) + $ansi.reset); 16if (player:prog_option("eval_time") && (!`output_delimiters(player)[2] ! ANY')) 17ticks = tostr(r[3], " tick", (r[3] == 1) ? "" | "s"); 18seconds = tostr(r[4], " second", (r[4] == 1) ? "" | "s"); 19cputime = tostr(r[5], "ms of cpu"); 20player:notify(tostr("[used ", ticks, ", ", seconds, ", ", cputime, ".]")); 21endif 22else 23player:notify_lines(r[2]); 24nerrors = length(r[2]); 25player:notify(tostr(nerrors, " error", (nerrors == 1) ? "." | "s.")); 26endif
@rmprop*erty
Referenced by
none
Source
1set_task_perms(player); 2if ((length(args) != 1) || (!(spec = $code_utils:parse_propref(args[1])))) 3player:notify(tostr("Usage: ", verb, " <object>.<property>")); 4return; 5endif 6object = player:my_match_object(spec[1]); 7pname = spec[2]; 8if ($command_utils:object_match_failed(object, spec[1])) 9return; 10endif 11try 12result = delete_property(object, pname); 13player:notify("Property removed."); 14except (E_PROPNF) 15player:notify("That object does not define that property."); 16except res (ANY) 17player:notify(res[2]); 18endtry
@verb
Referenced by
none
Source
1set_task_perms(player); 2if (!player.programmer) 3player:notify("You need to be a programmer to do this."); 4player:notify("If you want to become a programmer, talk to a wizard."); 5return; 6elseif (!$quota_utils:verb_addition_permitted(player)) 7player:tell("Verb addition not permitted because quota exceeded."); 8return; 9endif 10if (!(args && (spec = $code_utils:parse_verbref(args[1])))) 11player:notify(tostr("Usage: ", verb, " <object>:<verb-name(s)> [<dobj> [<prep> [<iobj> [<permissions> [<owner>]]]]]")); 12return; 13elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 14return; 15endif 16name = spec[2]; 17if ((name == "*") && (!player.wizard)) 18player:tell("lol, you don't want to do that."); 19return; 20endif 21"...Adding another verb of the same name is often a mistake..."; 22namelist = $string_utils:explode(name); 23for n in (namelist) 24if (i = index(n, "*")) 25n = n[1..i - 1] + n[i + 1..$]; 26endif 27if ((hv = $object_utils:has_verb(object, n)) && (hv[1] == object)) 28player:notify(tostr("Warning: Verb `", n, "' already defined on that object.")); 29endif 30endfor 31if (typeof(pas = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST) 32player:notify(tostr(pas)); 33return; 34endif 35verbargs = pas[1] || (player:prog_option("verb_args") || {}); 36if (verbargs) 37verbargs = {@verbargs, "none", "none", "none"}[1..3]; 38else 39verbargs = {"this", "none", "this"}; 40endif 41rest = pas[2]; 42perms = "rxd"; 43if (rest) 44perms = $perm_utils:apply(perms, rest[1]); 45endif 46if (length(rest) < 2) 47owner = player; 48elseif (length(rest) > 2) 49player:notify(tostr("\"", rest[3], "\" unexpected.")); 50return; 51elseif ($command_utils:player_match_result(owner = $string_utils:match_player(rest[2]), rest[2])[1]) 52return; 53elseif (owner == $nothing) 54player:notify("Verb can't be owned by no one!"); 55return; 56endif 57try 58x = add_verb(object, {owner, perms, name}, verbargs); 59player:notify(tostr("Verb added (", length(verbs(object)), ").")); 60except (E_INVARG) 61player:notify(tostr(rest ? tostr("\"", perms, "\" is not a valid set of permissions.") | tostr("\"", verbargs[2], "\" is not a valid preposition (?)"))); 62except e (ANY) 63player:notify(e[2]); 64endtry
@rmverb*#
Referenced by
none
Source
1set_task_perms(player); 2if (!(args && (spec = $code_utils:parse_verbref(args[1])))) 3player:notify(tostr("Usage: ", verb, " <object>:<verb>")); 4elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 5"...bogus object..."; 6elseif (typeof(argspec = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST) 7player:notify(tostr(argspec)); 8elseif (argspec[2]) 9player:notify($string_utils:from_list(argspec[2], " ") + "??"); 10elseif (length(argspec = argspec[1]) in {1, 2}) 11player:notify({"Missing preposition", "Missing iobj specification"}[length(argspec)]); 12else 13verbname = spec[2]; 14if (verb == "@rmverb#") 15loc = $code_utils:toint(verbname); 16if (loc == E_TYPE) 17return player:notify("Verb number expected."); 18elseif ((loc < 1) || (loc > `length(verbs(object)) ! E_PERM => 0')) 19return player:notify("Verb number out of range."); 20endif 21else 22if (index(verbname, "*") > 1) 23verbname = strsub(verbname, "*", ""); 24endif 25loc = $code_utils:find_last_verb_named(object, verbname); 26if (argspec) 27argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2]; 28while (loc && (`verb_args(object, loc) ! ANY' != argspec)) 29loc = $code_utils:find_last_verb_named(object, verbname, loc - 1); 30endwhile 31endif 32if (!loc) 33player:notify(tostr("That object does not define that verb", argspec ? " with those args." | ".")); 34return; 35endif 36endif 37info = `verb_info(object, loc) ! ANY'; 38vargs = `verb_args(object, loc) ! ANY'; 39try 40delete_verb(object, loc); 41if (info) 42player:notify(tostr("Verb ", object, ":", info[3], " (", loc, ") {", $string_utils:from_list(vargs, " "), "} removed.")); 43else 44player:notify(tostr("Unreadable verb ", object, ":", loc, " removed.")); 45endif 46$nets.change:announce_remove(player, object, info ? info[3] | loc); 47except e (ANY) 48player:notify(e[2]); 49endtry 50endif
@forked
Referenced by
none
Source
1"Syntax: @forked [player]"; 2" @forked all wizards"; 3""; 4"For a normal player, shows all the tasks you have waiting in your queue, especially those forked or suspended. A wizard will see all the tasks of all the players unless the optional argument is provided."; 5"The second form is only usable by wizards and provides an output of all tasks owned by characters who are .wizard=1. Useful to find a task that may get put in a random queue due to $wiz_utils:random_wizard. Or even finding verbs that run with wizard permissions that shouldn't be."; 6set_task_perms(player); 7if (!dobjstr) 8tasks = queued_tasks(); 9elseif ((dobjstr == "all wizards") && player.wizard) 10tasks = {}; 11for t in (queued_tasks()) 12if (valid(t[5]) && t[5].wizard) 13tasks = {@tasks, t}; 14endif 15$command_utils:suspend_if_needed(1); 16endfor 17elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr), dobjstr)[1]) 18return; 19elseif (typeof(tasks = $wiz_utils:queued_tasks(dobj)) != LIST) 20player:notify(tostr(verb, " ", dobj.name, "(", dobj, "): ", tasks)); 21return; 22endif 23if (tasks) 24su = $string_utils; 25player:notify("Queue ID Start Time Owner Verb (Line) [This]"); 26player:notify("-------- ---------- ----- -----------------"); 27now = time(); 28for task in (tasks) 29$command_utils:suspend_if_needed(0); 30{q_id, start, nu, nu2, owner, vloc, vname, lineno, this} = task; 31time = (start >= now) ? ctime(start)[5..24] | su:left((start == -1) ? "Reading input ..." | tostr(now - start, " seconds ago..."), 20); 32owner_name = valid(owner) ? owner.name | tostr("Dead ", owner); 33player:notify(tostr(su:left(tostr(q_id), 10), " ", time, " ", su:left(owner_name, 12), " ", $su:nn(vloc), ":", vname, " (", lineno, ")", (this != vloc) ? tostr(" [", this, "]") | "")); 34if (index(vname, "suspend") && (vloc == $command_utils)) 35"Find out the first line of the callers() list from task_stack()"; 36{sthis, svname, sprogger, svloc, splayer, slineno} = task_stack(q_id, 1)[2]; 37player:notify(tostr(" Called By... ", su:left(valid(sprogger) ? sprogger.name | tostr("Dead ", sprogger), 12), " ", svloc, ":", svname, (sthis != svloc) ? tostr(" [", sthis, "]") | "", " (", slineno, ")")); 38endif 39endfor 40player:notify("-----------------------------------------------------------------"); 41else 42player:notify("No tasks."); 43endif
@kill @killq*uiet
Referenced by
none
Source
1"Kills one or more tasks."; 2"Arguments:"; 3" object:verb -- kills all tasks which were started from that object and verb."; 4" all -- kills all tasks owned by invoker"; 5" all player-name -- wizard variant: kills all tasks owned by player."; 6" all everyone -- wizard variant: really kills all tasks."; 7" Integer taskid -- kills the specifically named task."; 8" soon [integer] -- kills all tasks scheduled to run in the next [integer] seconds, which defaults to 60."; 9" %integer -- kills all tasks which end in the digits contained in integer."; 10" The @killquiet alias kills tasks without the pretty printout if more than one task is being killed."; 11set_task_perms(player); 12quiet = index(verb, "q"); 13if (length(args) == 0) 14player:notify_lines({tostr("Usage: ", verb, " [object]:[verb]"), tostr(" ", verb, " task_id"), tostr(" ", verb, " soon [number-of-seconds]", player.wizard ? " [everyone|<player name>]" | ""), tostr(" ", verb, " all", player.wizard ? " [everyone|<player name>]" | "")}); 15return; 16elseif (taskid = toint(args[1])) 17elseif (all = args[1] == "all") 18everyone = 0; 19realplayer = player; 20if (player.wizard && (length(args) > 1)) 21realplayer = $string_utils:match_player(args[2]); 22everyone = args[2] == "everyone"; 23if ((!valid(realplayer)) && (!everyone)) 24$command_utils:player_match_result(realplayer, args[2]); 25return; 26elseif (!everyone) 27set_task_perms(realplayer); 28endif 29endif 30elseif (soon = args[1] == "soon") 31realplayer = player; 32if (length(args) > 1) 33soon = toint(args[2]); 34if ((soon <= 0) && (!player.wizard)) 35player:notify(tostr("Usage: ", verb, " soon [positive-number-of-seconds]")); 36return; 37elseif (player.wizard) 38result = this:kill_aux_wizard_parse(@args[2..$]); 39soon = result[1]; 40if (result[1] < 0) 41"already gave them an error message"; 42return; 43elseif (result[2] == 1) 44everyone = 1; 45else 46everyone = 0; 47set_task_perms(result[2]); 48realplayer = result[2]; 49endif 50endif 51else 52soon = 60; 53everyone = 0; 54endif 55elseif (percent = args[1][1] == "%") 56l = length(args[1]); 57digits = toint(args[1][2..l]); 58percent = toint("1" + "0000000000"[1..l - 1]); 59elseif (colon = index(argstr, ":")) 60whatstr = argstr[1..colon - 1]; 61vrb = argstr[colon + 1..$]; 62if (whatstr) 63what = player:my_match_object(whatstr); 64endif 65else 66player:notify_lines({tostr("Usage: ", verb, " [object]:[verb]"), tostr(" ", verb, " task_id"), tostr(" ", verb, " soon [number-of-seconds]", player.wizard ? " [everyone|<player name>]" | ""), tostr(" ", verb, " all", player.wizard ? " [\"everyone\"|<player name>]" | "")}); 67return; 68endif 69"OK, parsed the line, and punted them if it was bogus. This verb could have been a bit shorter at the expense of readability. I think it's getting towards unreadable as is. At this point we've set_task_perms'd, and set up an enormous number of local variables. Evaluate them in the order we set them, and we should never get var not found."; 70queued_tasks = queued_tasks(); 71killed = 0; 72if (taskid) 73try 74kill_task(taskid); 75player:notify(tostr("Killed task ", taskid, ".")); 76killed = 1; 77except error (ANY) 78player:notify(tostr("Can't kill task ", taskid, ": ", error[2])); 79endtry 80elseif (all) 81for task in (queued_tasks) 82if (everyone || (realplayer == task[5])) 83`kill_task(task[1]) ! ANY'; 84killed = killed + 1; 85if (!quiet) 86this:_kill_task_message(task); 87endif 88endif 89$command_utils:suspend_if_needed(3, "... killing tasks"); 90endfor 91elseif (soon) 92now = time(); 93for task in (queued_tasks) 94if (((task[2] - now) < soon) && ((!player.wizard) || (everyone || (realplayer == task[5])))) 95`kill_task(task[1]) ! ANY'; 96killed = killed + 1; 97if (!quiet) 98this:_kill_task_message(task); 99endif 100endif 101$command_utils:suspend_if_needed(3, "... killing tasks"); 102endfor 103elseif (percent) 104for task in (queued_tasks) 105if (digits == (task[1] % percent)) 106`kill_task(task[1]) ! ANY'; 107killed = killed + 1; 108if (!quiet) 109this:_kill_task_message(task); 110endif 111endif 112$command_utils:suspend_if_needed(3, "... killing tasks"); 113endfor 114elseif ((colon || vrb) || whatstr) 115for task in (queued_tasks) 116if ((((((whatstr == "") || (valid(task[6]) && (index(task[6].name, whatstr) == 1))) || (valid(task[9]) && (index(task[9].name, whatstr) == 1))) || (task[9] == what)) || (task[6] == what)) && ((vrb == "") || (index(" " + strsub(task[7], "*", ""), " " + vrb) == 1))) 117`kill_task(task[1]) ! ANY'; 118killed = killed + 1; 119if (!quiet) 120this:_kill_task_message(task); 121endif 122endif 123$command_utils:suspend_if_needed(3, "... killing tasks"); 124endfor 125else 126player:notify("Something is funny; I didn't understand your @kill command. You shouldn't have gotten here. Please send yduJ mail saying you got this message from @kill, and what you had typed to @kill."); 127endif 128if (!killed) 129player:notify("No tasks killed."); 130elseif (quiet) 131player:notify(tostr("Killed ", killed, " tasks.")); 132endif
@copy @copy-x @copy-move
Referenced by
none
Source
1"Usage: @copy source:verbname to target[:verbname]"; 2" the target verbname, if not given, defaults to that of the source. If the target verb doesn't already exist, a new verb is installed with the same args, names, code, and permission flags as the source. Otherwise, the existing target's verb code is overwritten and no other changes are made."; 3"This the poor man's version of multiple inheritance... the main problem is that someone may update the verb you're copying and you'd never know."; 4" if @copy-x is used, makes an unusable copy (!x, this none this). If @copy-move is used, deletes the source verb as well."; 5set_task_perms(player); 6if (!player.programmer) 7player:notify("You need to be a programmer to do this."); 8player:notify("If you want to become a programmer, talk to a wizard."); 9return; 10elseif ((verb != "@copy-move") && (!$quota_utils:verb_addition_permitted(player))) 11player:notify("Verb addition not permitted because quota exceeded."); 12return; 13elseif ((!(from = $code_utils:parse_verbref(dobjstr))) || (!iobjstr)) 14player:notify(tostr("Usage: ", verb, " obj:verb to obj:verb")); 15player:notify(tostr(" ", verb, " obj:verb to obj")); 16player:notify(tostr(" ", verb, " obj:verb to :verb")); 17return; 18elseif ($command_utils:object_match_failed(fobj = player:my_match_object(from[1]), from[1])) 19return; 20elseif (iobjstr[1] == ":") 21to = {fobj, iobjstr[2..$]}; 22elseif (!(to = $code_utils:parse_verbref(iobjstr))) 23iobj = player:my_match_object(iobjstr); 24if ($command_utils:object_match_failed(iobj, iobjstr)) 25return; 26endif 27to = {iobj, from[2]}; 28elseif ($command_utils:object_match_failed(tobj = player:my_match_object(to[1]), to[1])) 29return; 30else 31to[1] = tobj; 32endif 33from[1] = fobj; 34if (verb == "@copy-move") 35if ((!$perm_utils:controls(player, fobj)) && (!$quota_utils:verb_addition_permitted(player))) 36player:notify("Won't be able to delete old verb. Quota exceeded, so unable to continue. Aborted."); 37return; 38elseif ($perm_utils:controls(player, fobj)) 39"only try to move if the player controls the verb. Otherwise, skip and treat as regular @copy"; 40if (typeof(result = $code_utils:move_verb(@from, @to)) == ERR) 41player:notify(tostr("Unable to move verb from ", from[1], ":", from[2], " to ", to[1], ":", to[2], " --> ", result)); 42else 43player:notify(tostr("Moved verb from ", from[1], ":", from[2], " to ", result[1], ":", result[2])); 44endif 45return; 46else 47player:notify("Won't be able to delete old verb. Treating this as regular @copy."); 48endif 49endif 50to_firstname = strsub(to[2][1..index(to[2] + " ", " ") - 1], "*", "") || "*"; 51if ((!(hv = $object_utils:has_verb(to[1], to_firstname))) || (hv[1] != to[1])) 52if ((!(info = `verb_info(@from) ! ANY')) || (!(vargs = `verb_args(@from) ! ANY'))) 53player:notify(tostr("Retrieving ", from[1], ":", from[2], " --> ", info && vargs)); 54return; 55endif 56if (!player.wizard) 57info[1] = player; 58endif 59if (verb == "@copy-x") 60"... make sure this is an unusable copy..."; 61info[2] = strsub(info[2], "x", ""); 62vargs = {"this", "none", "this"}; 63endif 64if (from[2] != to[2]) 65info[3] = to[2]; 66endif 67if (ERR == typeof(e = `add_verb(to[1], info, vargs) ! ANY')) 68player:notify(tostr("Adding ", to[1], ":", to[2], " --> ", e)); 69return; 70endif 71endif 72if (is_a(to[1], from[1]) && (from[1] != to[1])) 73player:notify("WARNING: copying a verb from a parent to its child so you can modify a few lines ALMOST CERTAINLY means you are a dumbass who doesn't understand object oriented coding. Consider whether what you are doing is dumbassery. Ask an adult."); 74endif 75code = `verb_code(@from) ! ANY'; 76owner = `verb_info(@from)[1] ! ANY'; 77if (typeof(code) == ERR) 78player:notify(tostr("Couldn't retrieve code from ", from[1].name, " (", from[1], "):", from[2], " => ", code)); 79return; 80endif 81if (owner != player) 82code = {tostr("\"Copied from ", from[1].name, " (", from[1], "):", from[2], (from[1] == owner) ? " " | tostr(" by ", owner.name, " (", owner, ") "), ctime(), "\";"), @code}; 83if (!player:prog_option("copy_expert")) 84player:notify("Use of @copy is discouraged. Please do not use @copy if you can use inheritance or features instead. Use @copy carefully, and only when absolutely necessary, as it is wasteful of database space."); 85endif 86endif 87if (ERR == typeof(e = `$wiz_utils:set_verb_code(to[1], to_firstname, code) ! ANY')) 88player:notify(tostr("Copying ", from[1], ":", from[2], " to ", to[1], ":", to[2], " --> ", e)); 89else 90player:notify(tostr(to[1], ":", to[2], " code set.")); 91endif
_kill_task_message
Referenced by
- #50:@kill line 86:
this:_kill_task_message - #50:@kill line 98:
this:_kill_task_message - #50:@kill line 109:
this:_kill_task_message - #50:@kill line 120:
this:_kill_task_message
Source
1set_task_perms(caller_perms()); 2task = args[1]; 3player:notify(tostr("Killed: ", $string_utils:right(tostr("task ", task[1]), 17), ", verb ", task[6], ":", task[7], ", line ", task[8], (task[9] != task[6]) ? ", this==" + tostr(task[9]) | ""));
@prog*ram @program# @prog#
Referenced by
none
Source
1"Copied from generic programmer (#58):@prog by Satan (#2) Thu Aug 21 23:08:13 2008 CDT"; 2"This version of @program deals with multiple verbs having the same name."; 3"... @program <object>:<verbname> <dobj> <prep> <iobj> picks the right one."; 4if (player != caller) 5return {}; 6endif 7set_task_perms(player); 8"..."; 9"...catch usage errors first..."; 10"..."; 11punt = "...set punt to 0 only if everything works out..."; 12if (!(args && (spec = $code_utils:parse_verbref(args[1])))) 13player:notify(tostr("Usage: ", verb, " <object>:<verb> [<dobj> <prep> <iobj>]")); 14elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 15"...bogus object..."; 16elseif (typeof(argspec = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST) 17player:notify(tostr(argspec)); 18elseif (verb in {"@program#", "@prog#"}) 19verbname = $code_utils:toint(spec[2]); 20if (verbname == E_TYPE) 21player:notify("Verb number expected."); 22elseif (length(args) > 1) 23player:notify("Don't give args for @program#."); 24elseif ((verbname < 1) || `verbname > length(verbs(object)) ! E_PERM') 25player:notify("Verb number out of range."); 26else 27argspec = 0; 28punt = 0; 29endif 30elseif (argspec[2]) 31player:notify($string_utils:from_list(argspec[2], " ") + "??"); 32elseif (length(argspec = argspec[1]) in {1, 2}) 33player:notify({"Missing preposition", "Missing iobj specification"}[length(argspec)]); 34else 35punt = 0; 36verbname = spec[2]; 37if (index(verbname, "*") > 1) 38verbname = strsub(verbname, "*", ""); 39endif 40endif 41"..."; 42"...if we have an argspec, we'll need to reset verbname..."; 43"..."; 44if (punt) 45elseif (argspec) 46if (!(argspec[2] in {"none", "any"})) 47argspec[2] = $code_utils:full_prep(argspec[2]); 48endif 49loc = $code_utils:find_verb_named(object, verbname); 50while ((loc > 0) && (`verb_args(object, loc) ! ANY' != argspec)) 51loc = $code_utils:find_verb_named(object, verbname, loc + 1); 52endwhile 53if (!loc) 54punt = "...can't find it...."; 55player:notify("That object has no verb matching that name + args."); 56else 57verbname = loc; 58endif 59else 60loc = 0; 61endif 62"..."; 63"...get verb info..."; 64"..."; 65if (punt || (!(punt = "...reset punt to TRUE..."))) 66else 67try 68info = verb_info(object, verbname); 69punt = 0; 70aliases = info[3]; 71if (!loc) 72loc = aliases in (verbs(object) || {}); 73endif 74except (E_VERBNF) 75player:notify("That object does not have that verb definition."); 76except error (ANY) 77player:notify(error[2]); 78endtry 79endif 80"..."; 81"...read the code..."; 82"..."; 83if (punt) 84player:notify(tostr("Now ignoring code for ", args ? args[1] | "nothing in particular", ".")); 85$command_utils:read_lines(); 86player:notify("Verb code ignored."); 87else 88player:notify(tostr("Now programming ", object.name, ":", aliases, "(", (!loc) ? "??" | loc, ").")); 89lines = $command_utils:read_lines_escape((active = player in $verb_editor.active) ? {} | {"@edit"}, {tostr("You are editing ", $string_utils:nn(object), ":", verbname, "."), @active ? {} | {"Type `@edit' to take this into the verb editor."}}); 90if (lines[1] == "@edit") 91player:tell(toliteral(lines)); 92$verb_editor:invoke(args[1], "@program", lines[2]); 93return {}; 94endif 95try 96if (result = $wiz_utils:set_verb_code(object, verbname, lines[2])) 97player:notify_lines(result); 98player:notify(tostr(length(result), " error(s).")); 99player:notify("Verb not programmed."); 100else 101player:notify("0 errors."); 102player:notify("Verb programmed."); 103return {object, verbname}; 104endif 105except error (ANY) 106player:notify(error[2]); 107player:notify("Verb not programmed."); 108endtry 109endif 110return {};
@setenv
Referenced by
none
Source
1"Usage: @setenv <environment string>"; 2"Set your .eval_env property."; 3set_task_perms(player); 4if (!argstr) 5player:notify(tostr("Usage: ", verb, " <environment string>")); 6return; 7endif 8player:notify(tostr("Current eval environment is: ", player.eval_env)); 9result = player:set_eval_env(argstr); 10if (typeof(result) == ERR) 11player:notify(tostr(result)); 12return; 13endif 14player:notify(tostr(".eval_env set to \"", player.eval_env, "\" (", player.eval_ticks, " ticks)."));
@pros*pectus pros*pectus
Referenced by
none
Source
1"Usage: @prospectus <player> [from <start>] [to <end>]"; 2set_task_perms((caller_perms() == $nothing) ? player | caller_perms()); 3dobj = dobjstr ? $string_utils:match_player(dobjstr) | player; 4if ($command_utils:player_match_result(dobj, dobjstr)[1]) 5return; 6endif 7dobjwords = $string_utils:words(dobjstr); 8if (args[1..length(dobjwords)] == dobjwords) 9args = args[length(dobjwords) + 1..$]; 10endif 11if (!(parse_result = $code_utils:_parse_audit_args(@args))) 12player:notify(tostr("Usage: ", verb, " player [from <start>] [to <end>]")); 13return; 14endif 15return $building_utils:do_prospectus(dobj, @parse_result);
@d*isplay
Referenced by
none
Source
1"@display <object>[.[property]]*[,[inherited_property]]*[:[verb]]*[;[inherited_verb]]*"; 2if (player != this) 3player:notify(tostr("Sorry, you can't use ", this:title(), "'s `", verb, "' command.")); 4return E_PERM; 5endif 6"null names for properties and verbs are interpreted as meaning all of them."; 7opivu = {{}, {}, {}, {}, {}}; 8string = ""; 9punc = 1; 10literal = 0; 11set_task_perms(player); 12for jj in [1..length(argstr)] 13j = argstr[jj]; 14if (literal) 15string = string + j; 16literal = 0; 17elseif (j == "\\") 18literal = 1; 19elseif (y = index(".,:;", j)) 20opivu[punc] = {@opivu[punc], string}; 21punc = 1 + y; 22string = ""; 23else 24string = string + j; 25endif 26endfor 27opivu[punc] = {@opivu[punc], string}; 28objname = opivu[1][1]; 29it = this:my_match_object(objname); 30if ($command_utils:object_match_failed(it, objname)) 31return; 32endif 33readable = (it.owner == this) || (it.r || this.wizard); 34cant = {}; 35if ("" in opivu[2]) 36if (readable) 37prop = properties(it); 38else 39prop = {}; 40cant = setadd(cant, it); 41endif 42if (this:display_option("changedprops")) 43what = it; 44while (valid(what = parent(what))) 45if ((what.owner == this) || (what.r || this.wizard)) 46for p in (properties(what)) 47if (`!is_clear_property(it, p) ! ANY => 0' && (what.(p) != it.(p))) 48prop = {@prop, p}; 49endif 50endfor 51else 52cant = setadd(cant, what); 53endif 54endwhile 55elseif (!this:display_option("thisonly")) 56what = it; 57while ((!prop) && valid(what = parent(what))) 58if ((what.owner == this) || (what.r || this.wizard)) 59prop = properties(what); 60else 61cant = setadd(cant, what); 62endif 63endwhile 64endif 65else 66prop = opivu[2]; 67endif 68if ("" in opivu[3]) 69inh = {}; 70for what in ({it, @$object_utils:ancestors(it)}) 71if (((what.owner == this) || what.r) || this.wizard) 72inh = {@inh, @properties(what)}; 73else 74cant = setadd(cant, what); 75endif 76endfor 77else 78inh = opivu[3]; 79endif 80for q in (inh) 81if (q in `properties(it) ! ANY => {}') 82prop = setadd(prop, q); 83inh = setremove(inh, q); 84endif 85endfor 86vrb = {}; 87if ("" in opivu[4]) 88if (readable) 89vrbs = verbs(it); 90else 91vrbs = $object_utils:accessible_verbs(it); 92cant = setadd(cant, it); 93endif 94what = it; 95if (!this:display_option("thisonly")) 96while ((!vrbs) && valid(what = parent(what))) 97if ((what.owner == this) || (what.r || this.wizard)) 98vrbs = verbs(what); 99else 100cant = setadd(cant, what); 101endif 102endwhile 103endif 104for n in [1..length(vrbs)] 105vrb = setadd(vrb, {what, n}); 106endfor 107else 108for w in (opivu[4]) 109if (y = $object_utils:has_verb(it, w)) 110vrb = setadd(vrb, {y[1], w}); 111else 112this:notify(tostr("No such verb, \"", w, "\"")); 113endif 114endfor 115endif 116if ("" in opivu[5]) 117for z in ({it, @$object_utils:ancestors(it)}) 118if (((this == z.owner) || z.r) || this.wizard) 119for n in [1..length(verbs(z))] 120vrb = setadd(vrb, {z, n}); 121endfor 122else 123cant = setadd(cant, z); 124endif 125endfor 126else 127for w in (opivu[5]) 128if (typeof(y = $object_utils:has_verb(it, w)) == LIST) 129vrb = setadd(vrb, {y[1], w}); 130else 131this:notify(tostr("No such verb, \"", w, "\"")); 132endif 133endfor 134endif 135if (({""} in opivu) || (opivu[2..5] == {{}, {}, {}, {}})) 136this:notify(tostr(it.name, " (", it, ") [ ", it.r ? "readable " | "", it.w ? "writeable " | "", it.f ? "fertile " | "", is_player(it) ? "(player) " | "", it.programmer ? "programmer " | "", it.wizard ? "wizard " | "", "]")); 137if (it.owner != (is_player(it) ? it | this)) 138this:notify(tostr(" Owned by ", valid(p = it.owner) ? p.name | "** extinct **", " (", p, ").")); 139endif 140this:notify(tostr(" Child of ", valid(p = parent(it)) ? p.name | "** none **", " (", p, ").")); 141if (it.location != $nothing) 142this:notify(tostr(" Location ", valid(p = it.location) ? p.name | "** unplace (tell a wizard, fast!) **", " (", p, ").")); 143endif 144if ($quota_utils.byte_based && $object_utils:has_property(it, "object_size")) 145this:notify(tostr(" Size: ", $string_utils:group_number(it.object_size[1]), " bytes at ", this:ctime(it.object_size[2]))); 146endif 147endif 148blankargs = this:display_option("blank_tnt") ? {"this", "none", "this"} | #-1; 149for b in (vrb) 150$command_utils:suspend_if_needed(0); 151where = b[1]; 152q = b[2]; 153short = (typeof(q) == INT) ? q | strsub(y = index(q, " ") ? q[1..y - 1] | q, "*", ""); 154inf = `verb_info(where, short) ! ANY'; 155if ((typeof(inf) == LIST) || (inf == E_PERM)) 156name = (typeof(inf) == LIST) ? index(inf[3], " ") ? ("\"" + inf[3]) + "\"" | inf[3] | q; 157line = $string_utils:left(tostr($string_utils:right(tostr(where), 6), ":", name, " "), 32); 158if (inf == E_PERM) 159line = line + " ** unreadable **"; 160else 161line = $string_utils:left(tostr(line, inf[1].name, " (", inf[1], ") "), 53) + ((i = inf[2] in {"x", "xd", "d", "rd"}) ? {" x", " xd", " d", "r d"}[i] | inf[2]); 162vargs = `verb_args(where, short) ! ANY'; 163if (vargs != blankargs) 164if (this:display_option("shortprep") && (!(vargs[2] in {"any", "none"}))) 165vargs[2] = $code_utils:short_prep(vargs[2]); 166endif 167line = $string_utils:left(line + " ", 60) + $string_utils:from_list(vargs, " "); 168endif 169endif 170this:notify(line); 171elseif (inf == E_VERBNF) 172this:notify(tostr(inf)); 173this:notify(tostr(" ** no such verb, \"", short, "\" **")); 174else 175this:notify("This shouldn't ever happen. @display is buggy."); 176endif 177endfor 178all = {@prop, @inh}; 179max = (length(all) < 4) ? 999 | (this:linelen() - 56); 180depth = (length(all) < 4) ? -1 | 1; 181truncate_owner_names = length(all) > 1; 182for q in (all) 183$command_utils:suspend_if_needed(0); 184inf = `property_info(it, q) ! ANY'; 185if (inf == E_PROPNF) 186if (q in $code_utils.builtin_props) 187this:notify(tostr($string_utils:left("," + q, 25), "Built in property ", $string_utils:abbreviated_value(it.(q), max, depth))); 188else 189this:notify(tostr(" ** property not found, \"", q, "\" **")); 190endif 191else 192pname = $string_utils:left(tostr((q in `properties(it) ! ANY => {}') ? "." | (`is_clear_property(it, q) ! ANY' ? " " | ","), q, " "), 25); 193if (inf == E_PERM) 194this:notify(pname + " ** unreadable **"); 195else 196oname = inf[1].name; 197truncate_owner_names && ((length(oname) > 12) && (oname = oname[1..12])); 198`inf[2][1] != "r" ! E_RANGE => 1' && (inf[2][1..0] = " "); 199`inf[2][2] != "w" ! E_RANGE => 1' && (inf[2][2..1] = " "); 200this:notify(($string_utils:left(tostr($string_utils:left(tostr(pname, oname, " (", inf[1], ") "), 47), inf[2], " "), 54) + $string_utils:abbreviated_value(it.(q), max, depth)) + $ansi.reset); 201endif 202endif 203endfor 204if (cant) 205failed = {}; 206for k in (cant) 207failed = listappend(failed, tostr(k.name, " (", k, ")")); 208endfor 209this:notify($string_utils:centre(tostr(" no permission to read ", $string_utils:english_list(failed, ", ", " or ", " or "), ". "), 75, "-")); 210else 211this:notify($string_utils:centre(" finished ", 75, "-")); 212endif
@db*size
Referenced by
none
Source
1set_task_perms(player); 2"Let 'em @kill it."; 3count = 0; 4for i in [#0..max_object()] 5if ($command_utils:running_out_of_time()) 6player:notify(tostr("Counting... [", count, "/", i, "]")); 7suspend(0); 8endif 9if (valid(i)) 10count = count + 1; 11endif 12endfor 13player:notify(tostr("There are ", count, " valid objects out of ", toint(max_object()) + 1, " allocated object numbers."));
@gethelp
Referenced by
none
Source
1"@gethelp [<topic>] [from <db or dblist>]"; 2" Prints the raw text of topic from the appropriate help db."; 3" With no argument, gets the blank (\"\") topic from wherever it lives"; 4" Text is printed as a script for changing this help topic "; 5" (somewhat like @dump...)"; 6if (!prepstr) 7topic = argstr; 8dblist = $code_utils:help_db_list(); 9elseif (prepstr != "from") 10player:notify("Usage: ", verb, " [<topic>] [from <db>]"); 11return; 12elseif (!(e = $no_one:eval_d(iobjstr = argstr[$string_utils:word_start(argstr)[(prepstr in args) + 1][1]..$]))) 13player:notify(tostr(e)); 14return; 15elseif (!e[1]) 16player:notify_lines(e[2]); 17return; 18elseif (!(typeof(dblist = e[2]) in {OBJ, LIST})) 19player:notify(tostr(iobjstr, " => ", dblist, " -- not an object or a list")); 20return; 21else 22topic = dobjstr; 23if (typeof(dblist) == OBJ) 24dblist = {dblist}; 25endif 26endif 27search = $code_utils:help_db_search(topic, dblist); 28if (!search) 29player:notify("Topic not found."); 30elseif (search[1] == $ambiguous_match) 31player:notify(tostr("Topic `", topic, "' ambiguous: ", $string_utils:english_list(search[2], "none", " or "))); 32elseif (typeof(text = (db = search[1]):dump_topic(fulltopic = search[2])) == ERR) 33"...ok...shoot me. This is a -d verb..."; 34player:notify(tostr("Cannot retrieve `", fulltopic, "' on ", $code_utils:corify_object(db), ": ", text)); 35else 36player:notify_lines(text); 37endif
@grep @egrep
Referenced by
none
Source
1set_task_perms(player); 2if (prepstr == "in") 3pattern = dobjstr; 4objlist = player:eval_cmd_string(iobjstr, 0); 5if (!objlist[1]) 6player:notify(tostr("Had trouble reading `", iobjstr, "': ")); 7player:notify_lines(@objlist[2]); 8return; 9elseif (typeof(objlist[2]) == OBJ) 10objlist = {objlist[2..2]}; 11elseif (typeof(objlist[2]) != LIST) 12player:notify(tostr("Value of `", iobjstr, "' is not an object or list: ", toliteral(objlist[2]))); 13return; 14else 15objlist = objlist[2..2]; 16endif 17elseif ((prepstr == "from") && ("player.wizard" && (n = toint(toobj(iobjstr))))) 18pattern = dobjstr; 19objlist = {n}; 20elseif (args && "player.wizard") 21pattern = argstr; 22objlist = {}; 23else 24player:notify(tostr("Usage: ", verb, " <pattern> ", "player.wizard" ? "[in {<objectlist>} | from <number>]" | "in {<objectlist>}")); 25return; 26endif 27player:notify(tostr("Searching for verbs ", @prepstr ? {prepstr, " ", iobjstr, " "} | {}, (verb == "@egrep") ? "matching the pattern " | "containing the string ", toliteral(pattern), " ...")); 28player:notify(""); 29$code_utils:((verb == "@egrep") ? "find_verbs_matching" | "find_verbs_containing")(pattern, @objlist);
@s*how
Referenced by
none
Source
1if (player != this) 2player:tell("No way Jose. You're asking for a zotting."); 3return; 4endif 5set_task_perms(player); 6if (dobjstr == "") 7player:notify(tostr("Usage: ", verb, " <object-or-property-or-verb>")); 8return; 9endif 10if (index(dobjstr, ".") && (spec = $code_utils:parse_propref(dobjstr))) 11if (valid(object = player:my_match_object(spec[1]))) 12return $code_utils:show_property(object, spec[2]); 13endif 14elseif (spec = $code_utils:parse_verbref(dobjstr)) 15if (valid(object = player:my_match_object(spec[1]))) 16return $code_utils:show_verbdef(object, spec[2]); 17endif 18elseif (((dobjstr[1] == "$") && ((pname = dobjstr[2..$]) in properties(#0))) && (typeof(#0.(pname)) == OBJ)) 19if (valid(object = #0.(pname))) 20return $code_utils:show_object(object); 21endif 22elseif ((dobjstr[1] == "$") && (spec = $code_utils:parse_propref(dobjstr))) 23return $code_utils:show_property(#0, spec[2]); 24else 25if (valid(object = player:my_match_object(dobjstr))) 26return $code_utils:show_object(object); 27endif 28endif 29$command_utils:object_match_failed(object, dobjstr);
@check-p*roperty
Referenced by
none
Source
1"@check-prop object.property"; 2" checks for descendents defining the given property."; 3set_task_perms(player); 4if (!(spec = $code_utils:parse_propref(dobjstr))) 5player:notify(tostr("Usage: ", verb, " <object>.<prop-name>")); 6elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 7"...bogus object..."; 8elseif ($object_utils:has_property(object, prop = spec[2])) 9player:notify("That object already has that property."); 10elseif (olist = $object_utils:descendants_with_property_suspended(object, prop)) 11player:notify("The following descendents have this property defined:"); 12player:notify(" " + $string_utils:from_list(olist, " ")); 13else 14player:notify("No property name conflicts found."); 15endif
set_eval_env
Referenced by
none
Source
1"set_eval_env(string);"; 2"Run <string> through eval. If it doesn't compile, return E_INVARG. If it crashes, well, it crashes. If it works okay, set .eval_env to it and set .eval_ticks to the amount of time it took."; 3if (is_player(this) && $perm_utils:controls(caller_perms(), this)) 4program = args[1]; 5value = $no_one:eval_d((";ticks = ticks_left();" + program) + ";return ticks - ticks_left() - 2;"); 6if (!value[1]) 7return E_INVARG; 8elseif (typeof(value[2]) == ERR) 9return value[2]; 10endif 11try 12ok = this.eval_env = program; 13this.eval_ticks = value[2]; 14return 1; 15except error (ANY) 16return error[1]; 17endtry 18endif
@clearp*roperty @clprop*erty
Referenced by
none
Source
1"@clearproperty <obj>.<prop>"; 2"Set the value of <obj>.<prop> to `clear', making it appear to be the same as the property on its parent."; 3set_task_perms(player); 4if (!(l = $code_utils:parse_propref(dobjstr))) 5player:notify(tostr("Usage: ", verb, " <object>.<property>")); 6elseif ($command_utils:object_match_failed(dobj = player:my_match_object(l[1]), l[1])) 7"... bogus object..."; 8endif 9try 10if (is_clear_property(dobj, prop = l[2])) 11player:notify(tostr("Property ", dobj, ".", prop, " is already clear!")); 12return; 13endif 14clear_property(dobj, prop); 15player:notify(tostr("Property ", dobj, ".", prop, " cleared; value is now ", toliteral(dobj.(prop)), ".")); 16except (E_INVARG) 17player:notify(tostr("You can't clear ", dobj, ".", prop, "; none of the ancestors define that property.")); 18except error (ANY) 19player:notify(error[2]); 20endtry
@disown @disinherit
Referenced by
none
Source
1"Syntax: @disown <object> [from <object>]"; 2"This command is used to remove unwanted children of objects you control. If you control an object, and there is a child of that object you do not want, this command will chparent() the object to its grandparent."; 3set_task_perms(player); 4if (prepstr) 5if (prepstr != "from") 6player:notify("Usage: ", verb, " <object> [from <object>]"); 7return; 8elseif ($command_utils:object_match_failed(iobj = player:my_match_object(iobjstr), iobjstr)) 9"... from WHAT?.."; 10return; 11elseif (valid(dobj = $string_utils:literal_object(dobjstr))) 12"... literal object number..."; 13if (parent(dobj) != iobj) 14player:notify(tostr(dobj, " is not a child of ", iobj.name, " (", iobj, ")")); 15return; 16endif 17elseif ($command_utils:object_match_failed(dobj = $string_utils:match(dobjstr, children(iobj), "name", children(iobj), "aliases"), dobjstr)) 18"... can't match dobjstr against any children of iobj"; 19return; 20endif 21elseif ($command_utils:object_match_failed(dobj = player:my_match_object(dobjstr), dobjstr)) 22"... can't match dobjstr..."; 23return; 24endif 25try 26if ($object_utils:disown(dobj)) 27player:notify(tostr(dobj.name, " (", dobj, ")'s parent is now ", (grandparent = parent(dobj)).name, " (", grandparent, ").")); 28else 29"this should never happen"; 30endif 31except e (E_PERM, E_INVARG) 32{code, message, value, traceback} = e; 33player:notify(message); 34endtry
eval_cmd_string
Referenced by
none
Source
1":eval_cmd_string(string[,debug])"; 2"Evaluates the string the way this player would normally expect to see it evaluated if it were typed on the command line. debug (defaults to 1) indicates how the debug flag should be set during the evaluation."; 3" => {@eval_result, ticks, seconds}"; 4"where eval_result is the result of the actual eval() call."; 5""; 6"For the case where string is an expression, we need to prefix `return ' and append `;' to string before passing it to eval(). However this is not appropriate for statements, where it is assumed an explicit return will be provided somewhere or that the return value is irrelevant. The code below assumes that string is an expression unless it either begins with a semicolon `;' or one of the MOO language statement keywords."; 7"Next, the substitutions described by this.eval_subs, which should be a list of pairs {string, sub}, are performed on string"; 8"Finally, this.eval_env is prefixed to the beginning while this.eval_ticks is subtracted from the eventual tick count. This allows string to refer to predefined variables like `here' and `me'."; 9set_task_perms(caller_perms()); 10{program, ?debug = 1} = args; 11program = program + ";"; 12debug = debug ? 33 | 0; 13if (!match(program, "^ *%(;%|%(if%|fork?%|return%|while%|try%)[^a-z0-9A-Z_]%)")) 14program = "return " + program; 15endif 16program = tostr(this.eval_env, ";", $code_utils:substitute(program, this.eval_subs)); 17ticks = ((ticks_left() - 48) - this.eval_ticks) + debug; 18seconds = seconds_left(); 19cputime = cputime(); 20value = debug ? eval(program) | $code_utils:eval_d(program); 21cputime = cputime() - cputime; 22seconds = seconds - seconds_left(); 23ticks = ticks - ticks_left(); 24return {@value, ticks, seconds, cputime};
@dump
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."; 7if (player != this) 8player:tell("You suck big, green, pussy, infected donkey cocks for even trying that. Maybe the admins will have pity and not cut off your fingers and ban you forever."); 9return; 10endif 11set_task_perms(player); 12dobj = player:my_match_object(dobjstr); 13if ($command_utils:object_match_failed(dobj, dobjstr)) 14return; 15endif 16if (prepstr && (prepstr != "with")) 17player:notify(tostr("Usage: ", verb, " something [with [id=...] [noprops] [noverbs] [create]]")); 18return; 19endif 20targname = tostr(dobj); 21options = {"props", "verbs"}; 22create = 0; 23if (iobjstr) 24for o in ($string_utils:explode(iobjstr)) 25if (index(o, "id=") == 1) 26targname = o[4..$]; 27elseif (o in {"noprops", "noverbs"}) 28options = setremove(options, o[3..$]); 29elseif (o in {"create"}) 30create = 1; 31else 32player:notify(tostr("`", o, "' not understood as valid option.")); 33player:notify(tostr("Usage: ", verb, " something [with [id=...] [noprops] [noverbs] [create]]")); 34return; 35endif 36endfor 37endif 38if (create) 39player:notify($code_utils:dump_preamble(dobj)); 40endif 41if ("props" in options) 42player:notify_lines_suspended($code_utils:dump_properties(dobj, create)); 43endif 44if (!("verbs" in options)) 45player:notify("\"***finished***"); 46return; 47endif 48player:notify(""); 49player:notify_lines_suspended($code_utils:dump_verbs(dobj, create)); 50player:notify("\"***finished***");
eval_value_to_string
Referenced by
- #50:eval*-d line 15:
this:eval_value_to_string
Source
1set_task_perms(caller_perms()); 2if (typeof(val = args[1]) == OBJ) 3return tostr("=> ", val, " ", valid(val) ? ("(" + val.name) + ")" | ((a = $list_utils:assoc(val, {{#-1, "<$nothing>"}, {#-2, "<$ambiguous_match>"}, {#-3, "<$failed_match>"}})) ? a[2] | "<invalid>")); 4elseif (typeof(val) == ERR) 5return tostr("=> ", toliteral(val), " (", val, ")"); 6else 7return tostr("=> ", toliteral(val)); 8endif
@progo*ptions @prog-o*ptions @programmero*ptions @programmer-o*ptions
Referenced by
none
Source
1"@<what>-option <option> [is] <value> sets <option> to <value>"; 2"@<what>-option <option>=<value> sets <option> to <value>"; 3"@<what>-option +<option> sets <option> (usually equiv. to <option>=1"; 4"@<what>-option -<option> resets <option> (equiv. to <option>=0)"; 5"@<what>-option !<option> resets <option> (equiv. to <option>=0)"; 6"@<what>-option <option> displays value of <option>"; 7set_task_perms(player); 8what = "prog"; 9options = what + "_options"; 10option_pkg = #0.(options); 11set_option = ("set_" + what) + "_option"; 12if (!args) 13player:notify_lines({("Current " + what) + " options:", "", @option_pkg:show(this.(options), option_pkg.names)}); 14return; 15elseif (typeof(presult = option_pkg:parse(args)) == STR) 16player:notify(presult); 17return; 18else 19if (length(presult) > 1) 20if (typeof(sresult = this:(set_option)(@presult)) == STR) 21player:notify(sresult); 22return; 23elseif (!sresult) 24player:notify("No change."); 25return; 26endif 27endif 28player:notify_lines(option_pkg:show(this.(options), presult[1])); 29endif
prog_option
Referenced by
none
Source
1":prog_option(name)"; 2"Returns the value of the specified prog option"; 3if ((caller == this) || $perm_utils:controls(caller_perms(), this)) 4return $prog_options:get(this.prog_options, args[1]); 5else 6return E_PERM; 7endif
set_prog_option
Referenced by
none
Source
1":set_prog_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 7"...this is kludgy, but it saves me from writing the same verb 3 times."; 8"...there's got to be a better way to do this..."; 9verb[1..4] = ""; 10foo_options = verb + "s"; 11"..."; 12if (typeof(s = #0.(foo_options):set(this.(foo_options), @args)) == STR) 13return s; 14elseif (s == this.(foo_options)) 15return 0; 16else 17this.(foo_options) = s; 18return 1; 19endif
@list*#
Referenced by
none
Source
1"@list <obj>:<verb> [<dobj> <prep> <iobj>] [with[out] paren|num] [all] [ranges]"; 2set_task_perms(player); 3bynumber = verb == "@list#"; 4pflag = player:prog_option("list_all_parens"); 5nflag = !player:prog_option("list_no_numbers"); 6permflag = player:prog_option("list_show_permissions"); 7aflag = 0; 8argspec = {}; 9range = {}; 10spec = args ? $code_utils:parse_verbref(args[1]) | E_INVARG; 11args = spec ? listdelete(args, 1) | E_INVARG; 12while (args) 13if (args[1] && ((index("without", args[1]) == 1) || (args[1] == "wo"))) 14"...w,wi,wit,with => 1; wo,witho,withou,without => 0..."; 15fval = !index(args[1], "o"); 16if (`index("parentheses", args[2]) ! ANY' == 1) 17pflag = fval; 18args[1..2] = {}; 19elseif (`index("numbers", args[2]) ! ANY' == 1) 20nflag = fval; 21args[1..2] = {}; 22else 23player:notify(tostr(args[1], " WHAT?")); 24args = E_INVARG; 25endif 26elseif (index("all", args[1]) == 1) 27if (bynumber) 28player:notify("Don't use `all' with @list#."); 29args = E_INVARG; 30else 31aflag = 1; 32args[1..1] = {}; 33endif 34elseif (index("0123456789", args[1][1]) || (index(args[1], "..") == 1)) 35if (E_INVARG == (s = $seq_utils:from_string(args[1]))) 36player:notify(tostr("Garbled range: ", args[1])); 37args = E_INVARG; 38else 39range = $seq_utils:union(range, s); 40args = listdelete(args, 1); 41endif 42elseif (bynumber) 43player:notify("Don't give args with @list#."); 44args = E_INVARG; 45elseif (argspec) 46"... second argspec? Not likely ..."; 47player:notify(tostr(args[1], " unexpected.")); 48args = E_INVARG; 49elseif (typeof(pas = $code_utils:parse_argspec(@args)) == LIST) 50argspec = pas[1]; 51if (length(argspec) < 2) 52player:notify(tostr("Argument `", @argspec, "' malformed.")); 53args = E_INVARG; 54else 55argspec[2] = $code_utils:full_prep(argspec[2]) || argspec[2]; 56args = pas[2]; 57endif 58else 59"... argspec is bogus ..."; 60player:notify(tostr(pas)); 61args = E_INVARG; 62endif 63endwhile 64if (args == E_INVARG) 65if (bynumber) 66player:notify(tostr("Usage: ", verb, " <object>:<verbnumber> [with|without parentheses|numbers] [ranges]")); 67else 68player:notify(tostr("Usage: ", verb, " <object>:<verb> [<dobj> <prep> <iobj>] [with|without parentheses|numbers] [all] [ranges]")); 69endif 70return; 71elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 72return; 73endif 74shown_one = 0; 75for what in ({object, @$object_utils:ancestors(object)}) 76if (bynumber) 77vname = $code_utils:toint(spec[2]); 78if (vname == E_TYPE) 79return player:notify("Verb number expected."); 80elseif ((vname < 1) || `vname > length(verbs(what)) ! E_PERM => 0') 81return player:notify("Verb number out of range."); 82endif 83code = `verb_code(what, vname, pflag) ! ANY'; 84elseif (argspec) 85vnum = $code_utils:find_verb_named(what, spec[2]); 86while (vnum && (`verb_args(what, vnum) ! ANY' != argspec)) 87vnum = $code_utils:find_verb_named(what, spec[2], vnum + 1); 88endwhile 89vname = vnum; 90code = (!vnum) ? E_VERBNF | `verb_code(what, vnum, pflag) ! ANY'; 91else 92vname = spec[2]; 93code = `verb_code(what, vname, pflag) ! ANY'; 94endif 95if (code != E_VERBNF) 96if (shown_one) 97player:notify(""); 98elseif (what != object) 99player:notify(tostr("Object ", object, " does not define that verb", argspec ? " with those args" | "", ", but its ancestor ", what, " does.")); 100endif 101if (typeof(code) == ERR) 102player:notify(tostr(what, ":", vname, " -- ", code)); 103else 104info = verb_info(what, vname); 105vargs = verb_args(what, vname); 106fullname = info[3]; 107if (index(fullname, " ")) 108fullname = toliteral(fullname); 109endif 110if (index(vargs[2], "/")) 111vargs[2] = tostr("(", vargs[2], ")"); 112endif 113player:notify(tostr(what, ":", fullname, " ", $string_utils:from_list(vargs, " "), permflag ? " " + info[2] | "")); 114if (code == {}) 115player:notify("(That verb has not been programmed.)"); 116else 117lineseq = {1, length(code) + 1}; 118range && (lineseq = $seq_utils:intersection(range, lineseq)); 119if (!lineseq) 120player:notify("(No lines in that range.)"); 121endif 122for k in [1..length(lineseq) / 2] 123for i in [lineseq[(2 * k) - 1]..lineseq[2 * k] - 1] 124if (nflag) 125player:notify(tostr(" "[1..i < 10], i, ": ", code[i])); 126else 127player:notify(code[i]); 128endif 129$command_utils:suspend_if_needed(0); 130endfor 131endfor 132endif 133endif 134shown_one = 1; 135endif 136if (shown_one && (!aflag)) 137return; 138endif 139endfor 140if (!shown_one) 141player:notify(tostr("That object does not define that verb", argspec ? " with those args." | ".")); 142endif
set_eval_subs
Referenced by
none
Source
1"Copied from Player Class hacked with eval that does substitutions and assorted stuff (#8855):set_eval_subs by Geust (#24442) Fri Aug 5 13:18:59 1994 PDT"; 2if (!$perm_utils:controls(caller_perms(), this)) 3return E_PERM; 4elseif (typeof(subs = args[1]) != LIST) 5return E_TYPE; 6else 7for pair in (subs) 8if (((length(pair) != 2) || typeof(pair[1] != STR)) || typeof(pair[2] != STR)) 9return E_INVARG; 10endif 11endfor 12endif 13return `this.eval_subs = subs ! ANY';
@verbs* v verbs
Referenced by
none
Source
1if (player != this) 2player:tell("Can I ask you something? Why are you BEGGING FOR DEATH by messing with things you don't understand? Seriously, stop being an ass and just play the goddamn game."); 3return; 4endif 5set_task_perms(player); 6if (!dobjstr) 7try 8if ((verb[7] != "(") && (verb[$] != ")")) 9player:tell("Usage: @verbs <object>"); 10return; 11else 12dobjstr = verb[8..$ - 1]; 13endif 14except (E_RANGE) 15return player:tell("Usage: @verbs <object>"); 16endtry 17endif 18thing = player:my_match_object(dobjstr); 19if (!$command_utils:object_match_failed(thing, dobjstr)) 20verbs = $object_utils:accessible_verbs(thing); 21player:tell(";verbs(", thing, ") => ", toliteral(verbs)); 22endif
@forked-v*erbose
Referenced by
none
Source
1"Syntax: @forked-v*erbose [player]"; 2" @forked-v*erbose all wizards"; 3""; 4"For a normal player, shows all the tasks you have waiting in your queue, especially those forked or suspended. A wizard will see all the tasks of all the players unless the optional argument is provided. For a task which has suspended, and not a fresh fork, shows the full callers() stack."; 5"The second form is only usable by wizards and provides an output of all tasks owned by characters who are .wizard=1. Useful to find a task that may get put in a random queue due to $wiz_utils:random_wizard. Or even finding verbs that run with wizard permissions that shouldn't be."; 6set_task_perms(player); 7if (!dobjstr) 8tasks = queued_tasks(); 9elseif ((dobjstr == "all wizards") && player.wizard) 10tasks = {}; 11for t in (queued_tasks()) 12if (valid(t[5]) && t[5].wizard) 13tasks = {@tasks, t}; 14endif 15$command_utils:suspend_if_needed(1); 16endfor 17elseif ($command_utils:player_match_result(dobj = $string_utils:match_player(dobjstr), dobjstr)[1]) 18return; 19elseif (typeof(tasks = $wiz_utils:queued_tasks(dobj)) != LIST) 20player:notify(tostr(verb, " ", dobj.name, "(", dobj, "): ", tasks)); 21return; 22endif 23if (tasks) 24su = $string_utils; 25player:notify("Queue ID Start Time Owner Verb (Line) [This]"); 26player:notify("-------- ---------- ----- -----------------"); 27now = time(); 28for task in (tasks) 29$command_utils:suspend_if_needed(0); 30{q_id, start, nu, nu2, owner, vloc, vname, lineno, this} = task; 31time = (start >= now) ? ctime(start)[5..24] | su:left((start == -1) ? "Reading input ..." | tostr(now - start, " seconds ago..."), 20); 32owner_name = valid(owner) ? owner.name | tostr("Dead ", owner); 33player:notify(tostr(su:left(tostr(q_id), 10), " ", time, " ", su:left(owner_name, 12), " ", vloc, ":", vname, " (", lineno, ")", (this != vloc) ? tostr(" [", this, "]") | "")); 34if (stack = `task_stack(q_id, 1) ! E_INVARG => 0') 35for frame in (listdelete(stack, 1)) 36{sthis, svname, sprogger, svloc, splayer, slineno} = frame; 37player:notify(tostr(" Called By... ", su:left(valid(sprogger) ? sprogger.name | tostr("Dead ", sprogger), 12), " ", svloc, ":", svname, (sthis != svloc) ? tostr(" [", sthis, "]") | "", " (", slineno, ")")); 38endfor 39endif 40endfor 41player:notify("-----------------------------------------------------------------"); 42else 43player:notify("No tasks."); 44endif
@prop*erties @props
Referenced by
none
Source
1if (player != this) 2player:tell("Props? Yeah, you'll get mad props from all your little hax0r kid friends when they find out you can look at properties! NOT!"); 3return; 4endif 5if (!dobjstr) 6player:tell("@props <obj>"); 7return; 8endif 9set_task_perms(caller_perms()); 10if (valid(dobj)) 11object = dobj; 12elseif ((dobjstr[1] == "$") && $object_utils:has_property(#0, dobjstr[2..$])) 13object = #0.(dobjstr[2..$]); 14else 15object = toobj(dobjstr); 16endif 17if (object == #0) 18player:tell("Couldn't match \"", dobjstr, "\"."); 19return; 20else 21player:tell(";properties(", tostr(object), ") => ", $string_utils:from_value(properties(object), "\"")); 22endif
walkto
Referenced by
none
Source
1if (dobjstr == "home") 2dobj = this.home; 3endif 4where = dobj; 5if (!valid(where)) 6where = $su:match_player(dobjstr); 7endif 8if (!$ou:isa(where, $room)) 9where = where.location; 10endif 11if (!valid(where:area())) 12player:tell($su:nn(where), " isn't in a connected area."); 13return; 14endif 15player:tell("Walking you to ", $su:nn(where), "..."); 16count = 0; 17lastrooms = {}; 18while ((count < 50) && (this.location != where)) 19if (this.location in lastrooms) 20player:tell("You realize you're going in circles, and give up."); 21return; 22endif 23lastrooms = setadd(lastrooms, this.location); 24nexthop = this.location:next_hop_to(where); 25if (!valid(nexthop)) 26player:tell("You're completely lost now."); 27return; 28endif 29nexthop:move(player); 30suspend(1); 31count = count + 1; 32endwhile
@proped*it
Referenced by
none
Source
1o = {}; 2for x in ($ou:all_properties(dobj)) 3pinfo = property_info(dobj, x); 4if (!(x in {"owned_objects", "messages"})) 5if (((x in properties(dobj)) || (pinfo[1] == player)) || index(pinfo[2], "c")) 6val = $string_utils:print(dobj.(x)); 7o = {@o, ((((";" + tostr(dobj)) + ".") + x) + " = ") + val}; 8endif 9endif 10endfor 11notify(player, tostr("#$# edit name: propedit upload: null")); 12for line in (o) 13notify(player, line); 14endfor 15notify(player, ".");
@exam*ine
Referenced by
none
Source
1if (player != this) 2player:tell("I don't understand that."); 3return; 4endif 5"Copied from generic player (#6):@exam by Satan (#2) Fri Mar 5 00:43:00 2004 PST"; 6"This verb should probably go away once 'examine' is in place."; 7if (dobjstr == "") 8player:notify(tostr("Usage: ", verb, " <object>")); 9return; 10endif 11what = $string_utils:match_object(dobjstr, player.location); 12if ($command_utils:object_match_failed(what, dobjstr)) 13return; 14endif 15player:notify(tostr(what.name, " (", what, ") is owned by ", valid(what.owner) ? what.owner.name | "a recycled player", " (", what.owner, ").")); 16player:notify(tostr("Aliases: ", $string_utils:english_list(what.aliases))); 17desc = what:description(); 18if (desc) 19player:notify_lines(desc); 20else 21player:notify("(No description set.)"); 22endif 23"if ($perm_utils:controls(player, what))"; 24" player:notify(tostr(\"Key: \", $lock_utils:unparse_key(what.key)));"; 25"endif"; 26contents = what.contents; 27if (contents) 28player:notify("Contents:"); 29for item in (contents) 30player:notify(tostr(" ", item.name, " (", item, ")")); 31endfor 32endif 33"Use dobjstr, not shortest alias."; 34name = dobjstr; 35"name = what.name;"; 36"if (typeof(what.aliases) == LIST && what.aliases != {})"; 37"for alias in (what.aliases)"; 38"if (length(alias) <= length(name))"; 39"name = alias;"; 40"endif"; 41"endfor"; 42"endif"; 43vrbs = {}; 44commands_ok = what in {player, player.location}; 45dull_classes = {$root_class, $room, $player, $prog}; 46what = what; 47printed_working_msg = 0; 48while (what != $nothing) 49if ($command_utils:running_out_of_time()) 50if (!printed_working_msg) 51player:notify("Working on list of obvious verbs..."); 52printed_working_msg = 1; 53endif 54suspend(0); 55endif 56if (!(what in dull_classes)) 57for i in [1..length(verbs(what))] 58if ($command_utils:running_out_of_time()) 59if (!printed_working_msg) 60player:notify("Working on list of obvious verbs..."); 61printed_working_msg = 1; 62endif 63suspend(0); 64endif 65info = verb_info(what, i); 66syntax = verb_args(what, i); 67if ((index(info[2], "r") && ((syntax[2..3] != {"none", "this"}) && (commands_ok || ("this" in syntax)))) && verb_code(what, i)) 68{dobj, prep, iobj} = syntax; 69if (syntax == {"any", "any", "any"}) 70prep = "none"; 71endif 72if (prep != "none") 73for x in ($string_utils:explode(prep, "/")) 74if (length(x) <= length(prep)) 75prep = x; 76endif 77endfor 78endif 79"This is the correct way to handle verbs ending in *"; 80vname = info[3]; 81while (j = index(vname, "* ")) 82vname = tostr(vname[1..j - 1], "<anything>", vname[j + 1..$]); 83endwhile 84if (vname[$] == "*") 85vname = vname[1..$ - 1] + "<anything>"; 86endif 87vname = strsub(vname, " ", "/"); 88rest = ""; 89if (prep != "none") 90rest = " " + ((prep == "any") ? "<anything>" | prep); 91if (iobj != "none") 92rest = tostr(rest, " ", (iobj == "this") ? name | "<anything>"); 93endif 94endif 95if (dobj != "none") 96rest = tostr(" ", (dobj == "this") ? name | "<anything>", rest); 97endif 98vrbs = setadd(vrbs, (" " + vname) + rest); 99endif 100endfor 101endif 102what = parent(what); 103endwhile 104if (vrbs) 105player:notify("Obvious Verbs:"); 106player:notify_lines(vrbs); 107printed_working_msg && player:notify("(End of list.)"); 108elseif (printed_working_msg) 109player:notify("No obvious verbs found."); 110endif
@shout
Referenced by
none
Source
1"Copied from generic wizard (#57):@shout by Satan (#2) Tue Aug 19 22:05:31 2008 CDT"; 2if ((length(args) == 1) && (argstr[1] == "\"")) 3argstr = args[1]; 4endif 5shout = $gender_utils:get_conj("shouts", player); 6for person in (connected_players()) 7if (person != player) 8person:notify($ansi.bold_on); 9person:notify(tostr(player.name, " ", shout, ", \"", argstr, "\"")); 10person:notify($ansi.bold_off); 11endif 12endfor 13player:notify(tostr("You shout, \"", argstr, "\""));
@copy-msg @copymsg @msg-copy @msgcopy
Referenced by
none
Source
1if ((!valid(dobj)) || (!valid(iobj))) 2player:tell("Usage: @msgcopy <object a> to <object b>"); 3return; 4endif 5player:tell($ansi.bold_on + "Copying all messages from ", $su:nn(dobj), " to ", $su:nn(iobj), "...", $ansi.reset); 6for x in ($ou:all_properties(dobj)) 7if (index(x, "_msg")) 8player:tell("Copying ", x, ": \"", dobj.(x), "\""); 9iobj.(x) = dobj.(x); 10endif 11endfor 12player:tell(($ansi.bold_on + "Finished copying messages.") + $ansi.reset);
@who-solved
Referenced by
none
Source
1quest = dobjstr; 2solved = {}; 3for x in (players()) 4if (quest in x.quest_xp) 5solved = {@solved, x}; 6endif 7endfor 8player:tell("Players who have solved the '", quest, "' quest: ", $su:english_list($lu:map_prop(solved, "name")), ".");
die_disable
Referenced by
none
Source
1this:tell(""); 2this:tell(($ansi.bold_on + "YOU DIED, DUMBASS.") + $ansi.reset); 3this:tell(""); 4this.blood = {}; 5this.health = this.health_max;
sizeup
Referenced by
none
Source
1target = $match_utils:match(dobjstr, this.location:occupants($living)); 2if (player == target) 3player = this; 4endif 5his = target:weapon():edps(target, this); 6mine = this:weapon():edps(this, target); 7this:tell(target:dnamec(), " delivers ", his, " damage per second to you."); 8this:tell("You deliver ", mine, " damage per second to ", target.po, "."); 9if (his > 0.0) 10histime = toint(tofloat(this.health_max) * (1.0 / his)); 11else 12histime = 9999; 13endif 14if (mine > 0.0) 15mytime = toint(tofloat(target.health_max) * (1.0 / mine)); 16else 17mytime = 9999; 18endif 19this:tell("It'd take you ", mytime, " seconds to kill ", target.po, "."); 20this:tell("It'd take ", target.po, " ", histime, " seconds to kill you.");
@rooms
Referenced by
none
Source
1"Copied from Frand's player class (#89):@rooms by Hacker (#36) Wed Jul 6 16:57:30 2005 CDT"; 2"'@rooms' - List the rooms which are known by name."; 3line = ""; 4for item in (this.rooms) 5line = (((line + item[1]) + "(") + tostr(item[2])) + ") "; 6endfor 7player:tell(line);
murder
Referenced by
none
Source
1if (player != this) 2player:tell("So you like to murder, eh? Well guess what, so do I!"); 3player:die(); 4return; 5endif 6dobj = $match_utils:match(dobjstr, this.location:occupants($living)); 7if ((!valid(dobj)) || is_a(dobj, $corpse)) 8live = {}; 9for x in (this.location:occupants($creature)) 10if (!is_a(x, $corpse)) 11live = {@live, x}; 12endif 13endfor 14dobj = $match_utils:match(dobjstr, live); 15endif 16if (valid(dobj)) 17if (is_a(dobj, $living)) 18this:aat($su:ps(this.progkill_msg, this, dobj)); 19dobj:die(); 20else 21this:tell("You cannot murder ", dobj.name, "."); 22endif 23else 24dobj = $match_utils:match(dobjstr, this.location.exits); 25if (valid(dobj)) 26this:aat($su:ps(this.progkill_msg, this, dobj)); 27for x in (dobj.otherside.location:occupants($creature)) 28if (!is_a(x, $corpse)) 29x:die(); 30endif 31endfor 32endif 33endif
res*urrect
Referenced by
none
Source
1"Copied from Jed (#2918):res Fri Dec 2 22:03:41 2005 CST"; 2dobj = $mu:match(dobjstr, player.location:occupants($corpse)); 3if (!valid(dobj)) 4dobj = $su:match_player(dobjstr); 5dobj = dobj.body; 6if (!valid(dobj)) 7player:tell("Resurrect who?"); 8return; 9endif 10endif 11on = dobj; 12dead = on:is_dead(); 13if (dead == 2) 14player:tell("Sorry, you're too late."); 15elseif (dead == 1) 16on.location:announce_all(on:dnamec(), " groggily gets to ", on.pp, " feet."); 17on:_wake(); 18endif
hall healall
Referenced by
none
Source
1for x in (this.location:occupants($creature)) 2x.blood = {}; 3x:take_damage($damage, -x.health_max, $bodypart, x); 4endfor 5player:tell("Healed all.");
whodo
Referenced by
none
Source
1l = {}; 2ppl = args ? args[1] | $heart.all_creatures; 3ppl = $lu:list_is_a(ppl, #1); 4for x in ($list_utils:sort_suspended(0, ppl, $list_utils:map_verb_value(ppl, "area"))) 5$cu:sin(0); 6if (!is_a(x, $creature)) 7continue; 8endif 9area = is_a(x.body, $body) ? area(x.body) | area(x); 10area = valid(area) ? area.name | ""; 11if (x.wizard) 12icon = "!"; 13elseif (x.programmer) 14icon = "*"; 15else 16icon = " "; 17endif 18if (x.executing) 19l = {@l, {x.name, x, area, icon, `x:doing_msg() ! ANY => "error in doing_msg"'}}; 20endif 21endfor 22l = $lu:sort_alist_suspended(0, l, 3); 23out = {}; 24for x in (l) 25$cu:sin(0); 26m = tostr($ansi.green, x[4], $ansi.reset, " "); 27m = tostr(m, $su:left(x[1], -18), " "); 28m = tostr(m, $su:left(tostr(x[2]), -8)); 29m = tostr(m, $ansi.yellow, $su:left(x[3], -15), $ansi.reset, " "); 30m = m + $su:left(x[5], -32); 31out = {@out, m}; 32endfor 33player:tell(tostr(" ", $ansi.bold_on, $ansi.bg_blue, $ansi.white, $ansi.underline_on, "Creature Area Doing ", $ansi.reset)); 34player:tell_lines(out);
_kick
Referenced by
none
Source
1player = args[1]; 2dojb = args[2]; 3bodypart = `args[3] ! ANY => #-1'; 4if ((!valid(dobj)) || is_a(dobj, $corpse)) 5live = {}; 6for x in (this.location:occupants($creature)) 7if (!is_a(x, $corpse)) 8live = {@live, x}; 9endif 10endfor 11dobj = $match_utils:match(dobjstr, live); 12endif 13attack = #127:check(player, 0); 14defense = #139:check(dobj, 0); 15if (attack < -3) 16this:aat(this:dnamec(), " spastically lashes ", this.pp, " leg out at ", dobj:dname(), ", but totally whiffs it."); 17return; 18elseif (attack <= defense) 19this:aat(this:dnamec(), " arcs ", this.pp, " leg at ", dobj:dname(), ", who dodges nimbly."); 20if (random(100) > 50) 21targets = this.location:occupants($living); 22targets = setremove(targets, dobj); 23targets = setremove(targets, player); 24dobj = targets[random(length(targets))]; 25if (valid(dobj)) 26defense = #139:check(dobj, 0); 27if (defense < attack) 28where = dobj:random_bodypart(); 29msg = tostr(this:dnamec(), "'s wild kick lands squarely on ", dobj:dnamec(), "'s ", where.name, "."); 30if (where == #305) 31#47065:report({msg}); 32endif 33this:aat(msg); 34dmg = random(5) + 1; 35dobj:take_damage(#268, dmg, where, this); 36return; 37else 38where = dobj:random_bodypart(); 39this:aat(this:dnamec(), "'s foot sails inches past ", dobj:dnamec(), "'s ", where.name, "."); 40return; 41endif 42endif 43endif 44return; 45elseif (attack > defense) 46type = ""; 47if (attack > 4) 48type = " axe"; 49elseif (attack > 6) 50type = " roundhouse"; 51endif 52if (valid(bodypart)) 53where = bodypart; 54else 55where = dobj:random_bodypart(); 56endif 57msg = tostr(this:dnamec(), type, " kicks ", dobj:dname(), " in the ", where.name); 58if (where == #305) 59msg = msg + "!"; 60#47065:report({msg}); 61else 62msg = msg + "."; 63endif 64this:aat(msg); 65dmg = random(5) + 1; 66dobj:take_damage(#268, dmg, where, this); 67endif
kick
Referenced by
none
Source
1if (player != this) 2player:tell("That's a Bozo no-no."); 3return; 4endif 5{dobj, bodypart} = $mu:match_bodyref(dobjstr, this.location:occupants($living)); 6if (((dobj == #-2) || (dobj == #-3)) || (dobj == #-1)) 7player:tell("Kick who?"); 8return; 9endif 10this:queue_action($actions.verb, {this, "_kick", {player, dobj, bodypart}, 1, 0}, 0, "kick " + dobj.name);
heal
Referenced by
none
Source
1if (player != this) 2player:tell("That great that you want to heal people, but maybe you could do it WITHOUT CHEATING? Your kind disgust the admins and you will probably wind up dead, broke, and banned soon."); 3return; 4endif 5dobj = $mu:match(dobjstr, player.location:occupants($living)); 6if (!valid(dobj)) 7dobj = $su:match_player(dobjstr); 8if (!valid(dobj)) 9player:tell("Heal who?"); 10return; 11endif 12endif 13who = dobj; 14if (!valid(who)) 15player:tell("I don't know who '", dobjstr, "' is."); 16return; 17endif 18m = (who == player) ? this:heal_self_msg() | this:heal_msg(); 19who:aat($su:ps(m, this, who)); 20suspend(1); 21healing = who.health_max - who.health; 22m = #635:select("heal_ongoing", healing, $bodypart); 23who:tell($su:ps(m, who, who, $bodypart)); 24damage = #1051; 25who:take_damage(damage, -healing, $bodypart); 26"Heal everything that every medical device cures."; 27healables = {}; 28for device in (children(#835)) 29if (typeof(device.cures) == OBJ) 30healables = setadd(healables, device.cures); 31elseif (typeof(device.cures) == LIST) 32for healable in (device.cures) 33if (typeof(healable) != OBJ) 34player:tell($su:nn(device), " has a strange .cures. (", toliteral(healable), ")"); 35else 36healables = setadd(healables, healable); 37endif 38endfor 39else 40player:tell($su:nn(device), " has a strange .cures. (", toliteral(device.cures), ")"); 41endif 42endfor 43for healable in (healables) 44for crap in (who.blood) 45if (is_a(crap[1], healable)) 46who:remove_drug(crap[1], $maxint); 47endif 48endfor 49endfor 50if (is_a(who, $player)) 51`who:lose_thirst(who.thirst) ! ANY => 0'; 52if (who:is_freak()) 53`who:gain_stress(1000) ! ANY => 0'; 54else 55`who:lose_stress(1000) ! ANY => 0'; 56endif 57endif
paramedic pm
Referenced by
none
Source
1nh = {}; 2badq = {}; 3meatreaper = 0; 4uptime = $time_utils:dhms_with_letters(time() - $last_restart_time); 5this:tell($ansi.bold_on + "--------------------------[ up ", uptime, " ]-----------" + $ansi.reset); 6foundpq = {}; 7badpq = {}; 8pqtotal = {0, 0, 0, 0}; 9heart = {0, 0, 0, 0}; 10others = {0, 0, 0, 0}; 11heart_total = 0; 12total = 0; 13suspends = 0; 14suspendtasks = {}; 15now = time(); 16for x in (queued_tasks()) 17wait = x[2] - now; 18bucket = (wait < 0) ? 1 | ((wait == 0) ? 2 | ((wait <= 5) ? 3 | 4)); 19total = total + 1; 20if (x[7] == "process_queue") 21if (x[9] in foundpq) 22badpq = {@badpq, x[1]}; 23this:tell(" Killing extra process_queue found for ", $su:nn(x[9])); 24kill_task(x[1]); 25else 26pqtotal[bucket] = pqtotal[bucket] + 1; 27foundpq = setadd(foundpq, x[9]); 28endif 29elseif (x[6..7] in {{$cu, "read"}, {$cu, "read_lines"}, {$login, "request_character"}}) 30"Ignore read tasks entirely"; 31elseif (x[7] in {"beat", "_beat", "service_queue"}) 32heart[bucket] = heart[bucket] + 1; 33heart_total = heart_total + 1; 34elseif (x[7] == "_meat_reaper") 35if (meatreaper) 36this:tell(" Extra _meat_reaper found! ", x[1], " -- killing"); 37kill_task(x[1]); 38else 39meatreaper = x[1]; 40endif 41others[bucket] = others[bucket] + 1; 42elseif ((length(x[7]) >= 7) && (x[7][1..7] == "suspend")) 43suspends = suspends + 1; 44sustask = x[1]; 45susinfo = task_stack(sustask); 46if ((susinfo[$][2] == "_do") && is_a(susinfo[$][1], $scheduler)) 47susinfo = susinfo[1..$ - 1]; 48endif 49susstr = (((($su:nn(susinfo[$][1]) + ":") + susinfo[$][2]) + " (task ") + tostr(sustask)) + ")"; 50suspendtasks = {@suspendtasks, susstr}; 51others[bucket] = others[bucket] + 1; 52else 53others[bucket] = others[bucket] + 1; 54endif 55endfor 56b = pqtotal; 57pqtotal = tostr(b[1] ? $ansi.red | "", b[1], $ansi.reset, "/", b[2] ? $ansi.yellow | "", b[2], $ansi.reset, "/", b[3] ? $ansi.green | "", b[3], $ansi.reset, "/", $ansi.blue, $ansi.bold, b[4], $ansi.reset); 58b = heart; 59heart = tostr(b[1] ? $ansi.red | "", b[1], $ansi.reset, "/", b[2] ? $ansi.yellow | "", b[2], $ansi.reset, "/", b[3] ? $ansi.green | "", b[3], $ansi.reset, "/", $ansi.blue, $ansi.bold, b[4], $ansi.reset); 60b = others; 61others = tostr(b[1] ? $ansi.red | "", b[1], $ansi.reset, "/", b[2] ? $ansi.yellow | "", b[2], $ansi.reset, "/", b[3] ? $ansi.green | "", b[3], $ansi.reset, "/", $ansi.blue, $ansi.bold, b[4], $ansi.reset); 62if ((!meatreaper) && (!$stop_everything)) 63this:tell("WARNING: $rpg:_meat_reaper() is not running. Restarting."); 64$rpg:_meat_reaper(); 65endif 66wheeltask = task_valid($flywheel.process_queue); 67if ((!wheeltask) && (!$stop_everything)) 68this:tell("WARNING: $flywheel is not running. Restarting."); 69$flywheel.valid_ema = 0; 70$flywheel:queue_action($flywheel.action, {}); 71endif 72hearttask = task_valid($heart.beat_task); 73if ((!hearttask) && (!$stop_everything)) 74this:tell("WARNING: $heart is not beating."); 75$nets.heartnet:announce(this, "WARNING: $heart is not beating, no valid beat task.", 1); 76endif 77lag = floatstr($flywheel.ema, 3); 78heartqueues = $heart.highest_queue; 79heartpct = (tofloat(heart_total) / tofloat(heartqueues)) * 100.0; 80if (((heartpct > 10.0) && (heartpct < 34.0)) || ((heartpct > 166.0) && (heartpct <= 200.0))) 81heartpct = (($ansi.yellow + floatstr(heartpct, 1)) + "%") + $ansi.reset; 82elseif ((heartpct >= 34.0) && (heartpct <= 166.0)) 83heartpct = (($ansi.green + floatstr(heartpct, 1)) + "%") + $ansi.reset; 84else 85heartpct = (($ansi.red + floatstr(heartpct, 1)) + "%") + $ansi.reset; 86endif 87meatline = tostr("Meat reaper: ", meatreaper ? $ansi.green + "OK" | ($ansi.red + "ERR"), $ansi.reset); 88lagline = tostr("Lag: ", wheeltask ? $flywheel:lagstr() | (($ansi.red + "ERR") + $ansi.reset)); 89heartline = tostr("Heart: ", hearttask ? $ansi.green + heartpct | (($ansi.blue + $ansi.bold) + "DEAD"), $ansi.reset); 90this:tell(tostr(meatline, " ", lagline, " ", heartline)); 91this:tell("Heart: ", heart, " PQ: ", pqtotal, suspends ? tostr(" Suspended: ", $ansi.red, suspends, $ansi.reset) | "", " Other: ", others, " (Total: ", $ansi.bold_on, $ansi.cyan, total, $ansi.reset, ")"); 92if (suspendtasks) 93for x in (suspendtasks) 94this:tell(" ...", $ansi.red, $ansi.bold_on, x, $ansi.reset); 95endfor 96endif 97slice = tostr(time() - $heart.last_beat); 98womb = length($womb.contents); 99tomb = length($tomb.contents); 100lostnfound = length($lostnfound.contents); 101recycler = length($recycler.contents); 102recycler = (recycler >= 2000) ? tostr($ansi.red, $ansi.bold_on, recycler, $ansi.reset) | tostr(recycler); 103this:tell("Womb: ", womb, " Tomb: ", tomb, " Lostnfound: ", lostnfound, " Recycler: ", recycler); 104if ($recycler.use_backup) 105br = length($backup_recycler.contents); 106this:tell("Backup recycler: ", $ansi.cyan, $ansi.bold_on, "ON ", $ansi.reset, (br > 2000) ? $ansi.red | "", br, $ansi.reset, " (due to recycler overflow)"); 107endif 108sl = ""; 109for x in ($womb.accepts_history[$ - 9..$]) 110sl = (sl + $su:right(x, 3)) + " "; 111endfor 112sps = tofloat($lu:sum($womb.accepts_history[$ - 19..$])) / 600.0; 113sps = floatstr(sps, 2); 114sl = sl + tostr("... (", sps, "/s)"); 115this:tell("Spawn load: ", $ansi.yellow, $ansi.bold_on, sl, $ansi.reset); 116rl = ""; 117for x in ($recycler.rcount_history[$ - 9..$]) 118rl = (rl + $su:right(x, 3)) + " "; 119endfor 120rps = tofloat($lu:sum($recycler.rcount_history[$ - 19..$])) / 600.0; 121rps = floatstr(rps, 2); 122rl = rl + tostr("... (", rps, "/s)"); 123this:tell("Recycle load: ", $ansi.red, $ansi.bold_on, rl, $ansi.reset); 124if (random(1000) == 1) 125this:tell("Bong load: ", $ansi.green, "ub bu bu ub bu ub ub bu bu ub", $ansi.reset); 126endif 127gcount = tostr(length($recycler.contents)); 128tq = length(queue_info()); 129{propvals, strings, verbs, lists, objects, ?hashes = 0} = $lu:map_arg($su, "group_number", $memory:major_stats()); 130dbsize = $su:format_bytesize($rpg.last_db_size); 131if (dbdeltanum = $rpg.last_db_delta) 132dbdelta = $su:format_bytesize(dbdeltanum); 133if (dbdeltanum > 0) 134dbsize = ((dbsize + " (+") + dbdelta) + ")"; 135elseif (!dbdeltanum) 136dbsize = dbsize + " (+-0)"; 137else 138dbsize = ((dbsize + " (") + dbdelta) + ")"; 139endif 140endif 141this:tell("Max_object: ", tostr(max_object()), " DB: ", dbsize, " Task Queues: ", tq, " Hashes: ", hashes); 142this:tell(tostr("Propvals: ", propvals, " Strings: ", strings, " Verbs: ", verbs, " Lists: ", lists)); 143p = 0; 144a = 0; 145for x in (connected_players()) 146if (x.programmer) 147a = a + 1; 148else 149p = p + 1; 150endif 151endfor 152pa = ((tostr(p) + "p ") + tostr(a)) + "a"; 153this:tell(((((((($ansi.bold_on + "-----[ ") + slice) + " / ") + tostr($heart.beat_interval)) + " ]----------------------------------[ ") + pa) + " ]----------") + $ansi.reset);
@pardon
Referenced by
none
Source
1if (player != this) 2player:tell("My god. MY GOD MAN. Did you really think that would work? I hope your shame is enought to keep you company from now on."); 3return; 4endif 5who = $su:match_player(args[1]); 6if ((!valid(who)) && (!is_a(who = $su:literal_object(dobjstr), $creature))) 7player:tell("That is not a valid player name."); 8return; 9endif 10if (!$cu:yes_or_no(tostr($ansi.cyan, $ansi.bold_on, "This will pardon ", who:dnamec(), ". Are you sure?", $ansi.reset))) 11return; 12endif 13#2312:forgive(who); 14#13560:forgive(who); 15player:tell(($ansi.bold_on + "IT IS DONE.") + $ansi.reset); 16$nets.prognet:announce(player, tostr(player:real_name(), " just pardoned ", who:real_name(), "."), 1);
@chatban
Referenced by
none
Source
1"Copied from generic programmer (#58):@sentence by Satan (#2) Tue Nov 14 21:47:55 2006 PST"; 2"Copied from Necanthrope (#142):@banish by Satan (#2) Mon Nov 13 16:36:39 2006 PST"; 3who = $su:match_player(args[1]); 4length = tonum(iobjstr); 5if (((who == #-1) || (who == #-2)) || (who == #-3)) 6player:tell("That is not a valid player name."); 7return; 8endif 9if ((who.programmer == 1) || (who.wizard == 1)) 10player:tell("Nice try."); 11return; 12endif 13if (!$cu:yes_or_no((((($ansi.cyan + $ansi.bold_on) + "This will ban ") + who:dname()) + " from using chatnet or sending pages. Are you sure?") + $ansi.reset)) 14return; 15endif 16if (who.may_chat == 1) 17who.may_chat = 0; 18$nets.prognet:announce(player, ((player:dnamec() + " banned ") + who:dname()) + " from the communication network.", 1); 19else 20who.may_chat = 1; 21$nets.prognet:announce(player, ((player:dnamec() + " lifted the ban on ") + who:dname()) + " from the communication network.", 1); 22endif
debug_tell
Referenced by
none
Source
1if (this:check_pref("debug")) 2type = args[1]; 3tellargs = args[2..$]; 4if (this:check_pref("debug" + type)) 5if (!(markup = `$ansi.("debug_" + type) ! ANY => 0')) 6markup = ($ansi.bg_blue + $ansi.bold_on) + $ansi.cyan; 7endif 8this:tell(((((markup + "[DEBUG ") + $su:right(type, 7)) + "] ") + $su:from_list(tellargs)) + $ansi.reset); 9endif 10endif
@tap
Referenced by
none
Source
1if (is_a(dobj, #9348)) 2dobj.tap = setadd(dobj.tap, this); 3this:tell("Tapped the camera in ", dobj.location.name, "."); 4endif
@untap
Referenced by
none
Source
1if (is_a(dobj, #9348)) 2dobj.tap = setremove(dobj.tap, this); 3this:tell("Untapped the camera in ", dobj.location.name, "."); 4endif
heal_msg
Referenced by
- #50:heal line 18:
this:heal_msg
Source
1return this.heal_msg;
heal_self_msg
Referenced by
- #50:heal line 18:
this:heal_self_msg
Source
1return this.heal_self_msg;
@extract @kidnap
Referenced by
none
Source
1if (player != this) 2player:tell("I'm sorry, are you an admin? Oh that's right, you're NOT AN ADMIN. So why are you trying to act like one? Srsly, you're only going to get yourself in trouble."); 3return; 4endif 5who = $su:match_player(dobjstr); 6if (!valid(who)) 7player:tell("There is no player '", dobjstr, "'."); 8else 9player:tell("You begin extracting ", who.name, "."); 10who:tell("You feel a weird prickling on the back of your neck."); 11suspend(2); 12who:tell("You feel an awful burning spread throughout your body, as if you were being ripped into tiny pieces..."); 13who:aat(who:dnamec(), " looks puzzled for a moment and glances up at the sky. ", who.ppc, " hair starts to stand up on end and ", who.ps, " screams, then vanishes."); 14who:moveto(player.location); 15who:aat(who:dnamec(), " appears with a sudden POP."); 16endif
@current-daily-gain @cdg
Referenced by
none
Source
1if (!this.programmer) 2player:tell("Go to hell."); 3return; 4endif 5lines = {}; 6for skill in ($ou:leaves_suspended($skill)) 7if (!skill.daily_gain_who) 8continue; 9endif 10lines = listappend(lines, $su:left($su:nn(skill) + " ", -60, "-")); 11for i in [1..length(skill.daily_gain_who)] 12who = skill.daily_gain_who[i]; 13data = skill.daily_gain_data[i]; 14lines = listappend(lines, ((" " + $su:left($su:nn(who), 20)) + " +") + tostr(data[1])); 15for action in (data[2]) 16if (!action[2]) 17lines = listappend(lines, " " + $su:nn(action[1])); 18else 19lines = listappend(lines, ((" " + $su:nn(action[1])) + " => ") + tostr(action[2])); 20endif 21$cu:sin(0); 22endfor 23$cu:sin(0); 24endfor 25lines = listappend(lines, ""); 26$cu:sin(0); 27endfor 28player:tell_lines(lines);
@messages_old any none none
Referenced by
none
Source
1"Copied from generic player (#6):@messages by Satan (#2) Fri Sep 7 03:15:45 2007 CDT"; 2set_task_perms(player); 3if (dobjstr == "") 4player:notify(tostr("Usage: ", verb, " <object>")); 5return; 6endif 7dobj = player:my_match_object(dobjstr); 8if ($command_utils:object_match_failed(dobj, dobjstr)) 9return; 10endif 11found_one = 0; 12if ((!is_a(player, $builder)) && (dobj.owner != player)) 13player:notify("Try something you own instead."); 14return; 15endif 16props = $object_utils:all_properties(dobj); 17if (typeof(props) == ERR) 18player:notify("You can't read the messages on that."); 19return; 20endif 21for pname in (props) 22len = length(pname); 23if ((len > 4) && (pname[len - 3..len] == "_msg")) 24found_one = 1; 25msg = `dobj.(pname) ! ANY'; 26if (msg == E_PERM) 27value = "isn't readable by you."; 28elseif (!msg) 29value = "isn't set."; 30elseif (typeof(msg) == LIST) 31value = "is a list."; 32elseif (typeof(msg) != STR) 33value = "is corrupted! **"; 34else 35value = "is " + $string_utils:print(msg); 36endif 37player:notify(tostr("@", pname[1..len - 4], " ", dobjstr, " ", value)); 38endif 39endfor 40if (!found_one) 41player:notify("That object doesn't have any messages to set."); 42endif
@rhistory
Referenced by
none
Source
1if (!args) 2player:tell("Usage: @rhistory <objnum>"); 3return; 4endif 5if (tostr(target = toobj(argstr)) != argstr) 6player:tell("'", argstr, "' is not a valid objnum."); 7return; 8endif 9rows = {{"Object", "", "Location", "How", "Who"}}; 10widths = {8, -21, -18, 25, 20}; 11colors = {$ansi.blue + $ansi.bold_on, "", $ansi.yellow, $ansi.white + $ansi.bold_off, $ansi.bold_on}; 12hit = 0; 13for r in ($recycler.rhistory) 14if (r[1] != target) 15continue; 16endif 17how = tostr(r[3][4], ":", r[3][2], " (", r[3][6], ")"); 18rows = {@rows, {tostr(r[1]), r[4], $su:nn(r[2]), how, (r[5] == #2) ? "" | $su:nn(r[5])}}; 19hit = 1; 20yield; 21endfor 22if (!hit) 23player:tell("No matches for '", argstr, "'."); 24return; 25endif 26first = 1; 27for r in (rows) 28line = first ? $ansi.debugbold | ""; 29for i in [1..length(widths)] 30line = ((line + (first ? "" | colors[i])) + $su:left(r[i], widths[i])) + " "; 31endfor 32player:tell(line, $ansi.reset); 33first = 0; 34$cu:sin(0); 35endfor
@receive-dump
Referenced by
none
Source
1set_task_perms(player); 2parent = toobj($cu:read()); 3#97:tell($su:print(parent)); 4if (!valid(parent)) 5player:tell("**** invalid parent, disconnecting"); 6boot_player(player); 7return; 8endif 9newobj = player:_create(parent); 10newobj:moveto(player); 11newobjstr = tostr(newobj); 12player:tell("***newobject: " + newobjstr); 13foreignobj = $cu:read(); 14#97:tell($su:print(foreignobj)); 15"now read the remaining lines, which should be a dump"; 16commands = {}; 17while ((line = $cu:read()) != "\"***finished***") 18#97:tell($su:print(line)); 19line = strsub(line, foreignobj, newobjstr); 20commands = {@commands, line}; 21endwhile 22for line in (commands) 23force_input(player, line); 24endfor 25player:tell("****finished****");
@port
Referenced by
none
Source
1target = dobj; 2host = "localhost"; 3port = 7777; 4if (!valid(dobj)) 5player:tell("Couldn't match " + dobjstr); 6return; 7endif 8if (!$cu:yes_or_no(("You want to send " + $su:nn(target)) + ", is that correct?")) 9player:tell("Aborted."); 10return; 11endif 12names = $su:from_list({target.name, @target.aliases}, ","); 13user = $cu:read("Enter your programmer character's name"); 14pass = $cu:read("Enter your programmer character's password"); 15player:tell("Connecting..."); 16connection = open_network_connection(host, port); 17if (`idle_seconds(connection) + 1 ! ANY => 0') 18set_connection_option(connection, "hold-input", 1); 19player:tell("Logging in..."); 20notify(connection, (("connect " + user) + " ") + pass); 21player:tell("Sending..."); 22notify(connection, "@receive-dump"); 23notify(connection, tostr(parent(target))); 24notify(connection, tostr(target)); 25lines = $code_utils:dump_properties(target, 1); 26lines = {@lines, @$code_utils:dump_verbs(target, 1)}; 27lines = {@lines, (("@rename " + tostr(target)) + " to ") + names}; 28lines = {@lines, "\"***finished***"}; 29for line in (lines) 30$cu:sin(0); 31notify(connection, line); 32endfor 33x = 0; 34while ((line = read(connection)) != "****finished****") 35x = x + 1; 36endwhile 37boot_player(connection); 38player:tell("Sent."); 39else 40player:tell("Connection failed."); 41endif
@bored*!
Referenced by
none
Source
1folder = #18356; 2if (verb == "@bored!") 3pms_args = {"random", "status:open"}; 4player:tell($ansi.yellow, "[ @peek random status:open on *ideas ... ]", $ansi.reset); 5else 6"you're only plain old no-exclamation-mark bored?!"; 7pms_args = {"random", "status:open", "minscore:2"}; 8player:tell($ansi.yellow, "[ @peek random status:open minscore:2 on *ideas ... ]", $ansi.reset); 9endif 10pms = folder:parse_message_seq(pms_args, {0}); 11folder:display_seq_full(pms[1], tostr("Randomly selected message from *", folder.name, ":"));
@assume-form
Referenced by
none
Source
1name = dobjstr; 2name = $su:trim(name); 3if (length(name) == 0) 4player:tell("It's not nice to have a blank name."); 5#119:announce(#2, tostr($su:nn(player), " attempted to assume a blank form."), 1); 6return; 7endif 8target = $su:match_player(name); 9if (valid(target) && (name != "Crowbar")) 10player:tell("It's not nice to pretend to be a player! Aborting."); 11#119:announce(#2, tostr($su:nn(player), " attempted to assume the form of ", name), 1); 12return; 13endif 14player:tell($ansi.cyan, "[ You are assuming the form of \"", name, "\". Enter a description below. ]", $ansi.reset); 15desc = $cu:read_lines(); 16if (!desc) 17player:tell("Aborting."); 18return; 19endif 20player:revert_code_name(); 21player:set_code_name(name, desc); 22player:aat(player.name, " assumes the form of ", name, "."); 23player:tell($ansi.cyan, "[ Use '@revert-form' to go back to regular old you. ]", $ansi.reset); 24#119:announce(#2, tostr($su:nn(player), " is assuming the form of ", name), 1);
@revert-form @reveal-form
Referenced by
none
Source
1if (!player.obscured) 2player:tell("You're already you!"); 3return; 4endif 5if (!this:area().admin_ok) 6player:tell("This is the real world! Are you sure you want to reveal yourself?"); 7if (!$cu:yes_or_no()) 8player:tell("You can't reveal yourself here."); 9return; 10endif 11endif 12name = player:revert_code_name(); 13player:aat($su:ps($su:subst(player.revert_form_msg, {{"%name%", name}}), player, player, player)); 14player.health_max = 100; 15player.health = 100;
examine_names
Referenced by
none
Source
1"Copied from root (#1):examine_names by Satan (#2) Fri Aug 15 22:14:21 2008 CDT"; 2"examine_names(examiner)"; 3"Return a list of strings to be told to the player, indicating the name and aliases (and, by default, the object number) of this."; 4if (this.obscured) 5return {tostr($ansi.bold_on, this.code_name, $ansi.reset)}; 6endif 7a = setremove(this.aliases, this.name); 8s = ($ansi.bold_on + this.name) + $ansi.reset; 9if (a) 10s = ((s + " (aka ") + $su:english_list(a)) + ")"; 11endif 12return {s};
@got
Referenced by
none
Source
1if ((!valid(dobj)) || (!is_player(dobj))) 2dobj = $su:match_player(dobjstr); 3endif 4if (!valid(dobj)) 5player:tell("I don't know who '", dobjstr, "' is."); 6return; 7endif 8#7450:announce(player, tostr(player.name, ":", $ansi.bold_on, " @got ", dobj.name, "."), 1);
!*
Referenced by
none
Source
1if (verb == "!") 2for x in (this.eval_subs) 3a = x[1]; 4v = x[2]; 5if ((o = toobj(v)) && (typeof(o) == OBJ)) 6v = $su:nn(o); 7endif 8player:tell($ansi.bold_on, $su:left(a, 15), $ansi.bold_off, " = ", $ansi.bold_on, $ansi.yellow, v, $ansi.reset); 9endfor 10if (!this.eval_subs) 11player:tell("You have no eval subs. Try this to set one: !alias value"); 12endif 13else 14alias = verb[2..$]; 15value = argstr; 16fi = 0; 17for x in [1..length(this.eval_subs)] 18if (this.eval_subs[x][1] == alias) 19fi = x; 20endif 21endfor 22if ((!value) && (!fi)) 23player:tell("You don't have an eval sub for '", alias, "'."); 24elseif (!value) 25oval = this.eval_subs[fi][2]; 26player:tell("Clearing alias '", alias, "' (was '", oval, "')."); 27this.eval_subs = listdelete(this.eval_subs, fi); 28elseif (value && fi) 29oval = this.eval_subs[fi][2]; 30player:tell("Changing alias '", alias, "' from '", oval, "' to '", value, "'."); 31else 32this.eval_subs = {@this.eval_subs, {alias, value}}; 33player:tell("Added alias '", alias, "' for '", value, "'."); 34endif 35endif
_@prog
Referenced by
none
Source
1"Copied from generic programmer (#58):@prog by Satan (#2) Thu Aug 21 23:08:13 2008 CDT"; 2"This version of @program deals with multiple verbs having the same name."; 3"... @program <object>:<verbname> <dobj> <prep> <iobj> picks the right one."; 4if (player != caller) 5return {}; 6endif 7set_task_perms(player); 8"..."; 9"...catch usage errors first..."; 10"..."; 11punt = "...set punt to 0 only if everything works out..."; 12if (!(args && (spec = $code_utils:parse_verbref(args[1])))) 13player:notify(tostr("Usage: ", verb, " <object>:<verb> [<dobj> <prep> <iobj>]")); 14elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 15"...bogus object..."; 16elseif (typeof(argspec = $code_utils:parse_argspec(@listdelete(args, 1))) != LIST) 17player:notify(tostr(argspec)); 18elseif (verb == "@program#") 19verbname = $code_utils:toint(spec[2]); 20if (verbname == E_TYPE) 21player:notify("Verb number expected."); 22elseif (length(args) > 1) 23player:notify("Don't give args for @program#."); 24elseif ((verbname < 1) || `verbname > length(verbs(object)) ! E_PERM') 25player:notify("Verb number out of range."); 26else 27argspec = 0; 28punt = 0; 29endif 30elseif (argspec[2]) 31player:notify($string_utils:from_list(argspec[2], " ") + "??"); 32elseif (length(argspec = argspec[1]) in {1, 2}) 33player:notify({"Missing preposition", "Missing iobj specification"}[length(argspec)]); 34else 35punt = 0; 36verbname = spec[2]; 37if (index(verbname, "*") > 1) 38verbname = strsub(verbname, "*", ""); 39endif 40endif 41"..."; 42"...if we have an argspec, we'll need to reset verbname..."; 43"..."; 44if (punt) 45elseif (argspec) 46if (!(argspec[2] in {"none", "any"})) 47argspec[2] = $code_utils:full_prep(argspec[2]); 48endif 49loc = $code_utils:find_verb_named(object, verbname); 50while ((loc > 0) && (`verb_args(object, loc) ! ANY' != argspec)) 51loc = $code_utils:find_verb_named(object, verbname, loc + 1); 52endwhile 53if (!loc) 54punt = "...can't find it...."; 55player:notify("That object has no verb matching that name + args."); 56else 57verbname = loc; 58endif 59else 60loc = 0; 61endif 62"..."; 63"...get verb info..."; 64"..."; 65if (punt || (!(punt = "...reset punt to TRUE..."))) 66else 67try 68info = verb_info(object, verbname); 69punt = 0; 70aliases = info[3]; 71if (!loc) 72loc = aliases in (verbs(object) || {}); 73endif 74except (E_VERBNF) 75player:notify("That object does not have that verb definition."); 76except error (ANY) 77player:notify(error[2]); 78endtry 79endif 80"..."; 81"...read the code..."; 82"..."; 83if (punt) 84player:notify(tostr("Now ignoring code for ", args ? args[1] | "nothing in particular", ".")); 85$command_utils:read_lines(); 86player:notify("Verb code ignored."); 87else 88player:notify(tostr("Now programming ", object.name, ":", aliases, "(", (!loc) ? "??" | loc, ").")); 89lines = $command_utils:read_lines_escape((active = player in $verb_editor.active) ? {} | {"@edit"}, {tostr("You are editing ", $string_utils:nn(object), ":", verbname, "."), @active ? {} | {"Type `@edit' to take this into the verb editor."}}); 90if (lines[1] == "@edit") 91player:tell(toliteral(lines)); 92$verb_editor:invoke(args[1], "@program", lines[2]); 93return {}; 94endif 95try 96if (result = set_verb_code(object, verbname, lines[2])) 97player:notify_lines(result); 98player:notify(tostr(length(result), " error(s).")); 99player:notify("Verb not programmed."); 100else 101player:notify("0 errors."); 102player:notify("Verb programmed."); 103return {object, verbname}; 104endif 105except error (ANY) 106player:notify(error[2]); 107player:notify("Verb not programmed."); 108endtry 109endif 110return {};
@desc*ribe
Referenced by
none
Source
1"Copied from generic player (#6):@desc by Satan (#2) Sat Aug 23 14:51:37 2008 CDT"; 2dobj = player:my_match_object(dobjstr); 3if ($command_utils:object_match_failed(dobj, dobjstr)) 4"...lose..."; 5return E_NONE; 6endif 7if (dobj.description) 8set_task_perms(player); 9else 10set_task_perms($archwiz); 11endif 12if (e = dobj:set_description(iobjstr)) 13player:notify("Description set."); 14else 15player:notify(tostr(e)); 16endif
@quit @forcequit @forcejoyquit
Referenced by
none
Source
1if (gamevalid(mcp_session = $mcp:session_for(player)) && mcp_session:handles_package($mcp.packages.client)) 2$mcp.packages.client:send_disconnect(mcp_session); 3endif 4boot_player(caller);
@add-feature @addfeature
Referenced by
none
Source
1"Copied from generic builder (#4):@addfeature by Satan (#2) Sat Aug 30 22:30:10 2008 CDT"; 2"Copied from generic player (#6):@add-feature by Satan (#2) Sat Mar 6 01:28:58 2004 PST"; 3"Usage:"; 4" @add-feature"; 5" @add-feature <feature object>"; 6"Modified 10 Oct 94, by Michele, to check the warehouse and match."; 7"Lists all features or adds an object to your features list."; 8set_task_perms(player); 9if (dobjstr) 10if (dobj == $failed_match) 11dobj = $feature.warehouse:match_object(dobjstr); 12endif 13if (!$command_utils:object_match_failed(dobj, dobjstr)) 14if (dobj in player.features) 15player:tell(dobjstr, " is already one of your features."); 16elseif (player:add_feature(dobj)) 17player:tell(dobj, " (", dobj.name, ") added as a feature."); 18else 19player:tell("You can't seem to add ", dobj, " (", dobj.name, ") to your features list."); 20endif 21endif 22else 23player:tell("Usage: @add-feature <object>"); 24if (length($feature.warehouse.contents) < 20) 25player:tell("Available features include:"); 26player:tell("--------------------------"); 27fe = {}; 28for c in ($feature.warehouse.contents) 29fe = {(c in player.features) ? c:title() + " (*)" | c:title()}; 30player:tell(" " + $string_utils:english_list(fe)); 31endfor 32player:tell("--------------------------"); 33player:tell("A * after the feature name means that you already have that feature."); 34endif 35endif
@remove-feature @rmfeature
Referenced by
none
Source
1"Copied from generic builder (#4):@rmfeature by Satan (#2) Sat Aug 30 22:30:20 2008 CDT"; 2"Copied from generic player (#6):@remove-feature by Satan (#2) Sat Mar 6 01:29:06 2004 PST"; 3"Usage: @remove-feature <feature object>"; 4"Remove an object from your .features list."; 5set_task_perms(player); 6if (dobjstr) 7features = player.features; 8if (!valid(dobj)) 9dobj = $string_utils:match(dobjstr, features, "name", features, "aliases"); 10endif 11if (!$command_utils:object_match_failed(dobj, dobjstr)) 12if (dobj in features) 13player:remove_feature(dobj); 14player:tell(dobj, " (", dobj.name, ") removed from your features list."); 15else 16player:tell(dobjstr, " is not one of your features."); 17endif 18endif 19else 20player:tell("Usage: @remove-feature <object>"); 21endif
@find
Referenced by
none
Source
1"'@find #<object>', '@find <player>', '@find :<verb>' '@find .<property>' - Attempt to locate things. Verbs and properties are found on any object in the player's vicinity, and some other places. '@find ?<help>' looks for a help topic on any available help database."; 2if (!dobjstr) 3player:tell("Usage: '@find #<object>' or '@find <player>' or '@find :<verb>' or '@find .<property>' or '@find ?<help topic>'."); 4return; 5endif 6if (dobjstr[1] == ":") 7name = dobjstr[2..$]; 8this:find_verb(name); 9return; 10elseif (dobjstr[1] == ".") 11name = dobjstr[2..$]; 12this:find_property(name); 13return; 14elseif (dobjstr[1] == "#") 15target = toobj(dobjstr); 16if (!valid(target)) 17player:tell(target, " does not exist."); 18endif 19elseif (dobjstr[1] == "?") 20name = dobjstr[2..$]; 21this:find_help(name); 22return; 23else 24target = $string_utils:match_player(dobjstr); 25$command_utils:player_match_result(target, dobjstr); 26endif 27if (valid(target)) 28player:tell(target.name, " (", target, ") is at ", valid(target.location) ? target.location.name | "Nowhere", " (", target.location, ")."); 29endif
find_property
Referenced by
- #50:@find line 12:
this:find_property
Source
1"'find_property (<name>)' - Search for a property with the given name. The objects searched are those returned by this:find_properties_on(). The printing order relies on $list_utils:remove_duplicates to leave the *first* copy of each duplicated element in a list; for example, {1, 2, 1} -> {1, 2}, not to {2, 1}."; 2name = args[1]; 3results = {}; 4momln = ""; 5thinglength = 10; 6momlength = 10; 7objects = $list_utils:remove_duplicates(this:find_properties_on()); 8for thing in (objects) 9if (valid(thing) && (mom = $ou:has_property(thing, name))) 10mom = this:property_inherited_from(thing, name); 11if (thing != mom) 12momln = valid(mom) ? mom | "built-in"; 13endif 14momln = (typeof(momln) == OBJ) ? $su:nn(mom) | tostr(momln); 15thingstr = $su:nn(thing); 16thinglength = max(thinglength, length(thingstr) + 2); 17momlength = max(momlength, length(momln) + 2); 18results = {@results, {thingstr, momln}}; 19endif 20$cu:sin(); 21endfor 22if (results) 23this:tell($ansi.white, $ansi.bold_on, "Results for property .", name, $ansi.reset); 24hcols = $ansi.bold_on + $ansi.white; 25hdrs = {"Object", "From"}; 26rcols = {$ansi.yellow, $ansi.white + $ansi.bold_on}; 27rows = $lu:sort_alist(results); 28restbl = $su:make_table(hcols, hdrs, rcols, rows, {thinglength, momlength}); 29for ln in (restbl) 30this:tell(ln); 31$cu:sin(); 32endfor 33else 34this:tell("The property .", name, " is nowhere to be found."); 35endif
find_verb
Referenced by
- #50:@find line 8:
this:find_verb
Source
1"'find_verb (<name>)' - Search for a verb with the given name. The objects searched are those returned by this:find_verbs_on(). The printing order relies on $list_utils:remove_duplicates to leave the *first* copy of each duplicated element in a list; for example, {1, 2, 1} -> {1, 2}, not to {2, 1}."; 2name = args[1]; 3results = {}; 4momln = ""; 5thinglength = 10; 6momlength = 10; 7objects = $list_utils:remove_duplicates(this:find_verbs_on()); 8for thing in (objects) 9if (valid(thing) && (mom = $ou:has_verb(thing, name))) 10mom = mom[1]; 11if (thing != mom) 12momln = valid(mom) ? mom | "built-in"; 13endif 14momln = (typeof(momln) == OBJ) ? $su:nn(mom) | tostr(momln); 15thingstr = $su:nn(thing); 16thinglength = max(thinglength, length(thingstr) + 2); 17momlength = max(momlength, length(momln) + 2); 18results = {@results, {thingstr, momln}}; 19endif 20$cu:sin(); 21endfor 22if (results) 23this:tell($ansi.white, $ansi.bold_on, "Results for verb :", name, $ansi.reset); 24hcols = $ansi.bold_on + $ansi.white; 25hdrs = {"Object", "From"}; 26rcols = {$ansi.yellow, $ansi.white + $ansi.bold_on}; 27rows = $lu:sort_alist(results); 28restbl = $su:make_table(hcols, hdrs, rcols, rows, {thinglength, momlength}); 29for ln in (restbl) 30this:tell(ln); 31$cu:sin(); 32endfor 33else 34this:tell("The verb :", name, " is nowhere to be found."); 35endif
find_verbs_on
Referenced by
- #50:find_verb line 7:
this:find_verbs_on
Source
1"'find_verbs_on ()' -> list of objects - Return the objects that @find searches when looking for a verb. The objects are searched (and the results printed) in the order returned. Feature objects are included in the search. Duplicate entries are removed by the caller."; 2return {this, this.location, @valid(this.location) ? this.location:contents() | {}, @this:contents(), @this.features};
find_properties_on
Referenced by
- #50:find_property line 7:
this:find_properties_on
Source
1"'find_properties_on ()' -> list of objects - Return the objects that @find searches when looking for a property. The objects are searched (and the results printed) in the order returned. Feature objects are *not* included in the search. Duplicate entries are removed by the caller."; 2return {this, this.location, @valid(this.location) ? this.location:contents() | {}, @this:contents()};
find_help
Referenced by
- #50:@find line 21:
this:find_help
Source
1"'find_help (<name>[, databases])'"; 2"Search for a help topic with the given name. [<databases>] defaults to the ones returned by $code_utils:help_db_list()."; 3{name, ?databases = $code_utils:help_db_list()} = args; 4if (!name) 5this:tell("What topic do you want to search for?"); 6elseif (result = $code_utils:help_db_search(name, databases)) 7{object, realname} = result; 8if (object == $ambiguous_match) 9this:tell("The help topic \"", name, "\" could refer to any of the following: ", $string_utils:english_list(realname)); 10elseif (((object == $help) && (!$object_utils:has_property(object, realname))) && valid(o = $string_utils:match_object(name, player.location))) 11if ($object_utils:has_callable_verb(o, "help_msg")) 12this:tell("That help topic was returned by ", $string_utils:nn(o), ":help_msg()."); 13elseif ($object_utils:has_property(o, "help_msg")) 14this:tell("That help topic is located in ", $string_utils:nn(o), ".help_msg."); 15else 16this:tell("That help topic was matched by $help but there doesn't seem to be any help available for it."); 17endif 18elseif (object == $verb_help) 19if (((what = $code_utils:parse_verbref(realname)) && valid(what[1] = $string_utils:match_object(what[1], player.location))) && $object_utils:has_verb(@what)) 20this:tell("That help topic is located at the beginning of the verb ", $string_utils:nn(what[1]), ":", what[2], "."); 21else 22this:tell("That help topic was matched by $verb_help but there doesn't seem to be any help available for it."); 23endif 24else 25where = {}; 26for x in (databases) 27if ({realname} == x:find_topics(realname)) 28where = setadd(where, x); 29endif 30endfor 31asname = (name == realname) ? "" | ((" as \"" + realname) + "\""); 32if (where) 33this:tell("That help topic is located on ", $string_utils:nn(where), asname, "."); 34else 35"...this shouldn't happen unless $code_utils:help_db_search finds a match we weren't expecting"; 36this:tell("That help topic appears to be located on ", $string_utils:nn(object), asname, ", although this command could not find it."); 37endif 38endif 39else 40this:tell("The help topic \"", name, "\" could not be found."); 41endif
property_inherited_from
Referenced by
- #50:find_property line 10:
this:property_inherited_from
Source
1"'property_inherited_from (<object>, <property name>)' -> object - Return the ancestor of <object> on which <object>.<property> is originally defined. If <object>.<property> is not actually defined, return 0. The property is taken as originally defined on the earliest ancestor of <object> which has it. If the property is built-in, return $nothing."; 2{what, prop} = args; 3if (!$object_utils:has_property(what, prop)) 4return 0; 5elseif (prop in $code_utils.builtin_props) 6return $nothing; 7endif 8ancestor = what; 9while ($object_utils:has_property(parent(ancestor), prop)) 10ancestor = parent(ancestor); 11endwhile 12return ancestor;
@rp-award
Referenced by
none
Source
1if (player != this) 2player:tell("Hey, um, what the fuck are you trying to do jerkoff? You haven't got the stones to pull something like this off, so stop trying."); 3return; 4endif 5amount = tonum(args[1]); 6who = $su:match_player(args[3]); 7if (amount < 1) 8player:tell("You must specify a valid amount of XP to award."); 9return; 10endif 11if (!valid(who)) 12player:tell("Award XP to who?"); 13return; 14endif 15player:tell($ansi.cyan, "Please give a single line of text describing why you are giving this award. Please limit it to RP reasons.", $ansi.reset); 16reason = $cu:read(); 17who:award_xp(amount); 18who:tell($ansi.bold_on, "[ For roleplaying. ]", $ansi.bold_off); 19$mail_agent:send_message(player, #63691, ((("Award for " + who:dnamec()) + " of ") + tostr(amount)) + " XP", reason);
@donation
Referenced by
none
Source
1if (!valid(dobj)) 2dobj = $su:match_player(dobjstr); 3endif 4if (!valid(dobj)) 5player:tell(("Couldn't find anyone matching \"" + dobjstr) + "\"."); 6return; 7elseif (!is_a(dobj, $player)) 8player:tell(("\"" + dobjstr) + "\" isn't a player."); 9return; 10elseif (!dobj.donation) 11player:tell(((dobj.name + " has not donated any money to ") + $network.MOO_name) + "."); 12return; 13else 14player:tell(((((dobj.name + " has donated $") + tostr(dobj.donation)) + " to ") + $network.MOO_name) + "."); 15endif
@changelog @cl
Referenced by
none
Source
1"Get a list of changed verbs for a specific object or verb."; 2if (!dobjstr) 3return $changelog:_changelog_all(100); 4endif 5what = dobj; 6if (!valid(dobj)) 7if (dobjstr == "critical") 8return $changelog:_changelog_critical(); 9endif 10"try to match dobjstr, which may be an object, but may not be"; 11what = $su:literal_object(dobjstr); 12if (valid(what)) 13$changelog:_changelog_object(what); 14else 15verbspec = $code_utils:parse_verbref(dobjstr); 16if (verbspec) 17{objstr, verbstr} = verbspec; 18return $changelog:_changelog_verb(objstr, verbstr); 19else 20player:tell("I don't know what '", dobjstr, "' is supposed to be."); 21return; 22endif 23endif 24else 25return $changelog:_changelog_object(what); 26endif
@pathto
Referenced by
none
Source
1dest = dobj; 2dest = dest:room(); 3start = player:room(); 4here = start; 5path = {here}; 6while (here != dest) 7exit = here:next_hop_to(dest); 8if (!valid(exit)) 9player:tell(" #-1 FAILED at ", $su:nn(here), "!"); 10return; 11endif 12player:tell(" ", $su:nn(exit), " to ", $su:nn(exit.otherside.location)); 13here = exit.otherside.location; 14if (here in path) 15player:tell(" FAILED! that's a loop."); 16return; 17endif 18path = {@path, here}; 19endwhile
@writeprop
Referenced by
none
Source
1if (player != caller) 2return {}; 3endif 4if ((!args) || (!(spec = $code_utils:parse_propref(args[1])))) 5player:notify(tostr("Usage: ", verb, " <object>.<verb>")); 6return; 7elseif ($cu:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 8return; 9endif 10try 11propinfo = property_info(object, spec[2]); 12except e (E_PROPNF) 13player:notify(tostr($su:nn(object), " does not define a property named .", spec[2], ".")); 14return; 15endtry 16if (typeof(val = object.(spec[2])) != LIST) 17player:notify(tostr($su:nn(object), ".", spec[2], " is not a list.")); 18return; 19endif 20if (val && (typeof(val[1]) != STR)) 21player:notify(tostr($su:nn(object), ".", spec[2], " is not a list of strings.")); 22return; 23endif 24if ((((propinfo[1] != player) && (!player.wizard)) && (!index(propinfo[2], "w"))) && (!((player in $note_editor.wiz_editors) && $note_editor:can_all_edit(object, spec[2])))) 25player:notify(tostr("You don't have permission to edit ", $su:nn(object), ".", spec[2], ".")); 26return; 27endif 28player:notify(tostr("Now writing list for ", object.name, ".", spec[2], ".")); 29lines = $command_utils:read_lines(); 30try 31object.(spec[2]) = lines; 32except e (ANY) 33player:notify(tostr("Property not written: ", e[2])); 34return; 35endtry 36player:notify(tostr(object, ".", spec[2], " successfully written.")); 37$nets.changenet:announce(player, tostr(player.name, " wrote ", $su:nn(object), ".", spec[2], "."), 1);
@canedit
Referenced by
none
Source
1allprops = $note_editor.authorized_props_any_object; 2objprops = $note_editor.authorized_props; 3objs = $note_editor.authorized_objects; 4if (!argstr) 5"tell all"; 6if (allprops) 7player:tell($ansi.debugbold, " These properties found anywhere are editable: ", $ansi.reset); 8allprops = $lu:map_arg(2, $lu, "tolist", " .", allprops); 9allprops = $lu:map_arg($su, "from_list", allprops); 10player:tell_lines($su:columnize(allprops, 3)); 11endif 12$cu:sin(); 13if (objprops) 14player:tell($ansi.debugbold, " These specific properties are editable: ", $ansi.reset); 15fullobjprops = {}; 16for op in (objprops) 17{propname, objlist} = op; 18for o in (objlist) 19fullobjprops = {@fullobjprops, ($code_utils:corify_object(o) + ".") + propname}; 20endfor 21$cu:sin(); 22endfor 23player:tell_lines($su:columnize(fullobjprops, 2)); 24endif 25if (objs) 26player:tell($ansi.debugbold, " All properties on these objects are editable: ", $ansi.reset); 27player:tell_lines($su:columnize($lu:map_arg($su, "nn", objs), 2)); 28endif 29return; 30elseif (valid(object = $su:literal_object(dobjstr))) 31if (object in objs) 32player:tell($ansi.yellow, $su:nn(object), " is fully editable.", $ansi.reset); 33return; 34else 35props = {}; 36for op in (objprops) 37{propname, objlist} = op; 38for o in (objlist) 39if (is_a(object, o)) 40props = {@props, {propname, o}}; 41continue op; 42endif 43endfor 44$cu:sin(); 45endfor 46if (!props) 47player:tell($ansi.yellow, $su:nn(object), " is not specifically editable.", $ansi.reset); 48return; 49else 50player:tell($ansi.yellow, $su:nn(object), " has specific properties editable: ", $ansi.reset); 51endif 52for po in (props) 53{propname, origin} = po; 54player:tell($ansi.yellow, " .", propname, " from ", $su:nn(origin), $ansi.reset); 55$cu:sin(); 56endfor 57return; 58endif 59elseif (spec = $code_utils:parse_propref(args[1])) 60object = player:my_match_object(spec[1]); 61pname = spec[2]; 62if ($command_utils:object_match_failed(object, spec[1])) 63return; 64endif 65if (pname in $code_utils.builtin_props) 66player:tell($ansi.yellow, ".", pname, " is a built-in property.", $ansi.reset); 67return; 68endif 69if (!`property_info(object, pname) ! E_PROPNF') 70player:tell($ansi.yellow, dobjstr, " does not exist.", $ansi.reset); 71return; 72endif 73if ($note_editor:can_all_edit(object, pname)) 74player:tell($ansi.yellow, $su:nn(object), ".", pname, " is editable.", $ansi.reset); 75else 76player:tell($ansi.yellow, $su:nn(object), ".", pname, " is not editable.", $ansi.reset); 77if (player.wizard) 78definer = $ou:property_definer(object, pname); 79player:tell($ansi.yellow, "The property is defined on ", $su:nn(definer), ".", $ansi.reset); 80if ($cu:yes_or_no("Enable editing?")) 81idx = $lu:iassoc(pname, objprops); 82if (idx) 83objprops[idx][2] = {@objprops[idx][2], definer}; 84else 85objprops = {@objprops, {pname, {definer}}}; 86endif 87$note_editor.authorized_props = objprops; 88player:tell($ansi.yellow, "Added edit authorization for ", definer, ".", pname, ".", $ansi.reset); 89else 90player:tell($ansi.yellow, "No authorization added.", $ansi.reset); 91endif 92endif 93endif 94else 95player:tell("Usage: ", verb, " [<object> | <object>.<property>]. Tells you if it's editable."); 96endif
@type @status @assign @combine @retitle @annotate
Referenced by
none
Source
1if (player != this) 2raise(E_PERM); 3endif 4if (p = this:parse_mailread_cmd(verb, args, "", "on", 1)) 5{folder, msgseq, curr, args} = p; 6if (has_callable_verb(folder, "_" + verb)) 7if (this.wizard || folder:is_readable_by(this)) 8folder:("_" + verb)(msgseq, args); 9else 10player:tell("Permission denied."); 11endif 12else 13player:tell("You can't use ", verb, " on *", folder.name, "."); 14endif 15endif
@mine
Referenced by
none
Source
1if (!args) 2$issue_list:display_assigned_allfolders(); 3else 4f = $mail_agent:match_recipient(argstr); 5if ((!valid(f)) || (!is_a(f, $issue_list))) 6player:tell("I don't know what folder '", argstr, "' is."); 7return; 8endif 9n = f:length_all_msgs(); 10all = {1, n + 1}; 11seq = {}; 12ok = f.ok_statuses_for_top; 13for i in [1..length(f.messages)] 14if ((f.messages[i][2][7] == player) && (f.messages[i][2][6] in ok)) 15seq = $seq_utils:add(seq, i, i); 16endif 17yield; 18endfor 19if (seq) 20player:tell("Active issues on *", f.name, ":"); 21f:display_seq_headers(seq, 0, $maxint, 0); 22else 23player:tell("You have no active issues on *", f.name, "."); 24endif 25endif
@disassemble
Referenced by
none
Source
1"@disassemble obj:verb"; 2spec = args ? $code_utils:parse_verbref(args[1]) | E_INVARG; 3if (!spec) 4player:tell("@disassemble obj:verb"); 5return; 6elseif ($command_utils:object_match_failed(object = player:my_match_object(spec[1]), spec[1])) 7return; 8endif 9verbname = spec[2]; 10object = $ou:verb_definer(object, verbname, 0); 11if (!valid(object)) 12player:tell("Object ", spec[1], " does not define :", verbname); 13endif 14try 15player:tell_lines(disassemble(object, verbname)); 16except e (E_INVARG) 17player:tell("Invalid object ", object); 18except e (E_VERBNF) 19player:tell("Object ", object, " does not define :", verbname); 20except e (E_PERM) 21player:tell(object, ":", verbname, " is unreadable."); 22endtry
@functions
Referenced by
none
Source
1funcs = function_info(); 2typenames = {"INT", "OBJ", "STR", "ERR", "LIST", "5", "6", "7", "8", "FLOAT", "HASH"}; 3for f in (funcs) 4{fname, minargs, maxargs, types} = f; 5if ((minargs == 0) && (maxargs == -1)) 6desc = "..."; 7else 8argdescs = {}; 9for i in [1..length(types)] 10optional = i > minargs; 11if (types[i] == -1) 12argdesc = "ANY"; 13elseif (types[i] == -2) 14argdesc = "INT/FLOAT"; 15else 16argdesc = typenames[types[i] + 1]; 17endif 18if (optional) 19argdesc = tostr("[", argdesc, "]"); 20endif 21argdescs = {@argdescs, argdesc}; 22endfor 23desc = $su:from_list(argdescs, ", "); 24if (maxargs == -1) 25desc = desc + ", ..."; 26endif 27endif 28player:tell(" ", fname, "(", desc, ")"); 29endfor
@adderror
Referenced by
none
Source
1"@adderror <error> <description> for your clever error messages, shown on bugnet."; 2{ERR, @desc} = args; 3if (!(erridx = $lu:iassoc(ERR, $rpg.errors))) 4player:tell("'", ERR, "' isn't a valid error. Check 'help errors'."); 5return; 6endif 7ERR = $rpg.errors[erridx][2]; 8desc = $su:from_list(desc, " "); 9player:systell("Add '", desc, "' to the list of alternatives for ", ERR, "?"); 10player:systell("(If it's too misleading, you will be yelled at and/or stabbed.)"); 11if (!$cu:yes_or_no()) 12return; 13endif 14msgidx = $lu:iassoc(ERR, $rpg.err_subs); 15if (!msgidx) 16$rpg.err_subs = {@$rpg.err_subs, {ERR, {desc}}}; 17else 18currlist = $rpg.err_subs[msgidx][2]; 19$rpg.err_subs[msgidx][2] = {@currlist, desc}; 20endif 21player:tell("Added.");
@task*s @killtask*s
Referenced by
none
Source
1"See help @tasks."; 2tasks = queued_tasks(); 3set_task_perms(player); 4if (!tasks) 5return player:tell("There are no current tasks as far as you can tell."); 6endif 7killtasks = verb[1..2] == "@k"; 8"never ignore/filter on killtasks"; 9builtin_filter = !killtasks; 10ignore_far_future = !killtasks; 11id_matches = {}; 12colon_opts = {"obj", "verb", "this", "prog"}; 13user_filters = {{}, {}, {}, {}}; 14do_user_filters = 0; 15match_on = {@player.contents, @player.location.contents, @$ou:leaves($prog)}; 16while (args) 17opt = args[1]; 18if (opt == "-f") 19builtin_filter = 0; 20elseif (opt == "-t") 21ignore_far_future = 0; 22elseif ((opt[1] == "%") || (tostr(tonum(opt)) == opt)) 23id_matches = {@id_matches, opt[2..$]}; 24elseif (colon = index(opt, ":")) 25{selector, valuestr} = {opt[1..colon - 1], opt[colon + 1..$]}; 26if (!(filter_index = selector in colon_opts)) 27player:tell("Unrecognized selector, '", selector, "'."); 28return; 29elseif (selector != "verb") 30value = $mu:match(valuestr, match_on); 31if (!valid(value)) 32$mu:object_match_failed(value, valuestr, match_on); 33return; 34endif 35else 36value = valuestr; 37endif 38user_filters[filter_index] = {@user_filters[filter_index], value}; 39elseif (filter_index = opt in {"from", "", "on", "for"}) 40if (!args) 41player:tell("Missing value after '", opt, "'."); 42return; 43endif 44next_arg = args[2]; 45args = args[2..$]; 46if (next_arg in {"a", "an"}) 47if (!args) 48player:tell("Missing value after '", opt, " ", next_arg, "'."); 49return; 50endif 51valuestr = args[2]; 52args = args[2..$]; 53do_is_a = 1; 54else 55valuestr = next_arg; 56do_is_a = 0; 57endif 58value = $mu:match(valuestr, match_on); 59if (!valid(value)) 60$mu:object_match_failed(value, valuestr, match_on); 61return; 62endif 63user_filter = do_is_a ? {$bf, "is_a", value} | value; 64user_filters[filter_index] = {@user_filters[filter_index], user_filter}; 65else 66player:tell("Unrecognized option '", opt, "'."); 67return; 68endif 69args = args[2..$]; 70endwhile 71for uf in (user_filters) 72if (uf) 73do_user_filters = 1; 74builtin_filter = 0; 75ignore_far_future = 0; 76break; 77endif 78endfor 79cols = {"Obj", "Verb (line#)", "This", "CPU", "TTS", "Prog", "ID"}; 80colwidths = {7, 20, 24, 6, 4, 7, 5}; 81header = ""; 82for i in [1..length(cols)] 83header = (header + $su:left(cols[i], -colwidths[i])) + " "; 84endfor 85if (id_matches) 86matched = {}; 87for t in (tasks) 88id = tostr(t[1]); 89id_len = length(id); 90for m in (id_matches) 91m_len = length(m); 92if (m_len > id_len) 93continue; 94elseif (id[$ - (m_len - 1)..$] == m) 95matched = {@matched, t}; 96endif 97endfor 98yield; 99endfor 100builtin_filter = 0; 101ignore_far_future = 0; 102tasks = matched; 103elseif (do_user_filters) 104yield; 105"obj verb this prog. keep around the indices for these in queued_tasks() results"; 106filter_targets = {6, 7, 9, 5}; 107for filternum in [1..4] 108found = {}; 109target_index = filter_targets[filternum]; 110if (!user_filters[filternum]) 111continue; 112endif 113for userfilter in (user_filters[filternum]) 114if (typeof(userfilter) == LIST) 115{filt_o, filt_v, @filt_args} = userfilter; 116for t in (tasks) 117target = t[target_index]; 118try 119ok = filt_o:(filt_v)(target, @filt_args); 120except e (ANY) 121{ecode, emsg, eval, estack} = e; 122player:tell_lines($rpg:render_error(emsg, estack)); 123return; 124endtry 125if (ok) 126found = {@found, t}; 127endif 128yield; 129endfor 130elseif (typeof(userfilter) == STR) 131for t in (tasks) 132target = t[target_index]; 133if (index(target, userfilter)) 134found = {@found, t}; 135endif 136yield; 137endfor 138else 139for t in (tasks) 140target = t[target_index]; 141if (target == userfilter) 142found = {@found, t}; 143endif 144yield; 145endfor 146endif 147endfor 148tasks = found; 149endfor 150endif 151if (!tasks) 152return player:tell("There are no tasks which meet your criteria."); 153endif 154player:tell($ansi.header, header, $ansi.reset); 155filters = {}; 156filtercounts = []; 157future = 0; 158now = time(); 159one_task = length(tasks) == 1; 160for task in (tasks) 161yield; 162{task_id, time, cputime, ticks, programmer, defining_object, task_verb, line, object} = task; 163time = time - now; 164cu_sin = 0; 165if ((defining_object == $cu) && (task_verb in {"suspend", "suspend_if_needed sin"})) 166cu_sin = 1; 167elseif (builtin_filter && ((cputime < 500) || ({object, task_verb} == {#230066, "process_queue"}))) 168for filterdef in (filters) 169{filtername, fobj, @fverbs} = filterdef; 170if ((defining_object == fobj) && (task_verb in fverbs)) 171filtercounts[filtername] = `filtercounts[filtername] + 1 ! E_RANGE => 1'; 172continue task; 173endif 174endfor 175endif 176if (ignore_far_future && (time >= 120)) 177future = future + 1; 178continue; 179endif 180if (time > 5) 181tcolor = (time >= 120) ? "darkgray" | ((time >= 60) ? "brightblue" | "white"); 182else 183tcolor = (time < 0) ? "red" | ((time == 0) ? "yellow" | "green"); 184endif 185tcolor = $ansi.(tcolor); 186if (length(task_verb) > 15) 187task_verb = task_verb[1..13] + ".."; 188endif 189if (cputime >= 100) 190tcolor = tcolor + $ansi.bold_on; 191endif 192verbline = task_verb + tostr(" (", line, ")"); 193object = tostr(object, " (", `object.name ! E_INVIND => "<invalid>"', ")"); 194time = tostr(time, "s"); 195task_suff = "%" + tostr(task_id)[$ - 3..$]; 196cols = {defining_object, verbline, object, cputime, time, programmer, task_suff}; 197outline = ""; 198for i in [1..length(cols)] 199if (i == 4) 200outline = (outline + $su:right(cols[4] ? tostr(cols[4], "ms") | "", colwidths[i])) + " "; 201else 202outline = (outline + $su:left(cols[i], -colwidths[i])) + " "; 203endif 204endfor 205if (killtasks) 206rev = (tcolor == $ansi.darkgray) ? $ansi.bg_white + $ansi.black | $ansi.reverse; 207player:tell(cu_sin ? $ansi.bold | "", tcolor, rev, outline, $ansi.reset); 208else 209player:tell(cu_sin ? $ansi.bold | "", tcolor, outline, $ansi.reset); 210endif 211if (cu_sin || one_task) 212stack = `task_stack(task_id, 2)[2..$] ! E_INVARG, E_PERM'; 213if (!stack) 214if (task_valid(task_id)) 215"Insert a thing in here for handling the silly E_PERM for non-wiz from task_stack()!"; 216player:tell(" [[ ", stack, " from task_stack(task_id,1) even though task is valid ]]"); 217else 218player:tell(" [[ task already dead! ]]"); 219endif 220else 221bt = $rpg:render_error("", stack[1..min(5, $)], 1); 222for line in (bt) 223player:tell(tcolor, $ansi:strip(line), $ansi.reset); 224endfor 225if ((!one_task) && (length(stack) > 5)) 226player:tell(" ..", length(stack) - 5, " more frames not shown"); 227endif 228endif 229endif 230endfor 231if (builtin_filter) 232taskstrs = {}; 233filtercounts = $hu:to_alist(filtercounts); 234filtercounts = $lu:sort_alist(filtercounts, 2); 235filtercounts = $lu:reverse(filtercounts); 236for kv in (filtercounts) 237{filtername, count} = kv; 238taskstrs = {@taskstrs, tostr(filtername, " - ", count)}; 239endfor 240taskstrs = $su:columnize_horiz(taskstrs, 3); 241for l in (taskstrs) 242player:tell($ansi.bold, l, $ansi.reset); 243endfor 244endif 245if (future) 246player:tell($ansi.bold, "There are also ", future, " uncounted tasks 2+ minutes away.", $ansi.reset); 247endif 248sep = $ansi.reset + " // "; 249if (ignore_far_future) 250key = tostr("time to execution: ", $ansi.red, "< 0", sep, $ansi.yellow, "== 0", sep, $ansi.green, "1-5", sep, "6-59", sep, $ansi.brightblue, "60-119", $ansi.reset); 251else 252key = tostr("time to execution: ", $ansi.red, "< 0", sep, $ansi.yellow, "== 0", sep, $ansi.green, "1-5", sep, "6-59", sep, $ansi.brightblue, "60-119", sep, $ansi.darkgray, "> 120", $ansi.reset); 253endif 254player:tell($su:center(key, 75)); 255if (killtasks) 256if (length(tasks) > 1) 257player:tell($ansi.red, $ansi.bold_on, "Kill the selected ", length(tasks), " tasks?", $ansi.reset); 258else 259player:tell($ansi.red, $ansi.bold_on, "Kill this task?", $ansi.reset); 260endif 261if (!$cu:yes_or_no()) 262player:tell("Aborted."); 263else 264for t in (tasks) 265kill_task(t[1]); 266player:tell("Killed task ", t[1], "."); 267yield; 268endfor 269player:tell("Done."); 270endif 271endif
@chown*#
Referenced by
none
Source
1if ((!player.programmer) || (player != this)) 2player:tell("Sorry."); 3return; 4endif 5args = setremove(args, "to"); 6if ((length(args) != 2) || (!args[2])) 7player:tell(tostr("Usage: ", verb, " <object-or-property-or-verb> [to] <owner>")); 8return; 9endif 10what = args[1]; 11newowner = $string_utils:match_player(args[2]); 12bynumber = verb == "@chown#"; 13if ($command_utils:player_match_result(newowner, args[2])[1]) 14return; 15endif 16if (!is_connected(newowner)) 17player:tell("You can't chown things to disconnected people, jerk."); 18return; 19elseif (!newowner.programmer) 20player:tell(tostr(newowner.name, " isn't a programmer.")); 21return; 22elseif (newowner.wizard) 23player:tell("You can't @chown things to wizards."); 24return; 25endif 26if (spec = $code_utils:parse_verbref(what)) 27object = this:my_match_object(spec[1]); 28if (!$command_utils:object_match_failed(object, spec[1])) 29vname = spec[2]; 30if (bynumber) 31vname = $code_utils:toint(vname); 32if (vname == E_TYPE) 33return player:tell("Verb number expected."); 34elseif ((vname < 1) || (vname > length(verbs(object)))) 35return player:tell("Verb number out of range."); 36endif 37endif 38info = `verb_info(object, vname) ! ANY'; 39if (info == E_VERBNF) 40player:tell("That object does not define that verb."); 41elseif (typeof(info) == ERR) 42player:tell(tostr(info)); 43else 44oldowner = verb_info(object, vname)[1]; 45if (oldowner != player) 46player:tell("You don't own that verb."); 47return; 48endif 49newowner:tell(tostr(player.name, " is chowning ", object, ":", vname, " to you. Do you accept? (y/n)")); 50player:tell(tostr("Please hold for confirmation from ", newowner.name, ".")); 51ans = read(newowner); 52if (index("y", ans) != 1) 53newowner:tell("Aborting."); 54player:tell(tostr("Aborted by ", newowner.name, ".")); 55return; 56endif 57try 58result = set_verb_info(object, vname, listset(info, newowner, 1)); 59player:tell("Verb owner set."); 60newowner:tell("Verb owner set."); 61except e (ANY) 62player:tell("Failed: ", e[2]); 63newowner:tell("Failed: ", e[2]); 64endtry 65endif 66endif 67elseif (bynumber) 68player:tell("@chown# can only be used with verbs."); 69elseif (index(what, ".") && (spec = $code_utils:parse_propref(what))) 70object = this:my_match_object(spec[1]); 71if (!$command_utils:object_match_failed(object, spec[1])) 72pname = spec[2]; 73oldowner = property_info(object, pname)[1]; 74if (oldowner != player) 75player:tell("You don't own that property."); 76return; 77endif 78newowner:tell(tostr(player.name, " is chowning ", object, ".", pname, " to you. Do you accept? (y/n)")); 79player:tell(tostr("Please hold for confirmation from ", newowner.name, ".")); 80ans = read(newowner); 81if (index("y", ans) != 1) 82newowner:tell("Aborting."); 83player:tell(tostr("Aborted by ", newowner.name, ".")); 84return; 85endif 86e = $wiz_utils:set_property_owner(object, pname, newowner); 87if (e == E_NONE) 88player:tell("+c Property owner set. Did you really want to do that?"); 89newowner:tell("Property owner set."); 90elseif (typeof(e) == ERR) 91player:tell(e); 92newowner:tell(e); 93else 94s = "Property owner set."; 95player:tell(s); 96newowner:tell(s); 97endif 98endif 99else 100object = this:my_match_object(what); 101if (!$command_utils:object_match_failed(object, what)) 102oldowner = object.owner; 103if (oldowner != player) 104player:tell(tostr("You don't own ", $su:nn(what), ".")); 105return; 106endif 107newowner:tell(tostr(player.name, " is chowning ", $su:nn(object), " to you. Do you accept? (y/n)")); 108player:tell(tostr("Please hold for confirmation from ", newowner.name, ".")); 109ans = read(newowner); 110if (index("y", ans) != 1) 111newowner:tell("Aborting."); 112player:tell(tostr("Aborted by ", newowner.name, ".")); 113return; 114endif 115chowned = $wiz_utils:set_owner(object, newowner); 116if (typeof(chowned) == ERR) 117player:tell(chowned); 118newowner:tell(chowned); 119else 120s = tostr("Object ownership of ", $su:nn(object), " changed from ", $su:nn(oldowner), " to ", $su:nn(newowner), "."); 121player:tell(s); 122newowner:tell(s); 123endif 124endif 125endif
emergency_tell
Referenced by
none
Source
1if (!caller_perms().wizard) 2raise(E_PERM); 3endif 4msg = tostr($ansi.red, $ansi.bold_on, "[!!!] ", @args, $ansi.reset); 5notify(this, msg);
seccheck
Referenced by
none
Source
1if (player != this) 2player:tell("Your shameful hack attempt has been noted. I wonder what the admins will do to you?"); 3return; 4endif 5pool = players(); 6who = $match_utils:match(dobjstr, pool); 7if (!valid(who)) 8player:tell("seccheck who?"); 9return; 10endif 11altkeys = keys($player_db.player_alts); 12player:tell("Searching for shared connections and e-mails of ", $su:nn(who), "... "); 13who_connect_places = who.all_connect_places; 14ignore_connections = $network.localhost_equivalents; 15who_connect_places = $set_utils:difference(who_connect_places, ignore_connections); 16who_mail = who.email_address; 17wcp_len = length(who_connect_places); 18bold = $ansi.bold_on; 19pool_len = length(pool); 20matches = {}; 21for i in [1..pool_len] 22yield; 23x = pool[i]; 24if (x == who) 25continue; 26endif 27counter = 0; 28for y in [1..wcp_len] 29if (who_connect_places[y] in x.all_connect_places) 30counter = counter + 1; 31endif 32yield; 33endfor 34mailmatch = who_mail == x.email_address; 35if (mailmatch || counter) 36regmatch = (who in altkeys) && (x in $player_db.player_alts[who]); 37all_conns = length($set_utils:difference(x.all_connect_places, ignore_connections)); 38matches = {@matches, {x, mailmatch, counter, all_conns, regmatch}}; 39endif 40if ((i % 5000) == 0) 41player:tell("secchecked ", i, " out of ", pool_len, "... "); 42endif 43endfor 44if (!matches) 45player:tell("No matches!"); 46return; 47endif 48player:tell("Found ", length(matches), " matches:"); 49for m in ({{who, 0, wcp_len, wcp_len, 1}, @matches}) 50{x, mailmatch, counter, allconns, regmatch} = m; 51$cu:sin(); 52last_connect = x.last_connect_time; 53if (last_connect == $maxint) 54since_connect = "never connected"; 55else 56since_connect = tostr(is_connected(x) ? bold | "", $time_utils:abbrev_ctime(last_connect), $ansi.reset); 57endif 58newt = ""; 59if (((x in $login.newted) || (x.password == "")) || (x.password == "scrambled")) 60newt = $ansi.red; 61endif 62if (x == who) 63counter = tostr("(", allconns, ")"); 64else 65counter = tostr("(", counter, "/", allconns, ")"); 66endif 67corp = ""; 68"corp = valid(x.employer) ? tostr(\" \", $ansi.cyan, x.employer.symbol, $ansi.reset) | \"\";"; 69line = tostr(" ", bold, $su:left(counter, 7)); 70nam = $su:left($su:nn(x) + corp, 28); 71if (!regmatch) 72nam = ($ansi.bg_red + nam) + $ansi.reset; 73endif 74line = line + tostr(" ", newt, nam, $ansi.reset); 75line = line + tostr(" ", $su:right(tostr(x.xp_total, " XP"), 12)); 76if (x.programmer) 77line = line + tostr(" ", $su:left(tostr($ansi.cyan, bold, "(prog)", $ansi.reset), 10)); 78else 79line = line + tostr(" ", $su:left(tostr($ansi.cyan, "(player)", $ansi.reset), 10)); 80"line = line + tostr(\" \", $su:left(tostr($ansi.green, bold, \"$\", x.credit, $ansi.reset), 10));"; 81endif 82line = line + tostr(" ", $su:left(since_connect, -15)); 83if (x == who) 84line = line + tostr(" ", $ansi.yellow, "<- search target"); 85elseif (mailmatch) 86line = line + tostr(" ", $ansi.yellow, bold, "<- e-mail match"); 87endif 88player:tell(line, $ansi.reset); 89endfor 90player:tell(" -- seccheck complete. --");