Well... it doesn't quite work with telnet's to port 23 yet. But once I wake up, I'll figure that out too, I hope. Just type "help tv" and "@messages tv" for more information once you create the stupid thing. Suggestions for making this useful encouraged, especially if they come with code :*) @dump #348 with create @create $thing named Television:Television,tv @prop #348."error_msg" "Cannot connect. " rc @prop #348."Connection_ID" 0 rc @prop #348."close_connection_msg" "The connection has closed." rc @prop #348."no_connection_msg" "The television isn't connected to anywhere." rc @prop #348."already_connected_msg" "The television is already on!" rc @prop #348."kill_msg" "You shoot your television." rc @prop #348."okill_msg" "shoots the television." rc @prop #348."screen" {} rc ;;#348.("screen") = {} @prop #348."screen_size" 48 rc @prop #348."channels" {} rc ;;#348.("channels") = {{"martini.eecs.umich.edu", 3000, "Martini Geographical Name Server"}, {"downwind.sprl.umich.edu", 3000, "Downwind Weather Underground"}} @prop #348."help_msg" {} rc ;;#348.("help_msg") = {"How to Use Your RKO Telnetvision", "", "SWITCH %T to [host [port]]", " Opens a connection to host, on port. Defaults to local host, port 23.", "SWITCH %T to Channel _n_", " Opens a connection to whatever that channel happens to be.", "", "SHOW _controls_ on %T", " Shows the specified controls. Can be _channels_, _connection_, or _height_.", "", "ADJUST %T for _control_ _parameters_", " Adjusts the control:", " adjust %t for height _n_", " adjust %t for preset host [port] [description]", "", "DEFace %T with _words_", "%T, _words_", " Sends the _words_ to the connection.", "", "WATCH %T", " Pay attention to the %t when someone else is using it.", "IGNORE %T", " Stop paying attention to the %t.", "", "KILL %T", " Kill your %T."} @prop #348."connection_info" {} rc @prop #348."channel_guide_msg" "The TelnetVision Guide" rc @prop #348."listeners" {} rc @prop #348."has_remote_control" {} rc ;;#348.("key") = #78 ;;#348.("aliases") = {"Television", "tv"} ;;#348.("description") = "A television screen with pong burned indelibly into the phosphor." ;;#348.("object_size") = {0, 0} @verb #348:"switch" this to any r @program #348:switch if (this.Connection_ID != 0) player:tell(this.already_connected_msg); return; this.screen = {}; endif Telnet = this:GetHostPort(iobjstr); Host = Telnet[1]; Port = Telnet[2]; Connection = $network:open(Host, Port); if (typeof(Connection) == ERR) player:tell(this.error_msg, tostr(Connection)); return; endif this.Connection_ID = Connection; this.connection_info = {Host, Port}; this.has_remote_control = {player}; while (typeof(line = read(Connection)) == STR) fork (0) this:inform(line); endfork endwhile suspend(2); player:tell(this.close_connection_msg); this.connection_info = {}; this.Connection_ID = 0; this.has_remote_control = {}; $network:close(Connection); . @verb #348:"GetHostPort" this none this @program #348:GetHostPort "Syntax: GetHostPort(iobjstr);"; " Where iobjstr may be either host, or host port."; host = $network.site; port = 23; TheLine = $string_utils:words(args[1]); if (length(TheLine) == 1) host = TheLine[1]; else if (length(TheLine) == 2) host = TheLine[1]; port = tonum(TheLine[2]); endif endif if ((host == "Channel") && (length(this.channels) >= (port - 1))) if (port == 1) player:tell("Don't ya know nuthin? There *is* no 'Channel 1'"); player:tell("I'll give you Channel 2 instead."); port = 2; endif host = this.channels[port - 1][1]; port = this.channels[port - 1][2]; endif return {host, port}; . @verb #348:"def*ace" this with any @program #348:deface if (player in this.has_remote_control) if (this.Connection_ID != 0) notify(this.Connection_ID, iobjstr); else player:tell(this.no_connection_msg); endif else player:tell("You haven't got control of the ", this.name, "."); endif . @verb #348:"inform" this none this @program #348:inform player:tell(@args); this.screen = {@this.screen, @args}; if (this.screen_size && (length(this.screen) > this.screen_size)) this.screen = this.screen[length(this.screen) - this.screen_size..length(this.screen)]; endif for dude in (this.listeners) dude:tell(@args); endfor . @verb #348:"kill shoot" this none none @program #348:kill player:tell(this.kill_msg); player.location:announce(player.name, " ", this.okill_msg); if (this.Connection_ID != 0) $network:close(this.Connection_ID); this.Connection_ID = 0; endif this.screen = {}; . @verb #348:"adjust" this for any @program #348:adjust Controls = $string_utils:words(iobjstr); Knob = Controls[1]; if (Knob in {"size", "screensize", "height"}) this.screen_size = tonum(Controls[2]); player:tell("You adjust the screen size to ", this.screen_size, "."); else if (Knob in {"preset", "channel"}) Port = 23; Description = ""; Host = Controls[2]; if (length(Controls) > 2) if (tonum(Controls[3]) > 0) Port = tonum(Controls[3]); if (length(Controls) > 3) Description = Controls[4..length(Controls)]; endif endif else Description = Controls[3..length(Controls)]; endif Channel = {Host, Port, $string_utils:from_list(Description, " ")}; this.Channels = {@this.Channels, Channel}; player:tell("You add ", $string_utils:from_list(Channel, " "), " to the list of presets. It is channel ", length(this.Channels) + 1, "."); else player:tell("There is no ", Knob, " control on the ", this.name, "."); endif endif . @verb #348:"description" this none this @program #348:description WhatYouSee = pass(@args); if (length(this.screen)) WhatYouSee = {WhatYouSee, "", @this.screen}; else if ((this.Connection_ID == 0) && length(this.channels)) WhatYouSee = {WhatYouSee, "", @this:ShowChannels()}; endif endif return WhatYouSee; . @verb #348:"ShowChannels" this none this @program #348:ShowChannels Channels = {this.channel_guide_msg}; if (length(this.channels)) Channel = 2; while ((Channel - 1) <= length(this.channels)) Channel_Line = this.channels[Channel - 1]; ChannelHost = Channel_Line[1]; ChannelPort = Channel_Line[2]; ChannelDescription = Channel_Line[3]; Channels = {@Channels, ((" Channel " + tostr(Channel)) + ": ") + ChannelDescription}; Channel = (Channel + 1); endwhile else Channels = {}; endif return Channels; . @verb #348:"show" any on this @program #348:show if (dobjstr in {"connection", "channel"}) if (this.Connection_ID == 0) player:tell(this.no_connection_msg); else player:tell("Connected to ", host, " on port ", port, "."); endif else if (dobjstr in {"channels", "guide"}) if (length(this.channels)) player:tell_lines(this:showchannels()); else player:tell("There are no preset channels."); endif else if (dobjstr in {"height", "screensize", "size"}) (this.screen_size == 0) ? player:tell("The screen is infinitely tall.") | player:tell("The screen is ", this.screen_size, " lines tall."); else player:tell("There is no ", dobjstr, " to show on the ", this.name, "."); endif endif endif . @verb #348:"watch" this none none @program #348:watch if (player in this.listeners) player:tell("You're already watching, ya couch potato."); else this.listeners = {@this.listeners, player}; player:tell("You are hypnotized by the ", this.name, "."); endif . @verb #348:"ignore" this none none @program #348:ignore if (Player_Loc = (player in this.listeners)) this.listeners = listdelete(this.listeners, Player_Loc); player:tell("You tear yourself away from the ", this.name, "."); else player:tell("You weren't paying attention to begin with!"); endif . @verb #348:"tell" this none this @program #348:tell Speaker = $string_utils:match_player(args[1]); if (Speaker in this.has_remote_control) TheLine = args[3]; Commander_End = index(TheLine, ","); if (Commander_End && (TheLine[1..Commander_End - 1] in this.aliases)) TheCommand = TheLine[Commander_End + 1..length(TheLine)]; if (this.Connection_ID == 0) Speaker:tell(this.no_connection_msg); else notify(this.Connection_ID, TheCommand); endif endif endif . "***finished***