[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Script file translation

Script file translation

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


Posted by Spoke   (2 posts)  [Biography] bio
Date Fri 17 Oct 2003 10:18 PM (UTC)
Message
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.
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #1 on Fri 17 Oct 2003 10:51 PM (UTC)
Message
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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 18 Oct 2003 11:00 PM (UTC)
Message
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.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


12,072 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]