Index

  1. #<number>
  2. #action, #unaction
  3. #addbutton, #rembutton
  4. #addlabel, #remlabel, #setlabeltext
  5. #addrow, #remrow
  6. #addvarchooser, #remvarchooser, #addvarchooseritem, #remvarchooseritem
  7. #addvarentry, #remvarentry
  8. #addvarlabel, #remvarlabel
  9. #alias, #unalias
  10. #bell
  11. #char
  12. #command, #uncommand
  13. #evalfile
  14. #evalsysfile
  15. #evaluserfile
  16. #highlight, #unhighlight
  17. #if
  18. #incr
  19. #keycom
  20. #killall
  21. #log, #logfile
  22. #map
    #map devmode
    #map map
    #map player
    #map pos
    #map room
    #map zoom
  23. #math
  24. #nop
  25. #notouch, #unnotouch
  26. #parse
  27. #sendfile
  28. #showme
  29. #sleep
  30. #smm
    #smm commandoutput
    #smm file
  31. #substitute, #unsubstitute
  32. #system
  33. #tab, #untab
  34. #tickon, #tickoff, #tickreset, #tickremall, #ticksize, #tickaddcommand, #tickremcommand, #tickshow, #tickshowall
  35. #variable, #unvariable
  36. #while








Commands Syntax


#<number>

Sends its argument <number> times to the MUD.
Syntax:
#<number> <arg>
Arguments:
Takes only one argument!
Examples:
#4 "get iron ration"
	
MUD will receive:

get iron ration
get iron ration
get iron ration
get iron ration


#addbutton, #rembutton

Please see section User interface too. add or remove command buttons. These send commands to the SMM parser, if pressed. This is then the same, as you would have typed them in in the input entry.
Syntax:
#addbutton <rowname> <buttoname> <text> <command>
#rembutton <rowname> <buttoname>
Examples:
#variable stuff torch
#addrow    st
#addbutton st getstuff "get stuff" {get $stuff}
	
Please pay attion, when to use brackets {} and when quotes "".

#addlabel, #remlabel, #setlabeltext

Please see section User interface too. Add, remove a widgets displaying just some text; or change the text of an existing one.
Syntax:
#addlabel <rowname> <namename> <text> <widht>
#addlabel <rowname> <namename> <text>
-> width is set to the length of the initial text.
#remlabel <rowname> <namename>
#setlabeltext <rowname> <namename> <new text>
Examples:
#addrow   stuff
#addlabel stuff title "Stuff: "
	

#addrow, #remrow

Add or remove rows, that can contain user defined widgets. Please see section User interface too. Also have a look at #addbutton, #addlabel, #addvarentry, #addvarlabel, #addvarchooser.
Syntax:
#addrow <rowname>
#remrow <rowname>
Examples:
#addrow stuff
#remrow stuff
	

#addvarchooser, #remchooser, #addvarchooseritem, #remchooseritem

Please see section User interface too.
This widgets displays the value of a variable, and lets you choose from a list of values.
Syntax:
#addvarchooser <rowname> <varchooser name> <variable name> <width>
#remvarchooser <rowname> <varchooser name>
#addvarchooseritem <rowname> <varchooser name> <a string>
#remvarchooseritem <rowname> <varchooser name> <a string>
Examples:
#addrow            bags
#addlabel          bags title "BAG: "
#addvarchooser     bags bchooser bag 15
#addvarchooseritem bags bchooser "bag"
#addvarchooseritem bags bchooser "sack"
#addvarchooseritem bags bchooser "backpack"
#variable          bag  "must not be from list"
	

#addvarentry, #remvarentry

Please see section User interface too.
Displays the value of a variable and lets you set it in the widget.
Syntax:
#addvarentry <rowname> <varentry name> <variable name> <width>
#remvarentry <rowname> <varentry name>
Examples:
#addrow            bags
#addlabel          bags title "BAG: "
#addvarentry       bags bentry bag 15
#variable          bag  backpack
	

#addvarlabel, #remvarlabel

Please see section User interface too.
Displays the value of a variable.
Syntax:
#addvarlabel <rowname> <varlabel name> <variable name> <width>
#remvarlabel <rowname> <varlabel name>
Examples:
#variable          bag  backpack
#addrow            bags
#addlabel          bags title "BAG: "
#addvarlabel       bags blabel bag 15
	

#action, #unaction

This command falls into the category of commands parsing MUD text. Therefor you might want to read this first.

As soon an action pattern matches the corresponding commands are invoked. Any action is invoked once per line of received text.

Syntax:
  1. #action <level>
  2. #action <level> <glob style pattern>
  3. #unaction <level> <glob style pattern>
  4. #action <level> <regular expression> <actions>
