Title: Lyntin Commands Author: Will Guaraldi VERSION ======= Tue, 29 Apr 2003 02:05:04 +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: "#3k say hello" will say hello in the 3k session. 2. You can switch to another session by typing the command character and then the session name: "#3k" will switch to the 3k session. 3. You can execute a command in all sessions by typing the command character then all: "#all say hello" will 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: "#5 say hello" will send "say hello" to the current session 5 times. Commands are separated by the semicolon. Semicolons can be escaped with the \ character. Command arguments can be enclosed with { }. This enables you to specify arguments that have multiple words in them. {, } and \ can all be escaped with the \ character: \{, \}, and \\. COMMAND REFERENCE ================= 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 and no action, prints all actions. 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!} 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.ANTISUBSTITUTE syntax: #antisubstitute [] [] Allows you to create antisubstitutes. For any line that contains an antisubstitute, we won't do substitutions or gags on it. COMMANDS.BELL Kicks off the bell for a given session. Anything registered with the bell_hook will get tickled. 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 set a wide variety of options, some of which are session oriented and some of which are global. Typing "#config" by itself will print out all the options it knows about. 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.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 [TEXT...] [] 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. gag accepts multiple gags at once, and accepts a quiet argument to supress reporting of what has been gagged. examples: #gag {has missed you.} <-- will prevent any incoming line with "has missed you" to be shown. #gag has missed you <-- will gag any text with "has", "missed", or "you" 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 [