Stand-alone Lua modules from MUSHclient

Posted by Nick Gammon on Thu 05 Jun 2008 12:56 AM — 3 posts, 18,236 views.

Australia Forum Administrator #0
I have had a query about whether the Lua modules utils, bc, and bit can be made available outside MUSHclient.

  • The bc (big number) library is available here (51 Kb):

    http://www.gammon.com.au/files/mushclient/lua5.1_extras/bc.zip

    That was the original library developed by Luiz Henrique de Figueiredo from the Lua developers. I simply turned it into a DLL, and then later incorporated it into MUSHclient.
  • The bit library was based on bitlib by Reuben Thomas, see:

    http://luaforge.net/frs/?group_id=224

    Specifically Release 20:

    http://luaforge.net/frs/download.php/2075/bitlib.zip (2 Kb)

    Later versions seem to have taken a big jump in file size, however the small one is the one used in MUSHclient.
  • The utils library is a concoction of various useful things I developed, or adapted from other sources. Since the source for MUSHclient is publicly available, you could download that and find the relevant parts.

    The source is available at: http://www.binarygoblins.com/mushclient/bzr/

    A slightly earlier version is here: http://www.gammon.com.au/files/mushclient/src/mushclient_4.13_src.zip

    I don't think the Lua functions have changed much since then.

    Specifically, the file lua_compress.c implements: compress, decompress, hash, sha256, md5, tohex, fromhex, base64encode, base64decode, readdir, and split.

    The file lua_utils.cpp implements: msgbox, umsgbox, inputbox, editbox, choose, listbox, multilistbox, xmlread, functionlist, filepicker, metaphone, info, spellcheckdialog, edit_distance, utf8encode, utf8decode, utf8valid, utf8sub, appendtonotepad, and activatenotepad.

    Some of those utilities require some of the other files in the MUSHclient source, you would need to try them to see what is required.
Amended on Thu 05 Jun 2008 08:21 AM by Nick Gammon
USA #1
This might be exactly what you're talking about, and if it is, I apologize! Anyway, is there a way of getting the MUSHclient Lua interpreter to run outside of MUSHclient? I realize it'd have to open up a telnet screen or something to work right, and it couldn't do things like Send() etc, but it's just the MC Lua seems so much more powerful than the normal Lua codebase. Maybe it's just what I'm used to, but either way, would it be possible?
Australia Forum Administrator #2
Well you can run stand-alone Lua all right, but that is the same as the one you get from www.lua.org.

Yes, it runs in a command window. There is a version available from this site, it is much the same as the precompiled one at:

http://luabinaries.luaforge.net/download.html

As for the "extra features" quite a few of those are available from LuaForge:

http://luaforge.net/

For example, the bit library, hashing and other such things are released as Lua modules. Also LuaSocket, LuaSQL and so on.

Is there a specific feature you particularly wanted? Effectively MUSHclient's Lua is standard Lua with extra libraries built in, basically to support some of the things people wanted to do (like read directories, pop up dialog boxes, etc.).