Page 1 of 1

Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 2:47 pm
by WillFa
Would it be possible to change Mudlet's behavior of trampling LuaGlobal.lua to recreating it if it doesn't exist? (Or more fancy, wrapping the dofile in a pcall and trample if it errors, and moving the file to a .bak extension)

There's a lot of stuff in there that I was going to rewrite; functions that can be more elegant (RGB2Hex, indent), and others that are just wrong (the unnecessary PadHex, table.pickle, saveVars). It makes debugging the code difficult since it gets overwritten every startup.

Also, needing to recompile an exe to update a script seems like it's defeating the main advantage of having a scripting engine: easily modifiable source code.

Re: Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 4:09 pm
by Vadi
Yes, so simply copy/paste LuaGlobal.lua contents into a Mudlet script. Since scripts are read and run after LuaGlobal is, you can easily work with it this way.

(and if you don't like Mudlets editor, well, dofile a call to your own)

Re: Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 4:14 pm
by Vadi
By the way, LuaGlobal is maintained here: http://github.com/babelfish/mudlet-lua/ so if you use git+github, feel free to send the patches in if you'd like.

Re: Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 4:33 pm
by WillFa
Why is there a separate repository for a file that's included in the mudlet/mudlet repo on sourceforge??

Re: Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 4:41 pm
by Vadi
because babelfish maintains it, and then gives a copy to heiko in update time.

Re: Debugging LuaGlobal.lua

Posted: Thu May 13, 2010 10:55 pm
by WillFa
That's what git and branching are for.

Re: Debugging LuaGlobal.lua

Posted: Fri May 14, 2010 12:48 pm
by Denarii
The git for the application doesn't even get updated regularly, Heiko hasn't pushed anything since the 1.1.1 release. I don't really understand why, I like to be able to get the latest sources and compile it myself. :/

Re: Debugging LuaGlobal.lua

Posted: Sat May 15, 2010 1:58 am
by tsuujin
Denarii wrote:The git for the application doesn't even get updated regularly, Heiko hasn't pushed anything since the 1.1.1 release. I don't really understand why, I like to be able to get the latest sources and compile it myself. :/
Yes, I've complained about this myself.