Hey, that was fun! First time I've got luacom working.
First, if anyone is looking for it, try here:
http://www.tecgraf.puc-rio.br/~rcerq/luacom/
Now comes the tricky bit <grin>.
In that archive you will find a heap of files, however you only need 2. In the bin subdirectory, copy these 2 files to your MUSHclient installation folder (ie. the one where mushclient.exe is) ...
luacom-lua5-1.2.dll
luacom.lua
Now, and this is the tricky bit, if you open a command window and type:
depends luacom-lua5-1.2.dll
... you will see that it is missing two DLLs:
LUA-5.0.DLL
LUALIB-5.0.DLL
Now that I did was to copy the existing lua.dll and lualib.dll which is supplied with MUSHclient to make a separate file with those names. That way I have the identical copy of Lua in luacom as in MUSHclient. However I note that they were also supplied with the luacom download so you could probably copy those too.
Now, typing:
require "luacom"
works. What this actually ends up doing is the equivalent of:
dofile "luacom.lua"
So, if the search path is confusing then you could do that instead. However it seems to work for me with the default search path of the current directory, provided that is where you put the files.
Quote:
When are the people that develop for Windows going to get that environment variables are DOS and you can't expect to have one set to the path you need?
The documentation for require states that it gets its path from the global variable LUA_PATH, as follows:
Quote:
To determine its path, require first checks the global variable LUA_PATH. If the value of LUA_PATH is a string, that string is the path. Otherwise, require checks the environment variable LUA_PATH. Finally, if both checks fail, require uses a fixed path (typically "?;?.lua", although it is easy to change that when you compile Lua).
Thus if you want to change the path you could have done this:
LUA_PATH = "blah/?;blah/?.lua"
require "foo"
What that does is substitute "foo" for the question mark, and then try to open:
blah/foo
blah/foo.lua
Having read the luacom manual (a bit) I have to say that it looks pretty cool. Using that, you can use COM objects from Lua, so (on Windows at least) you can go crazy and use COM *and* Lua as well.
|