Released on 19 Dec 2004
1. Added new world script function "on world save". This is called just before saving the world to disk. You can use this to save internal script variables into MUSHclient variables, so they are saved also.
2. Added new GetInfo selector (65). This is the name of the "on world save" script routine.
3. Added script function SetChanged. This lets you set the "world has changed" flag (or clear it). You could use this to force the world to be saved, if you have changed a script variable, that requires to be saved to disk.
4. Changed registration process to no longer generate encrypted registration forms for emailing. Most people use the online registration now, so from this version on, the only registration method offered will be by the online method.
5. Added a warning message in the output window if a trigger, alias or timer tries to call a script function and it does not exist, or had an earlier error. This is to avoid the irritation of trying to debug a trigger script, without realising that it is not being called at all. This warning is optional, there is a checkbox in the scripting configuration to turn it on or off.
6. Added a couple more entries to the help file, for things which were added recently, like the Lua section of the global preferences.
7. Script errors are now shown in FixedSys font to make them easier to read. The script error dialog is now larger.
8. If script errors have a newline in them, they are converted to be carriage-return/newline (in the error dialog box) to make them easier to read.
9. Lua script errors now include a stack traceback, like this:
[string "Script file"]:548: attempt to perform arithmetic on local `x' (a nil value)
[string "Script file"]:548: in function `bar'
[string "Script file"]:544: in function `foo'
[string "Script file"]:558: in function `myalias'
What this is basically saying is that the error was in "bar" function, which was called from "foo" function, which was called from the "myalias" function in the script file (in each case the line number is given).
This traceback helps work out where an error came from, in the case of complex nested calls to functions. If you don't like it for some reason, you can set the global variable _TRACEBACK to nil, to suppress it.
10. Fixed bug where when calling a Lua MXP script routine for a start tag, the routine would be called twice, the second time with all arguments set to nil.
11. Added the following MXP keywords to the table of recognised elements: gauge, stat, expires. Although MUSHclient does not handle them directly, they no longer raise an error. A plugin script can detect them and react appropriately.
12. Added recognition for MXP <!ENTITY> keywords: "desc, private, publish, delete, add, remove". Most of these don't do anything, however they suppress warning messages. The keywords "delete" and "remove" remove the named entity from the entity list.
13. Added menu item "plugins page" to the Help menu, for quick access to MUSHclient plugins on the Web.
14. Added support for "tabbed windows". You can have a tab per open window that appears at the top or bottom of the main MUSHclient frame. This is set in Global Preferences -> General. After changing the setting you must close and re-open MUSHclient for it to take effect.
Extra features offered by the tabs:
* left-click a tab to activate that window
* double-click a tab to maximize that window
* right-click a tab to open a context menu that lets you do things like close the window
15. Added colour swatches to the Display -> Text Attributes dialog box.
16. Added extra buttons to the Custom Colour configuration:
* Defaults - revert to MUSHclient defaults
* Random - choose all colours randomly - use this for some funky colours
* Swap - swap foreground and background colours
* Lighter - make all colours lighter
* Darker - make all colours darker
* More colour - add to colour saturation for all colours
* Less colour - reduce colour saturation for all colours
17. Added extra button "Random" to the ANSI colour configuration. This lets you choose all your colours at random for some colourful effects. Why bother agonising over a colour scheme when you can get a random one? :)
18. Added "random" button to colour picker to let you choose a colour at random.
19. Added a "Lua" field to the colour picker, which shows the value of the currently-selected colour as a straight 32-bit number (eg. rosybrown is 9408444). This is handy for programs that do not have hex constants available.
20. The colour picker (and colour swatches in general) now recognise a straight 32-bit number as a possible colour (for pasting into the picker or swatch). Eg. if you have 9408444 on the clipboard, then you can paste that into a colour swatch (as colour rosybrown). The number must be an unsigned number in the range 0 to 0xFFFFFF.
21. Added support for PCRE "callouts" in the Lua regexp matching. I'm not totally sure how useful this is, but as it is documented in the PCRE documentation it seemed a good idea to have access to it.
Basically, it lets you add a "callout" to a regular expression, like this:
re = rex.new ("([0-9]+[a-z]+(?C1) ?)+")
function f (a1, a2, a3, a4, a5, a6, a7)
print ( "callout #", a1)
for _, v in a2 do
print ("args = ", "'" .. a3 .. "'" , a4, a5, a6, a7)
end -- f
a, b, c =re:match ("14hp 24m 36mv", 1, 0, f)
print (a, b)
callout # 1
args = '14hp 24m 36mv' 1 5 0 -1
callout # 1
args = '14hp 24m 36mv' 1 9 1 1
callout # 1
args = '14hp 24m 36mv' 1 14 1 1
The syntax "(?C)" with an optional number in the range 0 to 255 after the C, indicates a callout. When this is reached during pattern processing the nominated function is called with 3 arguments:
1 - callback number (default is zero if not specified) eg. (?C1) would return 1
2 - match vectors - an array of numbers representing the match positions as pairs (eg. 1, 3, 4, 8)
3 - subject string - the string supplied to be matched against
4 - start match position - one-relative
5 - current position - one-relative
6 - highest captured substring
7 - last captured substring (-1 if none)
In the example above the pattern eventually matches the whole string, but during the process it returned the substrings (14hp, 24m).
The callout function can optionally be added as the last argument to the match, exec or gmatch functions for a compiled regular expression (in Lua).
The callout function returns an integer. If the value is zero, matching proceeds as normal. If the value is greater than zero, matching fails at the current point, but backtracking to test other possibilities goes ahead, just as if a lookahead assertion had failed. If the value is less than zero, the match is abandoned, and the regular expression is assumed to have not matched.
22. Added new notepad menu item: Send To Script.
This lets you send the entire notepad window (or the selected text, if any) to the script engine for the related world. This lets you debug scripts in a friendlier environment than the immediate window, if you are doing a lot of script testing.
23. Added script function UdpPortList. This returns an array of all UDP ports listened to by the current world. You could use this (and also iterate through all open worlds) to discover a port number that is *not* in use.
24. Fixed problem where you could not save notepad windows. This was because of a change made in version 3.57 where the notepad "title" was changed from Text1, Text2 and so on to the title of the window (eg. "Notepad: SMAUG"). If this had special characters in it (like space, colon) which it would, by default, then the save routine would quietly fail.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )