Script file translation

Posted by Spoke on Fri 17 Oct 2003 10:18 PM — 3 posts, 17,496 views.

#0
I'm new to MUSHClient, I've heard very good comments about it and its powerful scripting support. I have a pretty big file with all my scripts, aliases, etc from the client I used before (tintin++ v1.5) and I would like to know if there are any translators from tintin to mushclient format, of any sort. If not, then where can one find the source of the built in functions MUSHclient uses? so I can write my own translator.

Thank you,

Spoke.
USA #1
Look under http://www.gammon.com.au/scripts/function.php or in the help file for all the internal commands and examples of how they differ between languages. As for stuff not covered in there, check the documentation for each script type. For aliases, timers and triggers, these are seperate from the script language itself and are defined in XML. There should be examples of the syntax of these in the forums or you can try setting a bunch of options in the client and using 'copy' to get better examples to work from.

Basically, a converter to work well would need to create a plugin, not just convert code. The critical issue is making sure that the ID differs, so it doesn't conflict. Otherwise, it is just a matter of using one of the example plugins as a template and dropping the actual code, triggers, aliases, timers, etc. in the right places. The main tricks are:

a) Deciding if you can use the send-to script option to place the code into the triggers, etc. directly. It may be easier to simply generate a sub or function and make it call that.

b) Seperating out the real 'code' from the stuff that Mushclient doesn't consider code. In other words, making sure that the trigger parts are declared as triggers and other stuff ends up in code sections.

c) Most importantly, adjusting the code to deal with the way Mushclient makes the script sleep between calls. most clients seem to run the scripting parallel to processing mud text and the like. This means that you can do things in them that assumes that another trigger or event will occure in the 'middle' of what a chunk of code is doing. With Mushclient, commands sent to the mud from in a script happen 'after' the script has completed, so any code that depends on continuous operation (i.e. a loop) or which assumes that some action will be taken as soon as the command is sent, won't work as expected.

The last issue is damn near impossible to convert, it requires literally changing the order of events and how certain things take place, which goes well beyond simple code conversion.
Australia Forum Administrator #2
For an example of converting zMUD scripts to MUSHclient scripts, see:

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

I believe zMUD uses tintin-like scripting so this should help.

Also, see:

http://www.gammon.com.au/scripts/doc.php

This documents all aspects of MUSHclient, including script functions.