;"Thank you for installing this Object." ;"This installation file was created by debug(smithdm@metronet.com)" ;"Other Generics are availible at http://www.cmoo.com/moo/moogens.html" ;"This object was created by: Grand_Master of LambdaMOO" ;"*Please make sure that you have edited this script and replaced with the appropriate object number*" @prop ."seek_failed_msg" "%n bounces off a topographical barrier, and into the room." rc @prop ."seek_arrive_msg" "%n arrives, of necessity by an ugly method." rc @prop ."seek_leave_msg" "%n leaves, of necessity by an ugly method." rc @prop ."home2" #11 rc @prop ."home" #11 rc @prop ."brief" 0 rc @prop ."debug" 0 rc @prop ."simulating" 1 rc @prop ."command_ok" {} rc ".("listen_actions") => E_PERM (Permission denied) @prop ."monitor_ok" {} rc @prop ."echo_prefix_msg" " (%n) " rc @prop ."tell_forward" {} r @prop ."linelen" 79 rc ".("key") => E_PERM (Permission denied) ;;.("aliases") = {"Generic Puppet"} ;;.("object_size") = {17039, 864994677} @verb :"com*mand" this to any rxd @program :command "command to "; "Command the puppet to `do' the given command line, processing it as if it were a command issued by a player."; who = (callers() && (caller != this)) ? caller_perms() | player; if (!this:command_ok(who)) who:tell($string_utils:pronoun_sub("%n % your command.", this)); return E_PERM; endif text = substitute("%1", $sysobj:match(argstr, ("%<" + prepstr) + "%> *%(.+%)$")); if (!text) who:tell("Transmit what to ", this.name, "?"); else who:tell("You transmit the command \"", text, "\" to ", this.name, "."); this:do(text); endif . @verb :"mon*itor" this none none rxd @program :monitor "mon*itor "; "Have everything heard by the puppet relayed back to you."; who = (callers() && (caller != this)) ? caller_perms() | player; if (!this:monitor_ok(who)) who:tell($string_utils:pronoun_sub("%n % want you monitoring %o.", this)); this:tell($string_utils:nn(who), " is refused permission to monitor."); return E_PERM; endif this:add_monitor(who); this:tell(who.name, " starts monitoring."); . @verb :"ign*ore" this none none rxd @program :ignore "ignore "; "Stop monitoring the puppet."; who = (callers() && (caller != this)) ? caller_perms() | player; if (!(who in this.tell_forward)) who:tell("You aren't listening to ", this.name, "."); else this:tell(who.name, " stops monitoring."); this:remove_monitor(who); endif . @verb :"tell" this none this @program :tell pass(@args); this:tell2(@args); . @verb :"moveto" this none this @program :moveto "Do a fake :look_self check with the puppet as `player'."; old = this.location; pass(@args); if ((this.location != old) && this.tell_forward) if (valid(where = this.location)) this:call_as_puppet(where, "look_self", {this.brief}); endif endif "Quinn 09-DEC-93 0223: Added call_as_puppet line to prevent weird spoofs."; . @verb :"wh*isper" any to this rxd @program :whisper this:tell(player.name, " whispers, \"", dobjstr, "\""); player:tell("You whisper, \"", dobjstr, "\" to ", this.name, "."); . @verb :"do" this none this rxd #49853 @program :do if ((caller != this) && (!this:command_ok(caller_perms()))) return E_PERM; endif if (caller_perms().wizard) who = player; else who = caller_perms(); endif text = args[1]; now = listdelete(args, 1); for k in ({{"\"", "say "}, {":", "emote "}, {";", "eval"}, {"?", "help"}}) if (index(text, k[1]) == 1) text = k[2] + text[length(k[1]) + 1..length(text)]; endif endfor y = this:parse_command(text, this); if ((y != {}) && valid(this.location)) player = this; verb = y[1]; dobj = y[2][1]; dobjstr = y[2][2]; prep = y[3][1]; prepstr = y[3][2]; iobj = y[4][1]; iobjstr = y[4][2]; args = y[5][1]; argstr = y[5][2]; verbargs = {y[6], {dobj, prep, iobj}}; if (this:find_verb(player, verb, @verbargs)) this:call(who, player, verb, args, @now); elseif (this:find_verb(player.location, verb, @verbargs)) this:call(who, player.location, verb, args, @now); elseif (this:find_verb(dobj, verb, @verbargs)) this:call(who, dobj, verb, args, @now); elseif (this:find_verb(iobj, verb, @verbargs)) this:call(who, iobj, verb, args, @now); else "Comment out for now; should replace with correct huh sequence."; "this:call(who, player.location, \"huh2\", {verb, args}, @now)"; "... Rog suggests:"; this:call(who, $command_utils, "do_huh", {verb, args}, @now); endif else "1/15/96, Heathcliff"; this:tell("I don't understand that."); endif . @verb :"acceptable" this none this @program :acceptable return !is_player(args[1]); . @verb :"look_self" this none this @program :look_self pass(); if (this.simulating) if ((time = this:idle_time()) == 999999999) player:tell($string_utils:pronoun_sub("%S % sleeping.", this)); elseif (time < 120) player:tell($string_utils:pronoun_sub("%S % awake and % alert.", this)); else time = $string_utils:from_seconds(time); player:tell($string_utils:pronoun_sub(("%S % awake, but % been % for " + time) + ".", this)); endif if (this.contents) player:tell("Carrying:"); for thing in (this.contents) player:tell(" ", thing:title()); endfor endif endif . @verb :"find_verb" this none this @program :find_verb where = args[1]; vrb = args[2]; match = args[3]; do = args[4][1]; pn = args[4][2]; io = args[4][3]; if (valid(where) && (def = $object_utils:has_verb(where, vrb))) inf = verb_args(def[1], vrb); if ((inf[2] == "none") && (inf[3] == "this")) return 0; "make sure to exclude this none this verbs"; endif return index(verb_info(def[1], vrb)[2], "x") && (((((inf[1] == "this") && (where == do)) || (inf[1] in match[1])) && (inf[2] in match[2])) && (((inf[3] == "this") && (where == io)) || (inf[3] in match[3]))); endif return 0; . @verb :"sweep_msg" this none this @program :sweep_msg y = setremove(this.tell_forward, player); if (y) who = {}; for k in (y) who = listappend(who, ((k.name + " (") + tostr(k)) + ")"); endfor return "is listening for " + $string_utils:english_list(who); endif . @verb :"call" this none this rxd #49853 @program :call if (caller_perms().wizard) who = args[1]; set_task_perms(who.wizard ? $no_one | who); return args[2]:(args[3])(@args[4]); "Grump 6/19/93: try it without the 'fork' for a while"; if ((length(args) > 4) && args[5]) args[2]:(args[3])(@args[4]); else suspend(1); fork (3) args[2]:(args[3])(@args[4]); endfork endif else return E_PERM; endif . @verb :"monitor_ok command_ok" this none this @program :monitor_ok who = args[1]; return ((who in this.(verb)) || (who == this.owner)) || (who == $code_utils:verb_loc().owner); . @verb :"idle_time" this none this @program :idle_time time = time0 = 999999999; for who in (setadd((typeof(y = this.command_ok) == LIST) ? y | {}, this.owner)) if (((who in connected_players()) && ((who in this.tell_forward) || (who.location == this.location))) && (time > (y = idle_seconds(who)))) time = y; endif endfor return time; . @verb :"seek" any none none rxd @program :seek #7069:(verb)(@args); . @verb :"initialize" this none this rxd #49853 @program :initialize if (caller_perms() == this.owner) "Grump 6/22/93: took out #24222.puppets initialization -- what was it here for?"; this.home = this.owner.home; this.debug = 0; this.command_ok = {}; this.listen_actions = {}; this.monitor_ok = {}; this.tell_forward = {}; endif pass(@args); . @verb :"tell2" this none this rx #49853 @program :tell2 if (typeof(set_task_perms(this.owner)) == ERR) return E_PERM; endif for q in (this.tell_forward) q:tell($string_utils:pronoun_sub(this.echo_prefix_msg, this), @args); endfor text = tostr(@args); for q in (this.listen_actions) if (y = $string_utils:match_string(text, q[1])) fork (0) comm = q[2][random(length(q[2]))]; if (typeof(y) == LIST) for w in (y) comm = strsub(comm, "%" + tostr(w in y), w); endfor endif this:do(comm, @q[3..length(q)]); return; endfork endif endfor . @verb :"is_listening" this none this rxd #49853 @program :is_listening for x in (this.tell_forward) if (x:is_listening()) return 1; endif endfor return 0; . @verb :"linelen" this none this @program :linelen "Copied from generic player (#6):linelen by Hacker (#18105) Fri Oct 30 15:50:47 1992 PST"; return abs(this.linelen); . @verb :"i inv*entory" none none none rxd @program :i "originally from $player:inv"; if (this.contents) c = this.contents; longear = {}; gear = {}; width = player:linelen(); half = width / 2; player:tell("Carrying:"); for thing in (c) cx = tostr(" ", thing:title()); if (length(cx) > half) longear = {@longear, cx}; else gear = {@gear, cx}; endif endfor this:tell_lines($string_utils:columnize(gear, 2, width)); this:tell_lines(longear); else this:tell("You are empty-handed."); endif . @verb :"parse_command" this none this @program :parse_command ":parse_command(cmdline-string) Pass to $string_utils by default."; return $string_utils:parse_command(@args); . @verb :"call_as_puppet" this none this rxd #2487 @program :call_as_puppet "-- WIZARDLY --"; ":call_as_puppet(object, verbname, args)"; "Calls the given verb, after setting 'player' to this 'puppet'."; if ((caller == this) || $perm_utils:controls(caller_perms(), this)) actual = player; player = this; this:call(this, @args); player = actual; else return E_PERM; endif . @verb :"do(new)" this none this @program :do(new) "Copied from Generic Puppet (#7680):do by Froxx (#49853) Sun Aug 15 18:22:44 1993 PDT"; if ((caller != this) && (!this:command_ok(caller_perms()))) return E_PERM; endif if (caller_perms().wizard) who = player; else who = caller_perms(); endif text = args[1]; now = listdelete(args, 1); for k in ({{"\"", "say "}, {":", "emote "}, {";", "eval"}, {"?", "help"}}) if (index(text, k[1]) == 1) text = k[2] + text[length(k[1]) + 1..length(text)]; endif endfor y = this:parse_command(text, this); if ((y != {}) && valid(this.location)) player = this; verb = y[1]; dobj = y[2][1]; dobjstr = y[2][2]; prep = y[3][1]; prepstr = y[3][2]; iobj = y[4][1]; iobjstr = y[4][2]; args = y[5][1]; argstr = y[5][2]; verbargs = {y[6], {dobj, prep, iobj}}; if (this:find_verb(player, verb, @verbargs)) this:call(who, player, verb, args, @now); elseif (this:find_verb(player.location, verb, @verbargs)) this:call(who, player.location, verb, args, @now); elseif (this:find_verb(dobj, verb, @verbargs)) this:call(who, dobj, verb, args, @now); elseif (this:find_verb(iobj, verb, @verbargs)) this:call(who, iobj, verb, args, @now); else "Comment out for now; should replace with correct huh sequence."; "this:call(who, player.location, \"huh2\", {verb, args}, @now)"; "... Rog suggests:"; this:call(who, $command_utils, "do_huh", {verb, args}, @now); endif endif . @verb :"add_monitor" this none this @program :add_monitor ":add_monitor(who)"; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif if (args[1] != this) return this.tell_forward = setadd(this.tell_forward, args[1]); endif . @verb :"remove_monitor" this none this @program :remove_monitor ":remove_monitor(who)"; if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) return E_PERM; endif return this.tell_forward = setremove(this.tell_forward, args[1]); . @verb :"mon(old)" this none none @program :mon(old) if (this:monitor_ok(player)) this.tell_forward = setadd(this.tell_forward, player); this:tell(player.name, " starts monitoring."); else player:tell($string_utils:pronoun_sub("%n % want you monitoring %o", this)); this:tell(player.name, " is refused permission to monitor."); endif . @verb :"ign(old)" this none none @program :ign(old) this:tell(player.name, " stops monitoring."); this.tell_forward = setremove(this.tell_forward, player); . @verb :"com(old)" this to any @program :com(old) "command puppet to do something for 'player'"; if (this:command_ok(player)) text = argstr[($string_utils:index_delimited(argstr, prepstr) + length(prepstr)) + 1..length(argstr)]; while ((text != "") && (text[1] == " ")) text = text[2..length(text)]; endwhile if (text == "") player:tell("Transmit what to ", this.name, "?"); else player:tell("You transmit the command \"", text, "\" to ", this.name, "."); this:do(text); endif else player:tell("Permission denied."); endif . @verb :"my_match_object" this none this @program :my_match_object "Copied from generic player (#6):my_match_object by ur-Rog (#6349) Mon May 5 16:29:14 1997 PDT"; ":my_match_object(string [,location])"; return $string_utils:match_object(@{@args, this.location}[1..2], this); . ;"Your object should now be installed."