From f97c73bd1e43a0eb32ad8dc43fc28f6e40b28f38 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 23 May 2014 13:22:36 +1000 Subject: Rewrite the LuaSL script running stuff (twice lol), plus much related tweakage and cleanups. --- lib/LSL.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/LSL.lua b/lib/LSL.lua index 6306045..a95ead3 100644 --- a/lib/LSL.lua +++ b/lib/LSL.lua @@ -199,7 +199,7 @@ function args2string(doType, ...) end function mt.callAndReturn(name, ...) - luaproc.sendback(name .. "(" .. args2string(true, ...) .. ")") + Runnr.send(nil, name .. "(" .. args2string(true, ...) .. ")") end function mt.callAndWait(name, ...) @@ -952,8 +952,9 @@ function waitAndProcess(returnWanted) if returnWanted then Type = "result" end while running do - local message = luaproc.receive(SID) + local message = Runnr.receive() if message then +--print('GOT MESSAGE for script ' .. scriptName .. ' - "' .. message .. '"') -- TODO - should we be discarding return values while paused? I don't think so, so we need to process those, if paused then if "start()" == message then paused = false end @@ -977,7 +978,7 @@ function waitAndProcess(returnWanted) end -- Otherwise, just run it and keep looping. -- TODO - Not sure why I had this here. "sid" is not set anywhere, and SID would just send it to ourselves. --- status, errorMsg = luaproc.send(sid, result1) +-- status, errorMsg = Runnr.send(nil, result1) -- if not status then -- msg("Error sending results from " .. Type .. ": " .. message .. " ERROR MESSAGE: " .. errorMsg) -- end -- cgit v1.1