Murga-Projects Forums

Full Version: MurgaLua with ZeroBrane Studio
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Happy New Year folks.
I talked to the fellow that makes the zerobrane IDE.
But his message pretty much went over my head.

Quote:
Thank you for the message.

Since murgalua and iCame3D both include
luasocket support, it may be quite simple to check if the debugging
works with ZeroBrane Studio.

You can try following these steps I
described for GSL-shell, which is also LuaJIT based product:

https://github.com/pkulchenko/ZeroBraneS...-10022234.

Just make sure you modify the batch file such that you don't set
LUA_CPATH (as you want to use luasocket that comes with your
interpreter, not with ZBS). This should work equally well with
murga-lua and your engine. In fact, we can probably use the
interpreter I put together for gsl-shell as the basis, but to try you
can simply use the batch file as I described.


Any ideas on how to bridge the programs?

iGame3D Wrote:
Happy New Year folks.
I talked to the fellow that makes the zerorbrane IDE.
But his message pretty much went over my head.

Quote:
Thank you for the message.

Since murgalua and iCame3D both include
luasocket support, it may be quite simple to check if the debugging
works with ZeroBrane Studio.

You can try following these steps I
described for GSL-shell, which is also LuaJIT based product:

https://github.com/pkulchenko/ZeroBraneS...-10022234.

Just make sure you modify the batch file such that you don't set
LUA_CPATH (as you want to use luasocket that comes with your
interpreter, not with ZBS). This should work equally well with
murga-lua and your engine. In fact, we can probably use the
interpreter I put together for gsl-shell as the basis, but to try you
can simply use the batch file as I described.


Any ideas on how to bridge the programs?


Sorry for the delay in replying, I was in Australia.

The LUA_CPATH is not an issue as luasocket is built in.

I will have a go tonight and let you know what happens. I fixed a few bugs I had found in the next release of MurgaLua, so if I can stop myself from adding things I'll be releasing soon.

The debugging works with the IDEAJ plugin, so it should work here too.

Cheers
JohnM

Hi,

Sorry for the delay in my reply.

I will try to improve this, but currently I got it working like so :

Copy the attached "murgaLua.lua" to the "interpreters" dir in zbstudio.
Copy the full murgaLua executable to the "bin" directory in zbstudio.
Add "require('mobdebug').start()" as the first line in your prog.

This was tested on Windows, but the changes I made should work on Linux and MacOs.

Let me know how you get on.

Cheers
John de Murga
So far so good. I added "scratchextloop = true," to the end of the script to allow for "Run as Scratchpad" mode which allows for seeing our FLTK windows. I'll attach the script change.

Code:
local exe

local function exePath()
  local mainpath = ide.editorFilename:gsub("[^/\\]+$","")
  local macExe = mainpath..'bin/murgaLua'
  return (ide.osname == "Windows" and mainpath..[[bin\murgaLua.exe]]
     or  (ide.osname == "Unix" and [[murgaLua]]) -- using installed murgaLua
     or  (wx.wxFileExists(macExe) and macExe or mainpath..[[bin/murgaLua]]))
end

return {
  name = "MurgaLua (basic)",
  description = "MurgaLua interpreter with debugger",
  api = {"baselib"},
  frun = function(self,wfilename,rundebug)
    exe = exe or exePath()
     if rundebug then DebuggerAttachDefault() end

    local cmd = ('"%s" "%s"'):format(exe, wfilename:GetFullPath())
    -- CommandLineRun(cmd,wdir,tooutput,nohide,stringcallback,uid,endcallback)
    return CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil,
      function() ide.debugger.pid = nil end)
  end,
  fprojdir = function(self,wfilename)
    return wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  fworkdir = function (self,wfilename)
    return ide.config.path.projectdir or wfilename:GetPath(wx.wxPATH_GET_VOLUME)
  end,
  hasdebugger = true,
  fattachdebug = function(self) DebuggerAttachDefault() end,
  skipcompile = true,
  scratchextloop = true,
  unhideanywindow = true,

}

This is very cool.

Whats the story with in IntelliJ IDEA? We have similiar functionality?

Reference URL's