Arguments:
  1. #action <level>
    Shows all defined actions of level <level>.
  2. #action <level> <glob style pattern>
    Shows all defined actions of level <level> matching <glob style pattern>.
  3. #unaction <level> <glob style pattern>
    Removes all actions of level <level> matching <glob style pattern>.
  4. #action <level> <regular expression> <actions>
    Defines an action of level <level>. Detailed information about regular expressions can be found in the man page of regexp. A SMM action is in priciple nothing else than a call the the tcl function regexp. So the man page above will quite help you to understand how action works.
    If an action is invoked/the <regular expression> has matched a line received from the mud, the matching string is put into the variable RegExMatch. So you can use it. Furthermore, if you had submatch-expressions they are returned in the variables RegExSubMatch0 - RegExSubMatch9. So for 10 submatches the result is returned. If you are new to regular expressions, you might be confused a bit right now,.. please also read the part about regular expressions below and have a look at the examples. I hope things get clearer then. If you have a particular problem, but somehow cant figure it out how to express it in a regular expression, feel free to drop me a line. I'll help if I can.



Remarks on matching strings:

first: two string matching and two string are the same, is not! the same. It depends on the matching methid used.

Exact matching:
Easiest to understand: two strings are considered to match if tey are the same (matching and being the same is the same here). Dont fool yourself with spaces: "north" and "north " are not the same string and not matching! the seconds string has a space at the end.
Glob style matching:
Quite widely known and used. Most filesystems support this for matching filenames, e.g: from msdos 'dir *.*' or unix 'ls *.gz' (I know,.. msdos is not really glob style,.. but let it be).
E.g.: the string "north" matches the pattern "no*". Obviously the strings "north" and "no*" are not the same. But as you realize, the '*' character has a special meaning for glob style matching. There are special characters too (taken from tclhelp):
*
Matches any sequence of characters in string, including a null string.
?
Matches any single character in string.
[chars]
Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match.
\x
Matches the single character x. This provides a way of avoiding the special interpretation of the characters *?[]\ in pattern.
Regular expressions
This is the most powerful matching method. At first sight it seems to be complicated, but take you time to understand it. It will open a complete new world to you! Without regular expressions, I doubt I could programm SMM++! Detailed information about regular expression can be found in the man page of regexp. The only thing I want to say about regular expressions here is its special characters:
\
shields the following character; the following character looses its special meaning.
(
starts a submatch. (a submatch is an atom e.g.)
)
ends a submatch
|
separates branches of regular expressions
*
matches 0 or more atoms
+
matches 1 or more atoms
?
matches 0 or 1 atom
.
matches any character (a '.' is an atom e.g., a single charakter too)
^
means the start of line
$
means the end of line
[chars]
Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match. If the chars start with '^' the set of character will be an anti-set. (this is an atom too)
Examples:
#nop --- search for an exact string
#action 0 "Bambi" "kill Bambi"
#action 0 "Dumbo" "kill Dumbo"
#nop --- show all actions starting with a B
#action 0 "B*"
#nop --- show all actions containing the sequence 'mb'
#action 0 "*mb*"


#nop === exploring exgular expressions
#nop --- searching for exits (e.g. an automapper implementation)
#nop --- assume, that the exits are sometimes displayed as
#nop ---  "-North" and sometimes as "-north" and sometimes as 
#nop ---  "-N" and sometimes as "-n"
#nop --- So provide 4 actions to detect this
#action 3 {-North} {#variable exN 1}
#action 3 {-north} {#variable exN 1}
#action 3 {-N}     {#variable exN 1}
#action 3 {-n}     {#variable exN 1}

#nop --- a more efficient and straight on forward implementation
#action 3 {-North|-north|-N|-n} {#variable exN 1}
#nop --- the '|' means or: either match the one or the other 
#nop ---  or the other or the other regular expression
#nop --- The variable RegExMatch will contain what have been matched:
#nop --- if it was the -North or -north or ...
#nop --- just spend a '#showme $RegExMatch'

#nop --- ok, now we dense all even more, first we just put two and two
#nop --- expression together:
#action 3 {-[nN]orth|-[nN]} {#variable exN 1}
#nop --- [nN] means a single character (atom) either being a 'n'
#nop --- or a 'N'
#nop --- BTW: [0-9] means just numbers, [a-z] just lower letters, 
#nop --- [A-Z] just capital letters, [0-9a-zA-Z] alpha numeric 
#nop --- characters only

#nop --- and now at last we dense it all together
#action 3 {-[nN](orth)?} {#variable exN 1}
#nop --- the (..) is a submatch and any submatch is an atom!
#nop --- and the '?' requires 0 or 1 times the atom.

#nop --- ok,.. there is still a bug in it:
#nop --- the expressions above will also match a mud output like:
#nop --- Dumbo says '------no------"
#nop --- the "-n" match will match it,.. so we will also require a 
#nop --- space at the end of the match
#action 3 {-[nN](orth)? } {#variable exN 1}


#nop === using machting variables
#nop --- just one simple example, which will make everything clear
#nop --- hopefully,..
#action 5 {^(.*) tells you "(.*)"$} { tell $RegExSubMatch0 Dont tell me '$RegExSubMatch1'!!!}
#nop --- remember the '.' means any character and the '*' mean as 
#nop --- many as matches (till the ' tells you') and the '()' group them into a submatch,
#nop --- so you get the result in a variable back.

	
BTW: use quotes ("") and curly braces ({}) wisely -> variable substitution!

#alias, #unalias

