Title: Lyntin Commands Author: Will Guaraldi VERSION ======= Sat, 25 Oct 2003 16:42:36 +0000 For more up-to-date information and documentation, please check the web-site: http://Lyntin.sourceforge.net/ COMMANDS IN LYNTIN ================== Lyntin uses Lyntin commands to allow you to manipulate the Lyntin client and setup your session with aliases, variables, actions, and such. Commands start with the command character--by default this is "#". It can be changed with the "#config" command. The command character can also do some other special things: 1. You can execute commands in another session by typing the command character and then the sesion name then the command. example: #3k say hello - will say hello in session 3k #a #info - will run the #info command in session a 2. You can switch to another session by typing the command character and then the session name. examples: #a - will switch to session a (if it exists) #3k - will switch to session 3k (if it exists) 3. You can execute a command in all sessions by typing the command character then all. examples: #all say hello - will run "say hello" in all sessions 4. You can execute a command a number of times by typing the command character then a number, then the command. examples: #5 say hello - will run "say hello" 5 times Commands are separated by the semicolon. Semicolons can be escaped with the \ character. examples: say hello;wave - will run "say hello" then "wave" say hi! \;) - will run "say hi! ;)" Command arguments can be enclosed with { }. This enables you to specify arguments that have multiple words in them. exaples: #alias a b - executes #alias with args "a" and "b" #alias {a} {b} - executes #alias with args "a" and "b" #alias {a} {say hi} - executes #alias with args "a" and "say hi" #alias a say hi - executes #alias with args "a", "say", and "hi" which will kick up an error (since the #alias command doesn't accept a third string argument) {, } and \ can all be escaped with the \ character: \{, \}, and \. COMMAND REFERENCE ================= @ history tickoff action if tickon alias info ticksize antigag killall tickwarnsize antisubstitute load unaction atags log unalias bell loop unantigag chr math unantisubstitute clear nop ungag config raw unhighlight cr read unload deed schedule unschedule diagnostics session unsubstitute disable showme unswdir enable snoop unswexclude end substitute unvariable gag swdir variable grep swexclude version help textin write highlight tick zap COMMANDS.@ #@ allows you to execute arbitrary Python code inside of Lyntin. It will first look for a module named "lyntinuser" and execute the code inside that module's __dict__ environment. If no such module exists, it will execute the code inside modules.advanced . At present it can only handle one-line Python statements. examples: #@ print "hello" #@ print "\n".join(exported.get_commands()) COMMANDS.ACTION syntax: #action [] [] [] [] [] [] [] With no trigger, no action and no tag, prints all actions. With no trigger and no action, prints all actions with given tag. With a trigger and no action, prints actions that match the trigger statement. With a trigger and an action, creates an action. When data from the mud matches the trigger clause, the response will be executed. Trigger clauses can use anchors (^ and $) to anchor the text to the beginning and end of the line respectively. Triggers can also contain Lyntin pattern-variables which start with a % sign and have digits: %0, %1, %10... When Lyntin sees a pattern-variable in an action trigger, it tries to match any pattern against it, and saves any match it finds so you can use it in the response. See below for examples. Note: As a note, actions are matched via regular expressions. %1 gets translated to (.+?) and %_1 gets translated to (\S+?). The special variable "%a" means "the whole matched line". We handle regular expressions with a special r[ ... ] syntax. If you put an "i" or "I" after the ], then we'll ignorecase as well. The onetime argument can be set to true to have the action remove itself automatically after it is triggered. examples: #action {^You are hungry} {get bread bag;eat bread} #action {%0 gives you %5} {say thanks for the %5, %0!} #action {r[^%_1 tells\s+you %2$]} {say %1 just told me %2} #action {r[sven dealt .+? to %1$]i} {say i just killed %1!} see also: unaction, enable, disable, atags COMMANDS.ALIAS syntax: #alias [] [] [] With no arguments, prints all aliases. With one argument, prints all aliases which match the arg. With multiple arguments, creates an alias. You can use pattern variables which look like % and a number. %0 will be all the arguments passed in. Ranges can be used by using python colon-syntax, specifying a half-open slice of the input items, so %0:3 is the alias name, first, and second arguments of the input. Negative numbers count back from the end of the list. So %-1 is the last item in the list, %:-1 is everything but the last item in the list. examples: #alias {k*} - prints out aliases that start with k #alias {k} {kill %1} - builds a new alias #alias {gg} {put %1: in chest} - builds a new alias COMMANDS.ANTIGAG syntax: #antigag [] [] Allows you to create antigags. For any line that contains an antigag, we won't do gags on it. COMMANDS.ANTISUBSTITUTE syntax: #antisubstitute [] [] Allows you to create antisubstitutes. For any line that contains an antisubstitute, we won't do substitutions on it. COMMANDS.ATAGS Shows all the tags available see also: action, unaction, enable, disable COMMANDS.BELL Kicks off the bell for a given session. Anything registered with the bell_hook will get tickled. COMMANDS.CHR syntax: #chr [VAR] [ASCII:INT] [] Allows you to assign arbitrary characters to variables. For example, if you wanted to assign ASCII char 7 to variable ctrlG you could do: #chr {ctrlG} {7} Since this creates a variable, you should remove the variable with the unvariable command. Note: This won't work if you don't have the variable module loaded. COMMANDS.CLEAR This command clears a session of all session data (except the actual connection). This covers gags, subs, actions, aliases... COMMANDS.CONFIG syntax: #config [] [] [] Allows you to view and change configuration options that affect how Lyntin functions. Configuration options can be session oriented or global to all of Lyntin. examples: #config displays global configuration and session configuration for the current session #a #config displays global configuration and session configuration for the session named 'a' #config ansicolor displays information about the mudecho configuration option #config ansicolor on sets the ansicolor configuration option to on COMMANDS.CR This sends a carriage return to the mud. This is useful in aliases and actions that require a carriage return. COMMANDS.DEED syntax: #deed [] [] Deeds serve as a kind of notebook - whatever you don't want to forget, store it in a deed. examples:: #deed -- prints all the deeds for that session #deed {$TIMESTAMP Joe healed me} -- adds a new deed to the list Before a deed is stored, variables are expanded--this allows you to use system, global, and session variables in your deeds like $TIMESTAMP which will mark when the deed was created. COMMANDS.DIAGNOSTICS syntax: #diagnostics [] This is very useful for finding out all the information about Lyntin while it's running. This will print out operating system information, Python version, what threads are running (assuming they're registered with the ThreadManager), hooks, functions connected to hooks, and #info for every session. It's very helpful in debugging problems that are non-obvious or are platform specific. It's also invaluable in bug-reporting. It can take a filename argument and will copy the #diagnostics output to that file. This allows you easier method of submitting diagnostics output along with bug reports. Note: Windows users should either use two \'s or use / to separate directory names. COMMANDS.DISABLE syntax: #disable [] [] Temporarily disables all the actions with given tag, so their triggers won't trigger any actions (well, this desciption is a bit obscure, but I've tried my best :) see also: action, unaction, enable, atags COMMANDS.ENABLE syntax: #enable [] [] Enables actions with given tag. By default, all the tags are enabled. see also: action, unaction, disable, atags COMMANDS.END Closes all sessions and quits out of Lyntin. Note: on most muds this will leave your character in a state of linkdeath--it does not sell all your stuff, return you to town, save your character, tell your friends goodbye, or anything of that nature. COMMANDS.GAG syntax: #gag [] [] With no arguments, prints out all gags. With arguments, creates a gag. Incoming lines from the mud which contain gagged text will be removed and not shown on the ui. Gags get converted to regular expressions. Feel free to use regular expression matching syntax as you see fit. As with all commands, braces get stripped off and each complete argument creates a gag. examples: #gag {has missed you.} <-- will prevent any incoming line with "has missed you" to be shown. #gag missed <-- will gag lines with "missed" in them. #gag {r[sven.*?dealt]i} <-- will gag anything that matches the regexp "sven.*?dealt" and ignore case. COMMANDS.GREP syntax: #grep [PATTERN] [] [] Similar to the unix grep command, this allows you to extract information from the session's data buffer using regular expressions. It prints matching lines in their entirety. examples: #grep {says:} 1000 Greps the last 1000 lines of the databuffer for lines that have "says:" in them. COMMANDS.HELP syntax: #help [] With no arguments, shows all the help files available. With an argument, shows that specific help file or lists the contents of that category of help files. examples: #help - lists all help files in the root #help help - shows help for the help command #help commands.substitute - shows help for the substitute command #help commands - shows help for the commands category Items that have a number in parentheses after them are a category. The number is how many help topics are below that category. example: > #help lyntin: ::Lyntin Help:: lyntin: lyntin: category: root lyntin: lyntin: commands(55) readme(13) lyntin: textui > COMMANDS.HIGHLIGHT syntax: #highlight [