aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LSL.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-22 23:46:56 +1000
committerDavid Walter Seikel2012-02-22 23:46:56 +1000
commitf93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d (patch)
treea291eb5bf596aad17791b37a2a2826d9271742f3 /LuaSL/src/LSL.lua
parentImplement llGetScriptName(). (diff)
downloadSledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.zip
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.gz
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.bz2
SledjHamr-f93cf73e01e9cf4b0a6be43d61ebc24b9fa64b0d.tar.xz
Implement callAndReturn(), use it from callAndWait(). That's most of LuaSL's side of "use OpenSim to deal with in world stuff".
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LSL.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index 8861bf3..b8e2d4b 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -94,14 +94,19 @@ function args2string(doType, ...)
94 return temp 94 return temp
95end 95end
96 96
97function mt.callAndReturn(name, ... ) 97function mt.callAndReturn(name, ...)
98 print("mt.callAndReturn(" .. name .. "(" .. args2string(true, ...) .. "))") 98 luaproc.sendback(name .. "(" .. args2string(true, ...) .. ")")
99end 99end
100 100
101function mt.callAndWait(name, ... ) 101function mt.callAndWait(name, ...)
102 local func = functions[name] 102 local func = functions[name]
103 103
104 print("mt.callAndWait(" .. name .. "(" .. args2string(true, ...) .. "))") 104 mt.callAndReturn(name, ...);
105
106--[[ TODO - do a luaproc sync receive() waiting for the result.
107 Eventually a sendForth() is called, which should end up passing through SendToChannel().
108 The format of the result should be something like - SID.result({x=0.45, y=0.6, z=1.8})
109]]
105 110
106 if "float" == func.Type then return 0.0 111 if "float" == func.Type then return 0.0
107 elseif "integer" == func.Type then return 0 112 elseif "integer" == func.Type then return 0