You can define aliases and the first word of each of your inputs will be checked, if it is an alias. If it is an alias, your input will be changed acordingly to your requests.
Syntax:
#alias
or: #alias <aliaspattern>
or: #alias <aliasname> <alias>
  1. #alias
    Lists all defined aliases
  2. #alias <aliaspattern>
    Lists all aliases, which match the pattern. 'Globstyle' matching is used.
  3. #alias <aliasname> <alias>
    Defines, that 'aliasname' is 'alias' now.
Arguments:

Arguments following this word are stored in the variables '1'...'n'. Variable '0' contains the whole string following the alias. You may use these variables in the alias definition.

Examples:

#alias {mm} {magic missile $0}
#alias {pb} {put $0 in bag}
#alias {au} {shout I will pay $2 platin for $1.}
	

input: 'mm'
to mud: 'magic missile'

input: 'mm guard'
to mud: 'magic missile guard'

input: 'pb all'
to mud: 'put all in bag'

input: 'au sword 10'
to mud: 'shout I will pay 10 platin for sword.'"


#bell

Rings the system beeper or changes its parameters.
Syntax:
  1. #bell
    Rings the bell.
  2. #bell <[on|off|reset]>
    Turns the bell on, off or resets it to the default settings.
  3. #bell <volume> <hertz> <milliseconds>
    Sets the volume, tone and duration of the bell. Might not work on all systems.
Examples:
#bell
	

#char

The first character of the input will identify, if the input is a SMM command. On default it is set to '#', but you can change it.
Syntax:
#char <new character>
Arguments:
One argument, which is just a single character: the new command character.
Examples:
#char /
	

#command, #uncommand

These commands build up the command-list, which is used for command-completition.
Non complete commands will be searched in this list (according to the order they were put into it), so that you can use abrevitations, e.g.: #var instead of #variable.
Syntax:
  1. #command
  2. #command <command>
  3. #uncommand <command>
Arguments:
  1. #command
    Shows all commands in the command-list.
  2. #command <command>
    Adds one more command into the command-list.
  3. #uncommand <command>
    Removes one command from the command-list.
Examples:
#command command
#com variable 
#com unalias
#com unvariable
#com
	
#un (even #u) will be enough, if you want to unalias an alias.
If you want to unvariable a variable, you need to type #unv at least!

Please, take care that you dont invoke unwanted commands!


#evalfile

Reads commands line by line from a file and evaluates them, as if they were typed in.
Syntax:
#evalfile <path>
Examples:
#evalfile /home/issever/bla.smm
	

#evalsysfile

Reads commands line by line from a file and evaluates them, as if they were typed in.
Syntax:
#evalsysfile <fileId name>
Examples:
#evalsysfile welcome
	

#evaluserfile

Reads commands line by line from a file and evaluates them, as if they were typed in.
Syntax:
#evaluserfile <fileId name>
Examples:
#evaluserfile fight
#evaluserfile elfmage
	

#highlight, #unhighlight

This command falls into the category of commands parsing MUD text. Therefor you might want to read this first.

With #highlight you can colorize the text received from the MUD. All matching highlights will be colorized.

Syntax:
  1. #highlight
  2. #highlight <level>
  3. #highlight <level> <pattern>
  4. #unhighlight <level> <pattern>
  5. #highlight <level> <what> <hls>
Arguments:
  1. #highlight
    Shows all defined highlightss.
  2. #highlight <level>
    Shows all defined highlights of level <level>.
  3. #highlight <level> <pattern>
    Shows all defined highlights of level <level> matching <pattern>.
  4. #unhighlight <level> <pattern>
    Removes all highlights of level <level> matching <pattern>.
  5. #highlight <level> <from> <to>
    Defines a highlight of level <level>. Every <what> in the received text is colorized according to <hls>.
    <hls> is a space separated list of the following items:
    Foreground color:
    FGdef, FGblack, FGred, FGgreen, FGyellow, FGblue, FGred2, FGblue2, FGwhite.
    Background color:
    BGdef, BGblack, BGred, BGgreen, BGyellow, BGblue, BGred2, BGblue2, BGwhite.
    Fonts:
    FNdef, FNbold
    Blinking:
    BLon, BLoff
Examples:
#highlight 5 kill "FGred BLon"
	

#if

Conditional expression.
Syntax:
  1. #if <expression> <commands>
  2. #if <expression> <commands1> else <commands2>
  3. #if <expression1> <commands1> elseif <expression2> <commands2> else <commands3>
  4. #if <expression1> <commands1> elseif <expression2> <commands2> (... elseif ...) else <commands3>
Arguments:
<expression> is exactly processed as the #math expression. You might want to look there too.
  1. #if <expression> <commands>
    If <expression> is true, <commands> are evaluated.
  2. #if <expression> <commands1> else <commands2>
    If <expression> is true, <commands1> are evaluated; otherwise <commands2> are evaluated.
  3. #if <expression1> <commands1> elseif <expression2> <commands2> else <commands3>
    No explanation needed,.. if needed ask me or in the newsgroup.
  4. #if <expression1> <commands1> elseif <expression2> <commands2> (... elseif ...) else <commands3>
    Any number of 'elseif's are allowed. No explanation needed,.. if needed ask me or in the newsgroup.
