Debugging LuaGlobal.lua

Post Reply
WillFa
Posts: 19
Joined: Mon May 10, 2010 4:16 pm

Debugging LuaGlobal.lua

Post 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.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Debugging LuaGlobal.lua

Post 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)

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Debugging LuaGlobal.lua

Post 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.

WillFa
Posts: 19
Joined: Mon May 10, 2010 4:16 pm

Re: Debugging LuaGlobal.lua

Post by WillFa »

Why is there a separate repository for a file that's included in the mudlet/mudlet repo on sourceforge??

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Debugging LuaGlobal.lua

Post by Vadi »

because babelfish maintains it, and then gives a copy to heiko in update time.

WillFa
Posts: 19
Joined: Mon May 10, 2010 4:16 pm

Re: Debugging LuaGlobal.lua

Post by WillFa »

That's what git and branching are for.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Debugging LuaGlobal.lua

Post 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. :/

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Debugging LuaGlobal.lua

Post 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.

Post Reply