SMM++ Manual | Version 5.0 |
|
6 SMM++ Action System6.1 Processing of the text received from the MUDWhen a MUD sends its output/text to the client, it sends it in one or more packages without caring about the contents. This can cause some minor problems, when the client wants to process the recieved text, as it would process 'sequences' of characters, which could accidentially be broken up. This problem is solved for ESC sequences as they are handeled by the SMM data processing as SMM just waits until the sequence is complete. Problems may arise, if the user wants to process the text: e.g. for action triggers. Let me explain it in detail: Normally you expect the text from the MUD comming line by line . You miss elite guard. Elite guard absolutely destroys you with his hit. ...(and so on in a fight)...Now imagine, that you have an action on 'absolutely destroys you', which lets you flee, but you recieve the text in two packages, splited right after 'absolutely':
Therefor two things are done:
6.2 Action TriggersActions are the only way to parse and change/remove/etc. text, which is coming from the mud. SMM++'s action system is much different from what you might be used to from tintin or SMM versions prior V5.0. So, please, read carefully and make sure that you understand what is going on, because it is a very powerful tool. You can have a look at the system scriptfiles. There you can find examples how to use it; e.g. automap. OK, now lets start,..Defining actions in SMM++ is a two step process:
To tell SMM how to parse the text, you have to write a procedure (former alias, please have a look at proc command). This procedure has to take exactly one argument. Later (i.e. during running) this procedure will be invoked by SMM. Its argument is the line of text, which needs to be parsed. Within this procedure you can do as many comaparision as you want or what ever else you like to do. Lets give an example. Its OK, if you dont understand all the commands; just read on and come back, if you have read the sections tcl commands and smm commands sections.
In the example above you can see three ::return statements. All actions have to return either 0 or 1. If 0 is returned, parsing is not stopped, If 1 is returned, parsing is stopped; this means that no further actions are invoked. The priority has to be a real number. The list of actions is an ordered list: actions are listed decreasingly according their level. Action with the same level have no defined relativ order, which even can change during running. 6.3 Highlightning, Gaging, Substitutions...There is no sepate highlightning/gaging/etc. system in SMM. You have to use the action system and call commands, which can change the last received line. You can delete, change or colorize the text or change the font of it. Please refer to the section Text Commands. |
Selim Issever | <Mudding with SMM++|Contents|Commands: Tcl> |