Examples:
#variable a 1
#variable b abc
#if {$a==0} {#showme if} else {#showme else}
#if {![string compare "abc" $abc]} {#showme equal} else {#showme "not equal"}
	

#incr

Syntax:
  1. #incr <varname>
  2. #incr <varname> <value>
Arguments:
  1. #incr <varname>
    Increases variable '<varname>' by 1.
  2. #incr <varname> <value>
    Increases variable '<varname>' by <value>.
Examples:
#variable a 1
#incr a
#variable
#incr a -1
#variable
	

#keycom

Syntax:
  1. #keycom <sequence> <input>
    You can define any key sequence <sequence> to send <input> to the SMM parser.
Examples:
One might want to send the string 'eat iron ration' to the MUD on pressing the alternate key and f key together:
 #keycom {<Alt-f>} {eat iron ration} 
Or you prefer to bind the spell magic missle to the sequence Alt-s (for spells), Alt-m:
 #keycom {<Alt-s><Alt-m>} {cast magic missle} 
Or bind it to the sequence Control-Alternate-m
 #keycom {<Control-Alt-m>} {cast magic missle} 
Details:
Modifiers: Control and Alt are modifiers. You can have any number of them. This is a list of the available modifiers:
  • Alt
  • Control
  • Shift
  • Lock
  • Meta or M
  • Mod1 or M1
  • Mod2 or M2
  • Mod3 or M3
  • Mod4 or M4
  • Mod5 or M5
Most of them can also be extended by a '_L' or '_R'. e.g. Alt_L; this is then the left alternate key only.

ADVISE: Dont bind the return key! And dont bind keys you need to give in your normal input without modifiers,.. e.g. the 'a'-key, you don't really want that.
But maybe
 #keycom {<Escape>} {flee} 
is a good idea.

Detail: the 'f', 's' and 'm' in the above examples correspond to the "detail". The list of available details is (maybe there are more?!?):
  • a-z, A-Z, 0-9
  • F1, F2, ... for the functionkeys
  • '' = Escape'
  • ' ' = 'space'
  • '!' = 'exclam'
  • '@' = 'at'
  • '#' = 'numbersign'
  • '$' = 'dollar'
  • '%' = 'percent'
  • '^' = 'asciicircum'
  • '&' = 'ampersand'
  • '*' = 'asterisk'
  • '(' = 'parenleft'
  • ')' = 'parenright'
  • '_' = 'underscore'
  • '-' = 'minus'
  • '+' = 'plus'
  • '=' = 'equal'
  • ''' = 'apostrophe'
  • '"' = 'quotedbl'
  • ',' = 'comma'
  • '.' = 'period'
  • '/' = 'slash'
  • '<' = 'less'
  • '>' = 'greater'
  • '?' = 'question'
  • ';' = 'semicolon'
  • ':' = 'colon'
  • ''' = 'apostrophe'
  • '"' = 'quotedbl'
  • '[' = 'bracketleft'
  • '{' = 'braceleft'
  • ']' = 'bracketright'
  • '}' = 'braceright'
  • '\' = 'backslash'
  • '|' = 'bar'
  • '`' = 'grave'
  • '~' = 'asciitilde'
  • misc. keys:
  • ' = 'BackSpace'
  • '' = 'Insert'
  • '' = 'Delete'
  • ' ' = 'Tab'
  • '' = 'Home'
  • '' = 'Prior'
  • '' = 'Next'
  • '' = 'End'
  • '' = 'Pause'
  • '' = 'Scroll_Lock'
  • '' = 'Print'
  • '' = 'Num_Lock'
  • '' = 'Pause'
  • Below for keypad keys
  • '' = 'KP_Insert'
  • '' = 'KP_End'
  • '' = 'KP_Down'
  • '' = 'KP_Next'
  • '+' = 'KP_Add'
  • '' = 'KP_Left'
  • '' = 'KP_Begin'
  • '' = 'KP_Right'
  • '-' = 'KP_Subtract'
  • '' = 'KP_Home'
  • '' = 'KP_Up'
  • '' = 'KP_Prior'
  • '*' = 'KP_Multiply'
  • arrow keys:
  • '' = 'Up'
  • '' = 'Down'
  • '' = 'Left'
  • '' = 'Right'

#killall

Syntax:
  1. #killall
    Clears all aliases, variables, commandlist, tablist, highlight, etc,..
Examples:
#killall
	

#log, #logfile

Used for logging a session to a file.
Syntax:
  1. #logfile <absolute path>
  2. #log <[0|1]>
  3. #log
Arguments:
  1. #logfile <absolute path>
    This tells the session in which file to log the session. You must give this before you can use the '#log' command. The log will be appened. If the file doesnt exist, if will be created.
  2. #log <[0|1]>
    Turns off/on the logging.
  3. #log
    Toggles between off/on.
Examples:
#logfile /home/issever/bla.smm
#log 1
#log 0
	

#map

