
Index

I want to point out this matter, as I chose this implementation
after thinking well about it.
I hope you understand my arguments and dont miss "modern days"
inputs.
It would have been much easier to provide "fancy" alias/action/etc.
inputs and indeed I wanted to do so, until I recognized that those
"fancy" inputs arent powerful! As soon as I tried to make them more
powerful, they got very unhandy in usage or become naturally an editor:)
There is an easy explanation for that: In really powerful
configurations aliases, variables, action, userinterface, etc.
go hand in hand! e.g.:
#variable bag backpack
#alias wb {wear $bag}
#alias rb {remove $bag}
#alias pb {put $stuff $bag}
#alias l {#variable stuff $0 ; look at $stuff}
l torch
pb
This is only a very basic example, but it well points out the matter. You dont want
to have the aliases and variables scattered around in different user interfaces.
There are three different types of scriptfiles:
- SMM++ scriptfiles,
- session scriptfiles and
- user scriptfiles.
- SMM++ scriptfiles
-
are distributed with the SMM++ package. You cannot
edit, save or delete them. They are intended to be examples of
how SMM++ can be used. You are encouraged ot send in your scripts
to be included into the distribution. Just export your script to a file and
send it to the author. So others can profit from your work too!
(You can load these scriptfiles into your session with the
command 'evalsysfile', please refer to the commands section of
the documentation.)
- Session scriptfiles
-
are loaded at start of a session. Here you
can store your configuration on per session basis. Of course
they are saveable, but (of course) not deletable. If you dont
want a configuration leave the file empty. If you delete a session,
all session configuration (including its scriptfile) is deleted.
- User scriptfiles
-
close the gap between the SMM++- and session script files.
Here you can store your more global configurations and load them
into all session scriptfiles that need those configurations.
e.g. that means that many sessions can share the same scriptfiles.
It is natural that you can create and delete all these scriptfiles
as you want to.
E.g. general aliases like '#alias ga "get all"' are best kept
here,..
(You can load these scriptfiles into your session with the
command 'evaluserfile', please refer to the commands section of
the documentation.)
In earlier versions of SMM any command had to be completed in a
single line, e.g.:
#alias ga "get all"
This is reasonable for short commands like the example above, but
as soon as you develop bigger script (with control structures,
etc.) this approach gets unhandy, e.g.:
#alias checkme { #showme "Your status:" ; #if {$hp>50} { #showme "You are in great condition!" } elseif { $hp>30 } { #showme "You are getting exhausted." } else { #showme "!!! You NEED a rest !!!" ; #showme "... even a bunny can kill you in this shape! } }
Multiline commands were introduced in SMM++ 4.1. As long as a
bracket ('{') is not closed the next line is appended to the
last read in line. This continues until the bracket has been been
closed ('}').
All spaces and tabs are removed from the beginning and the end of
the line before concatenating the lines!
Empty lines are skipped (-> no <Return> is send to the mud).
It is still required, that a string is begun and ended on the same
line. (If this is a too stringent restriction, please notify me.)
Concatenation of lines is done while reading the file! The
SMM parser still cannot handle multiline commands.
So you have to make sure, that after concatenation you get the
command you wanted to have.
Especially dont forget to provide
all the needed semicoli (';'), if you have separate commands!
You can write the above example now the follwing way:
#alias checkme {
#showme "Your status:" ;
#if { $hp>50 } {
#showme "You are in great condition!"
} elseif { $hp>30 } {
#showme "You are getting exhausted."
} else {
#showme "!!! You NEED a rest !!!";
#showme "... even a bunny can kill you in this shape!
}
}
Did you pay attention to the semicoli? But also keep in mind: if you provide
unnecessay semicoli, you will send <Return>'s to the mud, which
might not what you want.
From the Configuration menu choose
Scriptfile Editor.
The editor will show up and you can enter your input.
At any time, you can save your text or
close the editor with cancel.
You can launch or close the editor at any time. It doesnt interfere
with any other actions. If you start a session it will load
whatever is saved on disk. If you close the editor and launch it
later again, you can continue exactly where you stoped your work.
When designing the editor I had always emacs in mind; so most
concepts are taken from there (though emacs is of course much better than
the SMM scriptfile editor,.. If you miss some needed functionality
please notify me. Thanks!).
Unlike emacs you can only view one buffer at a time: the actual buffer.
Buffers
One of the concepts is the buffer concept. Each buffer has a
corresponding file and vice versa. If you load a file, its
corresponding buffer is created containing what is in the file.
If you save a buffer, its content is written to the file.
The buffermanager keeps track of all the seperate buffers loaded.
The buffer belonging to the SMM++ scriptfile 'welcome' will always
be in memory.
Editor Menubar
Here follows a description of the menubar entries. Most actions can
be invoked via key sequences; they are denoted beneath the entry.
- File
- Buffers
-
Invokes the buffermanager. You can switch to
another buffer you want to edit by clicking on it. The
buffers are separated in three classes which correspond to
the three flavors of scriptfiles.
- SMM++ scriptfile
-
A chooser will pop up, in which you can choose a SMM++ scriptfile or
cancel this action.
If a file is choosen it will be loaded into its buffer.
If the buffer is already loaded it will not be reloaded,
but becomes the actual buffer.
You cannot edit this buffer, but
have a look at it or copy parts of code, if you want to.
- user scriptfile
-
A chooser will pop up, in which you can choose a SMM++ scriptfile or
cancel this action.
>br>
You can also choose to create a new file: Enter a file
name in the entrybox and press the 'new'-button. The
filename must begin with a lower case character (a-z) and
continue with lower case (a-z) or numeric (0-9) characters.
If the buffer is already loaded it will not be reloaded,
but becomes the actual buffer.
- session scriptfile
-
A chooser will pop up, in which you can choose a session scriptfile or
cancel this action.
If a file is choosen it will be loaded into its buffer.
If the buffer is already loaded it will not be reloaded,
but becomes the actual buffer.
If a session is started ('load' or 'connect' from the
session manager), its session scriptfile is executed as
first.
- Save
- Saves the actual buffer.
- Kill
- Removes the actual buffer from memory (and
buffermanager). The file itself stays untouched!
It is a "save" action, if you dont want your changed
(since the last save) should take effect.
- Delete
- Removes the actual buffer from memory
and removes the file too! This of course
only works for user scriptfiles. This action may be
desasterous,..
- Import
-
You need a editable buffer as the actual buffer. A
filechoose will pop up and you can choose a file. The
contents of this file will be inserted at the text cursor
position. You can use this function to import scriptfiles
of others into your SMM scriptfiles.
- Export
-
A filechooser will pop up and you have to choose a file,
into which the actual buffer should be saved. After saving
you can e.g. send this file to your friends or to SMM++ to
be included into the distribution. If accepted, it will
became a SMM++ scriptfile. You are strongly encouraged to
contribute! Thanks a lot in advance!
- Close
-
Closes the editor window (doesnt delete it!). This is a save action. If you
restart the editor, you continue to work where you have
stopped. If SMM++ had been stopped meanwhile, you loose
of course all your not saved changes.
- Edit
Remark:
- You can select pieces of text by clicking into the text and
keeping the mouse button pressed and drag the mouse to some
other point.
- The editor has its own clipboard.
- Undo
-
Undoes your last action(s). The undo buffer has a length
of 50. The implementation of Undo may not be 100% save
yet! So dont depend too much on it. If you find bugs,
please notify me! Thanks!
- Redo
-
Redoes undoes,..
- Cut
-
Cuts the selected text into the clipboard.
- Copy
-
Copies the selected text into the clipboard.
- Paste
-
Inserts the text in the clipboard at the text cursor position.
- Sys.-Paste
-
Inserts the text in the system-clipboard at the text cursor position.
- Clear
-
Deletes all selected text.
- Select all
-
- Unselect all
-
- Option
Quite obvious,.. if not, then I guessed wrong and then please!
tell me, so I can write some docu.
- Find
- Find button
-
You enter a find expression into the find entry, choose
find options and press the 'Find' button. The found text
piece(s) is (are) marked.
- Clear button
-
The 'Clear' button removes all find marks and clears the
'Find' and 'Replace with' entries.
- Replace button
-
If you press the 'Replace' button all found marked text
pieces are replace with whatever is in the 'Replace with'
entry. If you leave it empty you will remove all found
marked text.
After replacement took place another find is initiated.

Last modified: Sun Dec 19 20:08:14 CET 1999