New feature for scripting - function argument templates

Posted by Nick Gammon on Wed 11 Aug 2010 08:13 AM — 1 posts, 5,356 views.

Australia Forum Administrator #0
Version 4.57 of MUSHclient introduces a new feature to help script-writers (my spellchecker picked me up on the word "scripters").

Previously, if you were typing in a script in the inbuilt editor, you could press Shift+Tab to complete a function name (eg. type "colourn" and press Shift+Tab to see alternatives like ColourNameToRGB and ColourNote).

However you still had to look up the help to see what the arguments (parameters) of the function were. Even experienced scripters script-writers probably needed to do that (I know I did!).

The new version automatically fills in a template of the arguments, like this:

Type "addtri", press Shift+Tab, select "AddTrigger" and then you see this:


AddTrigger ( TriggerName , MatchText , ResponseText , Flags , Colour , Wildcard , SoundFileName , ScriptName )


Now you can see all the arguments, in the correct order. All you have to do is double-click on each one and replace it with the things you want for your case. For example, TriggerName "foo", MatchText "Nick tells you *", and so on.

The extra spaces (like, between the commas) is deliberate, so double-clicking selects the word only and not the comma. So you can just type in the correct replacement, and the comma is still there. Or you can press Shift+Ctrl+Right-arrow to select each word, and then type in its replacement.

Hopefully this will make scripting somewhat easier as you can concentrate on the task at hand, and not keep having to bring up the help file for each function name.