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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multiple Scripting Languages

Multiple Scripting Languages

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


Posted by Nickpick   (24 posts)  [Biography] bio
Date Mon 08 May 2006 05:07 PM (UTC)
Message
Ok, I'll keep it short and simple. How can I switch from VBScript to Lua without having to rewrite all my old scripts.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Mon 08 May 2006 06:13 PM (UTC)
Message
I think that the very short answer is: you can't. Unless you find a tool that will convert VBScript to Lua, you will have to rewrite your scripts.

It might be possible to run scripts of different languages, though; Nick would know for sure. That way all your old scripts would be in VBScript and your new ones in Lua.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Mon 08 May 2006 10:32 PM (UTC)
Message
My suggestion is that you migrate your existing scripts to plugins, which can have VBscript as the language, and develop new ones in Lua. This is pretty easy to do.

Failing that, I converted the chat plugin from VBscript to Lua, they are not that dissimilar. There are differences, sure, but depending on how many scripts you have it isn't too bad.

Example:

VBscript:


If blah Then
  blah blah blah
EndIf


Lua:


if blah then
  blah blah blah
end -- if


See this forum post:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6211

I discuss there the issues of correct capitalization of internal function names. For example in VBscript you would get away with using world.note, in Lua it has to be world.Note.

You could even compare the chat plugin before and after converting from VBscript to Lua. See the plugins page:

http://www.gammon.com.au/mushclient/plugins/

If you look at those you can see the differences. I kept the basic structure of the plugin the same.

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


11,712 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]