First of all: the #map command is not tuned to detect syntax errors. In most error cases just nothing will happen; if you type in a comand again and again and nothing happens, please check, if you are using it the right way. Sometimes missing arguments will be assumed to be an empty string. My advise for now is, that you really take care to use the #map as described below. If you encounter difficulties or a dangerous or annoying behaviour of the #map command, please notify me, describing the case.

  1. #map devmode
    General command.
    Syntax:
    #map devmode <[1|on|ON|yes|YES|true|TRUE|...]>
    Turns on or off map development mode. The effect will be the same as switching the development mode from the menu -> map -> development mode.
    Arguments:
    If argument is one of the mentioned above, development mode will be turned on. Any other argument will turn it off.
    Examples:
    #map devmode on
    	    

  2. #map map
    With this subset of commands you can query or modify maps.
    Syntax:
    #map map exists <mapname> <maplevel> <return value variable>
    If a map with name <mapname> and level <maplevel> exists the variable with the name <return value variable> will be set to 1. Otherwise the variable is set to 0. You can use this variable later in #if e.g..
    #map map change <mapname> <maplevel>
    Changes the map to the indicated map.
    #map map create <mapname> <maplevel>
    Creates a new map with the given name and level.
    Arguments:
    As said syntax checking is not performed! So take care that you use the arguments as they were intended to!
    • <mapname>: Any map name accepted by SMM++. May be any string.
    • <maplevel>: Please take care that this variable is an integer value!
    • <return value variable>: Any valid variable name. Please refer to the #variable command.
      Instead of extending the parser, I've chosen this approach (for now) to return information from a command. You give a variable name and can find the information after executing the command in the respective variable ('call by reference' or 'pointer' is the term;)).
    Examples:
    Assume variable 'actmapname' contains the name of the actual map and 'actmaplevel' contains its level.
    The example below may be used e.g. in an automapper, when going down:
    #var level $actmaplevel
    #map map exists $actmapname $level retval
    #while {$retval} {
      #nop decrease level, until a "free" map level is found ;
      #incr level -1 ;
      #map map exists $actmapname $level retval
    }
    #map map create $actmapname $level
    #nop now return to the previous map
    #map map change $actmapname $actmaplevel
    	    
    BTW: If you woudl have typed the command '#while "$retval" ...' the above example would not work, as in quotes retval would just be replaced by its value ONCE at startup! So the test in the while loop would not work.

  3. #map player
    This subset of commands refer always to the player position (position means 'map' and 'x/y-coordinates')! The player position is marked as the blue rectangle in one of the maps. There is always exactly one player positon.
    These commands will drag the zoom with them (for details about the zoom position please see #map zoom); no matter, if player position and zoom position are currently at the same place, after on of these commands they will be at the same place. BUT! therefore the actual zoom position must be already saved or you must be in development mode! Otherwise just nothing will happen, execept a notice that the zoom is not saved.
    Syntax:
    #map player useexit <exit index>
    Will use the exit with the index <exit index>: sends the command to the map and will move the player on the map.
    #map player useexitwithcommand <exit command>
    Will use the exit with the command <exit command>: sends the command to the map and will move the player on the map. The corresponding exit of the command must be searched before, so this commands takes a bit more CPU than the above,.. just if its of any relevance.
    #map player followexit <exit index>
    Will move the player thrue the exit with the index <exit index>. No command is send to the mud. This is useful, when following somebody or used in aliases, which just need to move the player (, because the command is already sent).
    #map player followexitwithcommand <exit command>
    This is the same as the command above. The difference is that the corresponding exit will be searched before.
    #map player speedwalk <mapname> <maplevel> <xpos> <ypos>
    This command will move the player to the indicated position. If works just as clicking with the mouse on the map for speedwalking.
    Arguments:
    • <exit index>: may be one of the following: nw, nc, ne, cw, ce, sw, sc, se, uo, ux, do, dx. Its the index of the corresponding exit button. For more information, please have a look at here.
    • <exit command>: This is the command, which is send to the mud; the string, which is in the diplayed on the button and in the 'command'-entry of the exit interface. All exits are queried, if their command and the given string <exit command> match. EXACT MATCHING is required! So dont let yourself be fooled by one of the strings containing a space and the other not, e.g.: "north" and "north " are NOT the same!
    • <mapname>: Any map name accepted by SMM++. May be any string.
    • <maplevel>: Please take care that this variable is an integer value!
    • <xpos>: Please take care that this variable is an integer value!
    • <ypos>: Please take care that this variable is an integer value!
    Examples:
    #nop - this alias will search the corresponding exit and send 
    #nop - the command to the mud AND move the player on the map.
    #alias n {#map player useexitwithcommand "north"}
    
    #nop --- Just by the way,..
    #nop --- please note: if the command which the exit uses would 
    #nop --- be "n" instead of "north", you would end up in an 
    #nop --- endless loop, when you define an alias, which has the 
    #nop --- name 'n'!
    
    
    #nop - another implementation
    #alias n {north; #map player followexitwithcommand "north"}
    #nop - ;) BUT, you might fool yourself!
    #nop - => if there is a door, the open and close commands are not 
    #nop -    send in this implementation!! they are send in the above
    #nop -    implementation! Be sure, that you know what SMM++ does for
    #nop -    you and what you want from SMM++ to do for you.
    
    #nop - speedwalking to city center
    #alias gocc {#map player speedwalk "The City Of Hamburg" 0 254 29}
    	    

  4. #map pos
    Set and query the player and the zoom position. There is always exactly one player position (a blue retangular in one of your maps) and exactly one zoom position (a red retangular in one of your maps). The player position is used for moving the palyer around. The zoom position is used to look in different rooms and build a room at some place. 99% of the time the zoom and player position will always be on the same spot.
    Syntax:
    #map pos getplayer <mapname varname> <maplevel varname> <xpos varname> <ypos varname>
    Puts the player position data into the given variables.
    #map pos setplayer <mapname> <maplevel> <xpos> <ypos>
    Sets the player position to the given place.
    #map pos getzoom <mapname varname> <maplevel varname> <xpos varname> <ypos varname>
    Puts the zoom position data into the given variables.
    #map pos setzoom <mapname> <maplevel> <xpos> <ypos>
    Sets the zoom position to the given place.
    Arguments:
    • <mapname>: Any map name accepted by SMM++. May be any string.
    • <maplevel>: Please take care that this variable is an integer value!
    • <xpos>: Please take care that this variable is an integer value!
    • <ypos>: Please take care that this variable is an integer value!
    • <* varname>: Any valid variable name. Please refer to the #variable command.
      Instead of extending the parser, I've chosen this approach (for now) to return information from a command. You give a variable name and can find the information after executing the command in the respective variable ('call by reference' or 'pointer' is the term;)).
    Examples:
    #nop - get the name and level of your actual map
    #map pos getplayer actmapname actmaplevel dummy1 dummy2	    
    	    

  5. #map room These commands query properties of rooms.
    Syntax:
    #map room exists <mapname> <maplevel> <xpos> <ypos> <return value variable>
    Test if a room exists. The result is returned in the variable <return value variable>: 0, if the room doesnt exists; 1, if the room exists.
    #map room getexitwithcommand <mapname> <maplevel> <xpos> <ypos> <command> <return value variable>
    Returns the exit index of the queried room with the command <command>. If no such exit exists an empty string is returned. Also have a look at map player.
    Arguments:
    • <mapname>: Any map name accepted by SMM++. May be any string.
    • <maplevel>: Please take care that this variable is an integer value!
    • <xpos>: Please take care that this variable is an integer value!
    • <ypos>: Please take care that this variable is an integer value!
    • <return value variable>: Any valid variable name. Please refer to the #variable command.
      Instead of extending the parser, I've chosen this approach (for now) to return information from a command. You give a variable name and can find the information after executing the command in the respective variable ('call by reference' or 'pointer' is the term;)).
    • <command>: This is the command, which is send to the mud; the string, which is in the diplayed on the button and in the 'command'-entry of the exit interface. All exits are queried, if their command and the given string <exit command> match. EXACT MATCHING is required! So dont let yourself be fooled by one of the strings containing a space and the other not, e.g.: "north" and "north " are NOT the same!
    Examples:
    #map room exists "Elven Forest" 0 342 87 retval
    	    

  6. #map zoom
    This is the commandset, you need to use for building rooms. That means, for an automapper you have to use these commands.
    Use these commands, as you would use the graphical user interface, all the button, etc.. The commands will imediatly take effect and the result can be seen in the user interace.
    Syntax:
    #map zoom accept
    Has the same effect as pressing the accept button.
    #map zoom reset
    Has the same effect as pressing the reset button.
    #map zoom <[clear|remove]>
    Clears the whole zoom interface. This means the room is removed from the zoom interface; !from the zoom interface only! If you want to permanently remove it from the map too, you need to send an accept command afterwards too.
    #map zoom setbg <bg-type> <bg-category> <bg-name>
    Sets the bg image to the indicated image. The type, category and name of all the available images are shown in the background selector interface. If you move onto one of the background buttons its type, category and name are displayed in the label below.
    #map zoom setstuff <stuff-index> <stuff-type> <stuff-category> <stuff-name>
    This works the same way as the command above. You just have to give a <stuff-index> too, as there are 9 possible positions where the stuff can be put to.
    #map zoom remstuff <stuff-index>
    Removes the stuff at the indicated position.
    #map zoom settext <text>
    Sets the text, which is displayed for this room.
    #map zoom remtext
    Removes the text.
    #map zoom setexit <exit index> <command> <mapname> <maplevel> <connect x> <connect y> <draw x> <draw y> <door> <door open command> <door close command> <line thickness> <line color>
    Creates an exit with the given parameters. The parameters corospond to those, which are available in the exit configuration interface.
    #map zoom remexit <exit index>
    Removes the exit at the indicated position.
    Arguments:
    • <bg-type>: The corresponding type of a background image is the first string, which is displayed in the label of the background selector, when the mouse moves over the button of this image.
    • <bg-category>: same as above, but the 2. string.
    • <bg-name> : same as above, but the 3. string.
    • <stuff-index>: may be one of the following: nw, nc, ne, cw, cc, ce, sw, sc, se. For more information, please have a look at here.
    • <stuff-type>: works as the with the backgrounds, but of course the stuff selector is now of relevance. Its the 1. string in the label.
    • <stuff-category>: same as above, but the 2. string.
    • <stuff-name>: same as above, but the 3. string.
    • <text>: any string.
    • <exit index>: may be one of the following: nw, nc, ne, cw, ce, sw, sc, se, uo, ux, do, dx. Its the index of the corresponding exit button. For more information, please have a look at here.
    • <command>: any string. This string is send to the mud, when the exit is used.
    • <mapname>: Any map name accepted by SMM++. May be any string. This is the (name of the) map the exit leads to.
    • <maplevel>: Please take care that this variable is an integer value! This is the (level of the) map the exit leads to.
    • <connect x>: an integer value. The x coordinate of the position the exit leads to.
    • <connect y>: an integer value. The y coordinate of the position the exit leads to.
    • <draw x>: an integer value. The x coordinate of the position the exit is drawn to. Exit connections are only drawn within a map; even, if the exit leads to another map. Give an empty string, when you dont want the exit to be drawn. Exit connections are only drawn for the exits with one of the indices nw, nc, ne cw, ce, sw, sc, se.
    • <draw y>: same as above, but y coordinate.
    • <door>: may be 1 or 0. If its 1, a door for the exit will exist. Thus when using the exit, first the <door open command> is send to the mud then the <command> for the movement and at the end the <door close command> of the exit is send.
    • <door open command>: any string; see above, please.
    • <door close command>: any string; see above, please.
    • <line thickness>: The thickness of the drawn exit lines/the connections if you want so.
    • <line color>: the color of the connection/exit. May be one of the following: black red green blue "bg def" "bg dark" white yellow magenta cyan. Please dont use other colors, as your maps would not be SMM++ conform anymore! You cannot exchange them with others, nor support will be given. Contact me before first, if you need a special feature for anything anytime.
    Examples:
    #nop --- this alias creates the exit first and the uses it.
    #alias n {
      #map pos getplayer actmapname actmaplevel x y ;
      #incr y +1 ;
      #map zoom setexit nc north "" "" $x $y $x $y 0 "" "" 2 black ;
      #map player useexit nc
    } 
    	    

