8 4
name
"waldo"
/
description
"it's an odd little device with a keyboard, high-resolution monitor, and a pair of heavily-instrumented powergloves.  A little post-it next to the monitor reads:\n    TO ACTIVATE, TYPE 'call lambda'\n    TO DISCONNECT, TYPE 'hang up waldo'\n    TO CONTROL, TYPE 'waldo <cmd>'\n    TO LIST SITES, TYPE 'sites'"
/
location
#19
/
addresses
'(("lambda" "13.2.116.36 8888" "connect guest\n")
  ("media" "18.85.0.48 8888" "connect guest\n")
  ("jayshouse" "129.10.10.59 1709" "connect guest\n"))
/
find-address
(method (instr)
  (foreach (addr addresses)
    (if (= (car addr) instr)
      (return addr))))
/
call-out
(method (inline)
  (var addr
    (if (set addr (find-address (index 2 inline)))
      (if (#0:call-me-out (index 2 addr))
        (begin
          (location:announce
           (+ name "'s screen flashes the 'Connection established' message\n"))
          (echo (index 3 addr)))
        (location:announce
          (+ name "'s screen flashes the 'Could not connect' message\n")))
     (location:announce
       (+ name "'s screen flashes 'Invalid destination'\n")))))
/
parse
(method (inline)
  (location:announce (+ name ":> " inline "\n")))
/
list-sites
(method (unused)
  (begin (location:announce
           (+ name "'s screen prints 'call <sitename>' to connect\n"))
         (foreach (addr addresses)
           (location:announce (+ (index 1 addr) "\n")))))
/
tell
(method (instring)
  0)
/
command-waldo
(method (inline)
  (if (echo (+ (index 3 inline) "\n"))
    (location:announce (+ (player:get-name) " types on " name "'s keyboard: "
                          (index 3 inline) "\n"))
    (location:announce (+ (player:get-name) " vainly taps on " name
                          "'s unconnected keyboard\n"))))
/
hang-up-waldo
(method (inline)
  (if (name-match (index 3 inline))
    (begin
      (quit)
      (location:announce (+ (player:get-name) " hangs up " name "\n")))))
/
/
'("call" SOME)
call-out
'("wal" (or "do" "") REST)
command-waldo
'("hang" "up" SOME)
hang-up-waldo
'("sites")
list-sites
/+++++++++++++++++++++++++ end of object #22 ++++++++++++++++++++++++++++++