News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
[WIP] MurgaLua Reference Tool
Author Message

Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
RE: [WIP] MurgaLua Reference Tool

I knew I should have posted my changes as I went along.
Everytime I edit this thing, you come out with a new version.

In order for the compiled and/or script version to run equally
I changed the code last night to this

-- set directory separator according to operating system
if murgaLua.getHostOsName() == "windows" then demo_sep="\\" else demo_sep="/" end

--default to current directory, works after cd in scripting, not in standalone
CurDir = lfs.currentdir().."/"

-- find murgalua folder, or the script as compiled binary
pathToMurgaLua = string.gsub(murgaLua_ExePath,"(.*)/.*","%1").."/"

-- test for presence of demo scripts folder
if lfs.attributes(pathToMurgaLua.."script") ~= nil then CurDir = pathToMurgaLua end

-- in script mode the argument is received when executing this script
if arg[0] ~= nil then CurDir = arg[0] end  

-- Get the dirname and basename of the current script or binary
if string.find(CurDir,demo_sep) then
  demo_appdir=string.gsub(CurDir,"(.*)"..demo_sep..".*","%1") -- data directory

arg throws an error in the compiled version unless it gets some data.
My changes manage to kill this bug.

/bin/murgaLua/examples/widgets: [string "--#!/bin/murgaLua..."]:236: attempt to index global 'arg' (a nil value)
stack traceback:
        [string "--#!/bin/murgaLua..."]:236: in function 'newFunc'
        [string "murgaLua"]:268: in function 'decompileMurgaLua'
        [string ""]:1: in main chunk
        [C]: ?

Also have to comment out "#!/bin/murgaLua" in the first line for compile.
It will throw a false error at line 268 for some reason.

I just made the code changes and recompiled it works on my side at least.
See what happens over there.

Attached File(s)
.lua File  BillModwidgets.lua (Size: 13.71 KB / Downloads: 3)
02-02-2008 07:52 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
[WIP] MurgaLua Reference Tool - mikshaw - 07-10-2007, 05:00 PM
RE: [WIP] MurgaLua Reference Tool - iGame3D - 02-02-2008 07:52 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: