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 ➜ Multiple Scripting Languages

Multiple Scripting Languages

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


Posted by Nickpick   (24 posts)  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.
Top

Posted by David Haley   USA  (3,881 posts)  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
Top

Posted by Nick Gammon   Australia  (23,140 posts)  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
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,857 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.