#math

Syntax:
  1. #math <varname> <expression>
    Sets or creates the variable <varname> with the value of the result of the mathematical expression <expression>.
Arguments:
The expression <expression> to #math is (after variable substitution) directly passed to the tcl expr command. 'expr' can handle all normal mathematical operations and much more (binary operators, etc).
Therefore I've copied the expr man page to here. Please follow this link to read about the whole possibilities with expr/#math.
There is more to know: As the expression is directly passed to tcl/tk you can use all tcl/tk functions. Most importantly is the string function to you, as you need to do operations on strings. Read this link for more information about the string function.
Examples:
#math a {1/2}
#math b {1.0/2.0}
#math c {1+$a+$b}
#math d {1<3}
#math e {[string compare "a" "b"]}
#variable
	

#nop

#nop is the SMM comment.
Syntax:
#nop <arg> [... <arg>]
Arguments:
Any. Anything following the #nop will be discarded.
Examples:
#nop *** BAG relevant configuration ***
#variable actbag "backpack"
#alias    lib    {look in $actbag}
#alias    gb     {get $0 from $actbag}
	

#notouch, #unnotouch

This command falls into the category of commands parsing MUD text. Therefor you might want to read this first.

With #notouch you can stop further parsing of the text received from the MUD.

Syntax:
  1. #notouch <level>
  2. #notouch <level> <pattern>
  3. #unnotouch <level> <pattern>
