addworld()

Function usage:

ADDWORLD(name, type, host, port [, char, pass [, file [, use_proxy]]])

Command usage:

/ADDWORLD [-p] [-Ttype] name [char pass] host port [file]
/ADDWORLD [-Ttype] name
/ADDWORLD [-Ttype] DEFAULT [char pass [file]]


Defines a new world or redefines an existing world with the name name.

There may be a special world named "default" which does not have a host or port. If a normal world is defined without a character, pass, type, or mfile, then that world will use the corresponding field of the "default" world if there is one. If the "default" world is redefined, worlds with omitted fields will use the new default values.

Use_proxy may be 0, "off", 1, or "on". If use_proxy is 0 or "off" in the function form, or -p is given in the command form, %{proxy_host} will be ignored, and all connections to the world will be direct. By default, worlds use %{proxy_host} if it is set.

The optional type is used in hooks and triggers, and for automatic login and flag setting. The library pre-defines WORLD and LOGIN hooks for types that match these glob patterns:

(none)
TinyMud login format ("connect char pass"), the value of lp is not changed.

tiny, tiny.*
TinyMud login format ("connect char pass"), lp=off.

lp, lp.*
diku, diku.*
aber, aber.*
LP/Diku login format (sends char and pass on separate lines), lp=on. For servers that send unterminated prompts.

lpp, lpp.*
LP/Diku login format, lp=off. For muds that use GOAHEAD or EOR prompt protocol.

telnet, telnet.*
Telnet login format (sends char and pass when "login:" and "password:" prompts are received), lp=on, /localecho on. For any line-by-line telnet service.
You can define your own world types for use in other triggers or hooks. If you use names that match the glob patterns above, the standard library hooks will still work. For example, if you did:
  /test addworld("Cave",  "tiny.muck", "cave.tcp.com", 2283, char, pass)
  /test addworld("QWest", "tiny.muck", "glia",         9999, char, pass)
  /test addworld("DS",    "tiny.mush", "foo.bar.com",  6250, char, pass)
then tiny-style autologin would still work (using the library hooks), and you could also define your own triggers and hooks specific to TinyMUCKs or TinyMUSHes.

Any type is valid, but is only useful if it is matched by a "-Ttype" option of a hook or trigger.

If addworld() with a password is executed from a file that has permissions making it readable by others, it will produce a warning. You should change the file permissions to prevent other people from reading your password.

See: worlds, /connect, /fg, /telnet, /edworld


Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys