[Home] [Downloads] [Search] [Help/forum]

Release notes for MUSHclient version 3.35


Version 3.35

Released on 06 Apr 2003

1. Changed the way the script routines world.Tell and world.ColourTell work slightly, so that they no longer refresh the screen afterwards, unless they cause a new line (eg. by wrapping the page). This substantially increases the speed of scripts that do multiple colour changes on a single line, and reduces flicker.

2. Fixed a bug where if you double-clicked on a word (or paragraph) to select it, the output window would not be automatically paused, which was inconsistent with the behaviour if you clicked-and-dragged.

3. Fixed a problem where if you made an alias to call a script which detected selected text in the output window (eg. select a name, and make an alias to send "hello x" where "x" was the selected name), the script routine GetSelectionStartLine (and similar) would return zero, because the alias would have caused the output window to un-pause, which cancels the selection. What happens now is that the script runs first, before the window is unpaused, so the selection is still valid.

4. Fixed a bug where if you set the output window to "auto-resize" and it was not the active window, it would resize itself to strange values whilst in the background (see bug #400). The auto-resize is no longer done if the window is not the active window, the world is closed, or the window is minimized.

5. Change the way that command-stacking works, to resolve various problems with scripts with a command-stacked line (which send stuff to the MUD) executing in the wrong order.

See:

http://www.gammon.com.au/forum/?bbsubject_id=2115

and:

http://www.gammon.com.au/forum/?bbsubject_id=2375

Command stacking has now been moved up the precedence for command evaluation, so that - if active - it is like typing each part individually. For instance, if the command stack character is ";", then typing this:

go north;eat food

would be exactly the same as entering "go north" and "eat food" as two separate commands, including if those commands happened to be aliases.

However there are two exceptions ...

a. If auto-say is active, then command stacking is disabled, even it the "auto-say override" sequence is used. In other words, activating auto-say disables command stacking, no matter what you type.

b. If the start of the command is the scripting prefix, then command stacking is disabled (including for multi-line commands). This lets you use the command stack character in scripts without too much mucking around.

Note that the command stack character can be used in a command line by doubling it. For example, if you type: "say I laugh;; I sigh" then "say I laugh; I sigh" will be sent to the MUD. This behaviour was also in previous versions.

6. If you have auto-say active and type multiple lines (eg. line 1 <Ctrl+Enter> line 2) then each line will have the auto-say prefix prepended, not just the first one.

7. If an alias calls a script, and does not have anything in its "send" box, it no longer sends a blank line to the MUD.

8. Now have a script routine world.Execute - this lets you execute a command as if you had typed it. Thus, an alias script could call another alias, for instance.

The major reason this wasn't implemented in the past was because of worries about nested aliases going into a loop, however MUSHclient will guard against that by counting nested calls. An attempt to nest calls to Execute above 20 times will result in an error.

The argument passed to Execute would be processed exactly as if you had typed it in, except that:

a. It won't be stored in the command history (as you didn't actually type it)
b. It won't unpause paused output.

Example (where # is the speedwalk prefix):

world.Execute "#4n 5s; eat food; unlock door"

This example shows executing something that includes a speedwalk and command stacking.


9. Triggers can now send their "send" text to "execute".

This means you can make triggers do things directly (eg. call an alias, speedwalk, or a script) without having to write a script to do it (in a separate script file). The executed text goes through the normal command parser, so it is influenced by settings for auto-say, speedwalking, script prefix, command stacking, and so on.

For example, the "send" text might be:

/world.SetVariable "target", "%1"
world.SetVariable "direction", "%2"
world.ColourNote "white", "red", "Mob %1 is now moving %2"

The initial slash in this example causes the entire text to be interpreted as an "immediate" script command. This example shows how you could set 2 variables in a trigger, and note something on the output window, without having to modify your script file.

You might want to be cautious using this feature if you are likely to change your command options around (eg. change the command stack character, or the scripting prefix). For example, setting a whole lot of triggers to send VBscript to be executed would fail if you change the scripting language to JScript.

10. Alias matching has now been simplified (internally). Previously regular expression aliases went through one match routine, and "normal" aliases went through a different one.

Now, a "normal" alias is internally converted to a regular expression, and then all aliases go through the regular expression matcher. This is similar to the change made a while back for triggers, which already use this technique. The advantages are simplicity, and speed.

It is conceivable that certain very complex aliases (with lots of wildcards) might match differently, but hopefully no-one uses really complex aliases that have this problem.

11. Triggers, aliases and timers now share a consistent interface for what to do when they match/fire. In each case there is a "send" box, and a "send to" combo-box. The "send-to" box (which previously only existed for triggers) lets you choose to send the send text to one of:

* world (the MUD)
* command (the command window)
* output (directly to the output window)
* status (to the status line)
* notepad - new (create a new notepad window)
* notepad - append (append to a notepad window)
* log file (directly to the log file)
* notepad - replace (replace an existing notepad window)
* world - speedwalk delay (queue for delayed send)
* variable (set a variable)
* execute (execute through normal command parser)
* speedwalk (send to world after converting speedwalk string)
* script (execute as a script)

This replaces a few checkboxes that existed in earlier versions (eg. the speedwalk checkbox for aliases), and greatly expands the functionality of aliases and timers. Now, for instance, an alias can directly execute an internal script function, so you could make an alias enable or disable a trigger group.

The "send to speedwalk" and "send to script" functions are new, and are designed to allow you to do scripts and speedwalks from triggers, aliases and timers, without having to worry about what the scripting or speedwalking prefix is.

12. Aliases can now have a sequence number, like triggers, so you can specify the sequence for alias evaluation.

13. Command evaluation has been largely rewritten, with somewhat clearer rules. :)