Arguments:
  1. #notouch <level>
    Shows all defined notouches of level <level>.
  2. #notouch <level> <pattern>
    Defines a notouch.
  3. #unnotouch <level> <pattern>
    Removes a notouch.
Examples:
#notouch 0 "dwarven elite guard"
	
Useful, if you have defined a bunch of autokill triggers;)

#parse

You can turn off input parsing. This means: commands will not be splitted at ';'s, no alias and variable substitution will be performed. In brief: the input will be send as is to the MUD.
Syntax:
  1. #parse
    Will toggle parsing.
  2. #parse [0|1]
    Will turn off/on parsing.
Examples:
#parse 1
	

#sendfile

Sends a file as is to the MUD.
Contrary to '#evalfile' the input will not be processed. That means no variable substitution, no alias substitution, etc.
Syntax:
#sendfile <path>
Examples:
#sendfile /home/issever/bla.smm
	

#showme

Just prints onto the output screen.
Syntax:
#showme <string>
Takes exactly one argument!
Examples:
#showme "If you have more than one word, you need to quote the string."
#showme "Actual weapon: $weapon."
	

#smm

The #smm command groups a whole lot of commands, which are not used too often. I hope to make the parser faster and more transparent in use.
  1. #smm commandoutput
    General command.
    Syntax:
    #smm commandoutput <[no|No|NO|false|False|FALSE|off|Off|OFF|0|...]>
    Turns commandoutput on or off. You might miss a whole lot of important messages too! So think well before turning it off. But on the other handside it might be reasonable to turn the output off, while loading standart configuration files.
    Arguments:
    If argument is one of the mentioned above, command output will be turned on or off. Any other argument will turn it off.
    Examples:
    #smm commandoutput off
    	    

  2. #smm file
    File operations.
    Syntax:
    #smm file readasmud <filename>
    Reads in the file with the given name, as if its content would have been send by the mud! So If you have a log file, or a file which you have written, you can offline tune and debug your scripts: test if actions highlightnings etc. work.
    Arguments:
    <filename>: any filename. Works also with relative paths.
    Examples:
    #smm file readasmud fight1.log
    	    


