Scripting in MUSHclient

by Melanchthon

Back to Mechanic's Corner.

Melanchthon2005-01-17 07:41:32
I'm converting from Zmud to MUSHclient, and wonder if any scripting laguages supported by it are better suited to mudding than the others.

I'm not proficient in any of them, so I will be learning from scratch whichever I end with.
Unknown2005-01-17 23:50:50
The one that you know best. If you have no knowledge at all of any of them, Python is a good choice - it's fairly easy to learn and is useful in the Real World as well.
Unknown2005-01-18 00:14:33
Huh? I'm one of the few MUSHclient users around here, and the fact that I use it can tell you how good it is. I know nothing of these 'languages' you speak of. Ask Ethelon, he seems to know what he's doing in MUSHclient.
Unknown2005-01-18 00:44:06
I knew Javascript and VBscript, went with Javascript because it's what I knew most of and haven't looked back. It basically comes down to what you know.
Ethelon2005-01-18 01:57:37
Well, Python is fastest from what I can tell and VBscript is easiest to write Sub Routines in....and is about as fast as Python scripting. Either way, welcome to Mushclient, always better and faster than Zmud!! Feel free to PM me with what ever questions you may have, I'm sure I can answer them or assist somehow
Unknown2005-01-18 01:58:56
Do you know what order of magnitude is the speed difference between the languages? I'd be tempted to change if it's big enough.
Ethelon2005-01-18 02:18:50
I can't find the information on speeds, but over all I would stick to using VBscript because it's the most common in scripting with Mushclient it seems. Also, here is a speed test that was run years ago, but I'm told a new one will be updated soon...it's interesting to see what clients are actually fast.

http://www.gammon.com.au/mushclient/benchmarks_old.htm


Want to run a Benchmark test yourself? Go here and follow the directions:

http://www.gammon.com.au/mushclient/benchmarks.htm


Also, another EDIT to add this, Zmud prrforms it's own Benchmarks and here is where you can find them....compare it to the benchmark test from the URL above this

http://www.zuggsoft.com/zmud/bench2.htm
Unknown2005-01-30 12:57:35
I only tested Vbscript and Python, and from what I got, the conclusion was that Python exceeds vbscript by about 20-150% on most operations involving math and strings, however vbscript is about that much faster when using Mushclient callbacks. So if you use a lot of callbacks, then vbscript is going to be faster, if you use them not so often then Python will be in the lead. Overall though, Python is much better, since it makes many things much easier than vbscript, and gives far more options once you get to know it. Learning either is pretty simple and boils down to learning basic syntax, as long as you learn some general programming concepts beforehand, like what is a variable (really), what is scope, what is the difference between a function and a procedure, etc. The best way to learn is to read through the docs for the language and then start scripting, asking questions whenever you don't understand something.
Unknown2005-01-30 13:09:33
I'm using Python on MUSHclient now, and my biggest question is: will I ever be able to make a mini-GUI for Lusternia, with buttons, diagrams, and gauges? Has anyone got a good way for toggling systems on and off or displaying status?
Unknown2005-01-30 15:14:22
Okay, I have another, simpler, request. How can I make a prompt trigger that actually triggers on my prompt and not after I get the prompt AND a newline? In zMUD, there's an option for "prompt" trigger so that it checks when you receive a packet. I haven't found the equivalent in MUSHclient yet.
Unknown2005-01-30 16:39:28
I just posted an example of matching the prompt without using triggers here. Though since you can do "CONFIG PROMPT ADD NEWLINES", you can just as well do it with a trigger. Though in that case you'd have to do it from the world file or invent some way to expose the prompt stats from a plugin.

As for GUI stuff, if you are already using Python then you might take a look at some of the GUI libraries, like wxPython, pyGTK, even the standard Tcl/Tk will do if all you need is buttons. It's not too hard, though you do need some experience with Python to do it.