Debugging LuaGlobal.lua

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

Debugging LuaGlobal.lua

Post by WillFa » Thu May 13, 2010 2:47 pm

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: 4728
Joined: Sat Mar 14, 2009 3:13 pm

Re: Debugging LuaGlobal.lua

Post by Vadi » Thu May 13, 2010 4:09 pm

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: 4728
Joined: Sat Mar 14, 2009 3:13 pm

Re: Debugging LuaGlobal.lua

Post by Vadi » Thu May 13, 2010 4:14 pm

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 » Thu May 13, 2010 4:33 pm

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

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

Re: Debugging LuaGlobal.lua

Post by Vadi » Thu May 13, 2010 4:41 pm

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 » Thu May 13, 2010 10:55 pm

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 » Fri May 14, 2010 12:48 pm

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 » Sat May 15, 2010 1:58 am

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

Who is online

Users browsing this forum: No registered users and 3 guests