In previous versions multiple aliases matched in a rather idiosyncratic way, namely that the result of one alias match could be rematched to give a second result, and so on, however the order in which these rematches occured was not defined (it depended on the order the aliases ended up in an internal list).

What now happens is this:

a. When you type a command, if auto-say is active, then some initial checks are made to see if auto-say applies. If it passes those checks (see auto-say configuration screen) then the command is broken up into lines (at the newline character), the auto-say prefix is prepended to each line, they are sent to the MUD, and command processing terminates.

b. If auto-say is not active, or does not apply to this particular case, then the world.Execute function is called, with the command passed to it. If backslash sequences are supposed to be translated (see command configuration window) this is done now.

Once the execution phase is complete the following things are then done (in other words, they are not done if you call world.Execute from a script, trigger, alias or timer):

i. The command is added to the command history
ii. If "repeat last command" is enabled, the command is replaced in the command window
iii. If "unpause on send" is set the output window is unpaused.


------ world.Execute processing starts here ------>

c. The "command execution depth" is incremented by one. If it exceeds the limit (currently 20) the execution terminates with an error status (which can be detected in a script).

d. The start of the command is checked for the "scripting prefix" - default is the "/" character (this is only done if scripting is active). If it is detected the result of the line(s) are passed to the script engine for execution. Then the "command execution depth" is decremented again, and processing is complete.

e. Otherwise the command is now broken into individual lines at the command-stack character, excepting that two command stack characters in a row are replaced with a single command stack character. For example, if the command stack character is ";" and assuming \n represents a new line, this might happen:

command: south ; east ; say I go;; I eat; drink \n sigh
replacement: south \n east \n say I go; I eat\n drink \n sigh

Note that you can put multiple lines into a command by simply using the newline character (eg. typing Ctrl+Enter). Using the command stack character is simply another way of achieving the same result.

f. The resulting command (with command-stack characters replaced by newlines) is then broken into individual lines. Note that there is always considered to be at least one line, so entering a blank command will result in one newline being sent to the MUD. Each line is then processed in the following way ...

----- Start of processing for each individual command line ----->

g. Each plugin (if any) is given a chance to evaluate the command line ("OnPluginCommand" script subroutine). If it chooses to reject that line, then processing for that line terminates.

h. If the line is totally empty a blank line is sent to the world.

i. Otherwise, if the speedwalk prefix applies to this line, then the speedwalk is evaluated and sent to the world.

j. If no speedwalk prefix was detected the line is scanned for global aliases. If one matches the action specified is done (ie. the "send" text is sent to the "send to" location). If "keep evaluating" was set for that alias then further aliases will be scanned (for the same text, not the output from the previous alias).

k. This process is repeated for the aliases in all plugins.

l. If no alias was found at all, then the text is sent to the world "as is" - note this is the normal case where something you type is just an ordinary command for the MUD.

m. If one or more aliases were found, the alias scripts are now executed. Note that the scripts are executed after the alias "send" text has been sent.

<----- End of processing for each individual command line -----

n. The "command execution depth" is decremented again, and processing is complete.

You can see from this description that it is possible to have speedwalks mixed with non-speedwalks, but not scripts mixed with non-scripts. For instance, assuming "#" is the speedwalk prefix:

eat food; # 3w 2s; enter shop <--- OK
eat food; /world.note "hello" <--- NOT OK

14. The "copy as HTML" function now respects the background colour as well (eg. for inverse text) by using the HTML <span> tag. It also outputs the <font> tag as well, so that browsers that don't support <span> will still work. This is not an option, browsers that don't like <span> should just ignore it.

15. When using AddTrigger, AddAlias, or AddTimer if the item being added is marked as "temporary" the world document is no longer marked as "modified" (to be saved) as temporary items are not saved to the world file anyway.

16. Added new script routine "DoAfterSpecial" - this is intended to be a simple interface to do some generic thing after x seconds (similar to DoAfter). However you can specify a "destination" for the "send" text, namely:

0=world, 1=command window, 2=output window, 3=status line, 4=new notepad, 5=append to notepad, 6=log file, 7=replace notepad, 8=queue command, 9=set variable, 10=parse as command, 11=speedwalk, 12=script

For example, you could use it to enable a trigger group after 5 seconds, like this:

world.DoAfterSpecial 5, "EnableTriggerGroup ""mygroup"", 1", 12

In this example the last argument (12) means send the command to the script engine after 5 seconds. The argument to EnableTriggerGroup has double quotes, because it is quotes within quotes.

This lets you do things that involve simple scripting at some future time, without having to go to a lot of trouble writing script routines.

The general syntax is:

world.DoAfterSpecial Seconds, Text, Where_To_Send_It

17. Fixed bug where if you had some "menu" alias items, and control-clicked in the *command* window the menu would appear, but when you selected an item it would not be acted upon.

18. Fixed bug where if you had an alias with wildcard expansion (eg. %0) in the alias "send" text, and the alias was called from a menu, the strings %0 through to %9 would literally appear in the send text. Now they are replaced by the empty string. This is because when calling an alias from a menu, you didn't really type anything in, and thus the wildcards are, effectively, not supplied.

View all MUSHclient release notes

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]