VTC Extension Files ------------------- This file documents the VTC extension files supplied in the vt/extra directory. These extensions provide features not provided by the distribution library due to limited interest, server specificity and other concerns. The files are: activity Warns on activity in undisplayed remotes bracket Command output retrieval color Color hilites cool Coolmud world support cquote Command output quoting depend Deal with dependencies among files disp Displaying VTC data filter Command output filtering fquote Maintains a quote file log_cmd Logs a command to a file moo Moo world support mush Mush world support rmtio I/O routines for remote systems unter Unter world support watch Watching for connects/disconnects To load these files at startup, create or add to a file called "~/.local.vtc" and add lines like Load("watch"); Dependencies ------------ Be aware that loading certain files will result in loading other files if they have not yet been loaded. For instance, bracket depends on rmtio, and will load rmtio if it has not yet been loaded. activity -------- This file starts up a resident process that periodically warns the user about undisplayed remotes with input waiting. An undisplayed remote will only produce one warning until it is displayed again. bracket ------- This file provides support for command output retrieval for mud, mush, and unter worlds. It defines for these types a ->bracket function pointer; it is possible to test for bracketing ability on a given remote by checking whether rmt->type->bracket is non-NULL. In that case, you can successfully call the functions: NULL bracket(SPTR cmd, [RMT rmt]) APTR get_bracketed([RMT rmt]) APTR get_cmd_response(SPTR cmd, [RMT rmt]) bracket() function issues so that the server will bracket it with a prefix and suffix. get_bracket() returns a list (a 'list' is defined so that *list is the number of elements and list[1..*list] are the elements in the list) containing the output from a bracketed command. get_cmd_response() combines the previous two functions. bracket() aborts if bracketing is not defined for . The globals prefix and suffix contain the strings produced by bracket() at the beginning and end of command output. color ----- This file provides support for color hiliting. It does this by creating styles above and beyond the four basic ones (S_NORM .. S_HILITE), storing these in a table. Then a few distribution functions are redefined (echo_style(), list_trigs(), Trig()). To the /trig command a -s switch is added, for the named style. For instance: /hilite -sred * pages: * hilites all pages in red. (Use 'lred' for bright red.) The colors defined are red, green, yellow, blue, magenta, and cyan. The /save command will save color hilites. If these are reloaded and color.vtc is not loaded, then those triggers will function as normal triggers. The /list_trigs command, unfortunately, will fail under such circumstances. cool ---- This file defines a new world type, alongside raw, line-based, and mud worlds. It adds the command /add_cool and the function add_cool(). Coolmud world support translates the Tiny* syntaxes "page player=message" and "wh player=message" to Coolmud syntax. bracket.vtc defines no bracketing method for Coolmud, since none currently exists. cquote ------ This file is a minor application of bracket. It quotes the output of mud commands. As an example, typing "/cquote score" will send something like: :> score :| You have 2347 pennies. The output can be more than one line. You can achieve the same effect by typing 'score' and ^XQ. depend ------ This file keeps track of dependencies between extras files. It is loaded automatically if you load any other extras file. disp ---- This file defines the d() function, which displays VTC data in a vaguely acceptable form. For instance, "d(3);" displays "3"; "d(table(2, 3, 4));" displays "&{ 2, 3, 4 }". Array elements are displayed until a NULL is reached. filter ------ This file is another application of bracket. It defines the command /filter, which has the syntax: /filter [-rv] = /filter sends to the server and filters out the lines not matching , which is an smatch expression, unless -r is specified, in which case it is a regexp. If -v is specified, /filter filters out the lines that do match instead of those that do not. fquote ------ This file maintains a quotes file in "~/.vtquotes". The command "/addquote " will add to the quotes file. The command "/fquote" will select a random line from the quotes file and quote it to the current remote. The command "/fquote " will select a random line matching . /fquote will not repeat a line until it has run out of lines to quote. log_cmd ------- This file defines a command /log_cmd = Assuming the current world type supports bracketing, log_cmd will write the output of to . The output of will not be displayed in the current window. moo --- This file defines a new world type, alongside raw, line-based, and mud worlds. It adds the command /add_moo and the function add_moo(). Moo world support translates the Tiny* syntax "page player=message" and "wh player=message" to MOO syntax. bracket.vtc uses the Moo commands PREFIX and SUFFIX instead of the standard mud commands OUTPUTPREFIX and OUTPUTSUFFIX to do bracketing. mush ---- This file defines a new world type, adding the command /add_mush and the function add_mush(). Mush worlds contain several extensions. Input is autoquoted so that the % \ { } [ ] ( ) and space characters are prefixed by a backslash. This autoquoting takes place normally on lines beginning with " and :. If the global mush_meddle is true, then no lines are autoquoted; if mush_nomeddle is true, then all lines are autoquoted. Both start out false. If mush_redo_wh is true, whispers will be reformatted as @pemit commands using a comma in the appropriate place. This feature may not be compatible with earlier Muses and earlier Mushes. Only whisper commands beginning with "wh" or "w" will be reformatted; "whi" or "whisper" commands will not be. mush_redo_wh starts out false. If mush_redo_say is true, lines beginning with " will be reformatted as pose commands using a comma in the appropriate place. If you are set nospoof on the Mush, this code will filter out the prefixes on lines that do not appear to be spoofs, using fairly complex criteria. The following sort of trigger is also useful: /trig -Gr ^\[UsefulCommands\(#170\){Moira}[^]]*\] (.*) = /receive %1 to eliminate the prefix on lines that are technically spoofs but are generated commonly by certain system commands. rmtio ----- This filter defines some basic remote I/O functions. The functions are: SPTR getline([RMT rmt]) SPTR regetline([RMT rmt]) NULL waitfor(SPTR match, [RMT rmt]) NULL waitfor_and_suppress(SPTR match, [RMT rmt]) NULL waitfor_strstr(SPTR what, [RMT rmt]) NULL waitfor_reg(REG reg, [RMT rmt]) SPTR waitfor_reg_and_suppress(REG reg, [RMT rmt]) NULL suppress_until(SPTR match, [RMT rmt]) SPTR suppress_until_reg(REG reg, [RMT rmt]) getline() and regetline() call read() and reread() respectively on , or on cur_rmt if is not specified. They abort the calling function if is not given and cur_rmt is NULL, or if read() returns NULL. The remaining functions are self-explanatory. Functions that return strings return the lines matched by the regexp they are passed. All functions use getline() and regetline() and therefore abort the calling function under the same circumstances. unter ----- This file defines the Unter world type. Unters are similar to muds, except that bracketing is done differently in bracket.vtc, the login sequence skips the opening messages, and there is support for Unter portals. watch ----- This file adds the /watch, /list_watch, and /unwatch commands. The /watch command instructs the client to begin watching for connecting or disconnecting on each of the worlds you are connected to. /watch operates by reading a WHO list from each mud every minutes. After watch is loaded, the /save command will save /watches as it does worlds, macros, and triggers.