#sleep

Syntax:
#sleep <seconds>
Sends SMM indicated number of seconds sleeping.
Examples:
#sleep 3
	

#substitute, #unsubstitute

This command falls into the category of commands parsing MUD text. Therefor you might want to read this first.

With #substitute you can change the text received from the MUD. All matching substitutions will be replaced.

Syntax:
  1. #substitute
  2. #substitute <level>
  3. #substitute <level> <pattern>
  4. #unsubstitute <level> <pattern>
  5. #substitute <level> <from> <to>
Arguments:
  1. #substitute
    Shows all defined substitutions.
  2. #substitute <level>
    Shows all defined substitutions of level <level>.
  3. #substitute <level> <pattern>
    Shows all defined substitutions of level <level> matching <pattern>.
  4. #unsubstitute <level> <pattern>
    Removes all substitutions of level <level> matching <pattern>.
  5. #substitute <level> <from> <to>
    Defines a substitution of level <level>. Every <from> in the received text is replaced by <to>.
Examples:
#substitute 5 kill "!!! KILL !!!"

If the MUD now sends you:       "You kill Dumbo."
This text will be replaced by:  "You !!! KILL !!! Dumbo."
	

#tab, #untab

These commands build up the tab-list, which is used for tab-completition. Please follow this link for more information about tab-completition.
Syntax:
  1. #tab
  2. #tab <tab expression>
  3. #untab <tab expression>
Arguments:
  1. #tab
    Shows all tab expressions in the tab-list.
  2. #tab <tab expression>
    Adds one more expression in to the tab-list.
  3. #untab <tab expression>
    Removes one expression from the tab-list.
Examples:
#tab Grogump
#tab phalanx
#tab "I was here!"
#untab phalanx
#tab
	

#tickon, #tickoff, #tickreset, #tickremall, #ticksize, #tickaddcommand, #tickremcommand, #tickshow, #tickshowall

SMM has a clock -- the ticker -- counts down the seconds starting from a startvalue. It does it over and over again, ticking each second. You can assign each second a command, which will be executed when its time to do so.
Syntax:
  1. #tickon
  2. #tickoff
  3. #tickreset
  4. #tickremall
  5. #ticksize <second>
  6. #tickaddcommand <second> <command>
  7. #tickremcommand <second>
  8. #tickshow <second>
  9. #tickshowall
Arguments:
  1. #tickon
    Starts the ticker.
  2. #tickoff
    Stops the ticker.
  3. #tickreset
    Resets the counter of the ticker.
  4. #tickremall
    Removes all commands from the ticker.
  5. #ticksize <second>
    Sets a new start value for the ticker.
  6. #tickaddcommand <second> <command>
    Adds a command to the ticker. This command will be send to the SMM parser.
  7. #tickremcommand <second>
    Removes a command from the ticker.
  8. #tickshow <second>
    Shows the tickcommand defines for <second>.
  9. #tickshowall
    Shows all defined tickcommands.
Examples:
If you want to make friends yourself in an automated way:
#ticksize 300
#tickcom 50 "wakeup"
#tickcom 40 "say Hey, Dumbo. Go home"
#tickcom 30 "say I could kill you easily!"
#tickcom 20 "say I told you: GO AWAY!"
#tickcom 0  "sleep"
#tickon
	
Or this one, which makes more sense(?):
#ticksize 300
#tickcom  0 "eat iron ration; drink horn" 
	

#variable

Defines, sets, shows, deletes variables.
Syntax:
#variable <name> <value>
or: #variable <pattern>
or: #variable
or: #unvariable <pattern>
  1. #variable <name> <value>
    Defines a variable with given name and value, or sets its new value.
  2. #variable <pattern>
    Shows all variables matching the pattern (glob style).
  3. #variable
    Shows all variables.
  4. #unvariable <pattern>
    Deletes all variables matching the pattern (glob style).
Arguments:
<name> Must start with a letter [a-z][A-Z] and can continue with letters [a-z][A-Z] or numbers [0-9] in any order.
Examples:
#variable a1 1
#variable a2 1
#variable a*
#unvariable *2
#variable
	

#while

Syntax:
  1. #while <expression> <commands>
    Evaluates <commands> as long, as <expression> is true (not 0).
Arguments:
<expression> is exactly processed as the #math expression. You might want to look there too.
Examples:
#variable i 0
#while { $i < 5 } { #showme "$i. turn!" ; #incr i }
	





Last modified: Sun Dec 19 20:09:01 CET 1999