Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ New feature for scripting - function argument templates

New feature for scripting - function argument templates

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Wed 11 Aug 2010 08:13 AM (UTC)

Amended on Wed 11 Aug 2010 10:21 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


5,090 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

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