I've installed lua 5.1 onto my own system to get luarocks for easier installation of libraries However, mushclient exploded the next time it was restarted because it was using my system's lua interpretor.

Additionally, after removing the path to lua.exe from my system path, it was still using the LUA_PATH and LUA_CPATH variables meant for my local lua install. Is there a way to stop this from happening?

I believe Victorious has installed some other distribution of Lua.exe somewhere else, and that MUSHclient is picking up this other installation's search paths (which I assume are set as environment variables?) instead of looking only inside the MUSHclient folder, and Victorious wants MUSHclient to only look inside its own folder. I have no thoughts on this, as I work exclusively within the MUSHclient folder.

Yeah, Fiendish described my situation perfectly. Mushclient is picking up on information meant for my own locally installed lua distribution (outside mushclient). Apologies for not being clear. Will post errors soon, if that helps - but its just the standard error messages you get when require fails to find a module, showing you all paths its tried.

I think I mean Lua.exe, though presumably with its own Lua.dll next to it. I think the only bit that matters here is that Victorious wants MUSHclient to never search for includes outside of its directory no matter what the operating system says. Which, I have to be honest, seems both extremely weird but also contextually pretty reasonable. This is where I go ¯\_(ツ)_/¯

What is the "it" in that sentence? I think we are talking at cross-purposes. Nothing has "exploded". You are using your own DLL which appears to be respecting your own environment variables. I'm not sure what it is doing that it shouldn't be.

What is the "it" in that sentence? I think we are talking at cross-purposes. Nothing has "exploded". You are using your own DLL which appears to be respecting your own environment variables. I'm not sure what it is doing that it shouldn't be.

Victorious wants MUSHclient's Lua DLL to not know about the LUA_PATH system environment variable. The "own DLL" here is, as I understand it, somewhere else, and not associated with MUSHclient.

So there's...

C:\MUSHclient\Lua5.1.dll

And there's...

C:\SomeOtherPath\Lua5.3.dll

which is used by

C:\SomeOtherPath\Lua5.3.exe

And there's...

LUA_PATH=C:\SomeOtherPath\libs;C:\SomeOtherPath\lua

or whatever

And the complaint is that C:\MUSHclient\MUSHclient.exe with its linked C:\MUSHclient\Lua5.1.dll is digging around in C:\SomeOtherPath instead of staying confined to C:\MUSHclient

And the reason for the complaint is that C:\SomeOtherPath\lua has code for Lua 5.3 that doesn't work in Lua 5.1, or maybe uses a different library called "bit" which seems to cause a name collision with MUSHclient's included bit library, or some other problem of a similar nature.

But ... if the defines there are the same as your own compiled defines would be, why do they need to be changed? In any case, since the Lua code is not compiled into MUSHclient, it won't reference those defines anywhere.

Nowhere in MUSHclient is LUA_PATH referenced or changed. It is just something in luaconf.h which is used when compiling Lua. Now if you use your own Lua compile they won't be used at all.

It sounds like Victorious may need to set LUA_PATH early on in using Lua, for example in Global Preferences -> Lua -> Preliminary code.