aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LSL.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-10 03:03:24 +1000
committerDavid Walter Seikel2012-02-10 03:03:24 +1000
commite9827d6d70fb52d72c0e6b898bafbfe15ff8d4fa (patch)
treed909e38e75f1ebc4c312ef396ecd08c90c337107 /LuaSL/src/LSL.lua
parentNew Lua logging function for testing, and use it. (diff)
downloadSledjHamr-e9827d6d70fb52d72c0e6b898bafbfe15ff8d4fa.zip
SledjHamr-e9827d6d70fb52d72c0e6b898bafbfe15ff8d4fa.tar.gz
SledjHamr-e9827d6d70fb52d72c0e6b898bafbfe15ff8d4fa.tar.bz2
SledjHamr-e9827d6d70fb52d72c0e6b898bafbfe15ff8d4fa.tar.xz
Re arranged to match the ll*() progress wiki page.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LSL.lua164
1 files changed, 102 insertions, 62 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index c4fae25..ccd603d 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -233,76 +233,29 @@ LSL.z = 0.0;
233 233
234-- ll*() function stubs. 234-- ll*() function stubs.
235 235
236function --[[float]] LSL.llPow(--[[float]] number,--[[float]] places) return 0.0 end;
237function --[[float]] LSL.llFrand(--[[float]] max) return 0.0 end;
238function --[[integer]] LSL.llRound(--[[float]] number) return 0 end;
239
240function --[[key]] LSL.llDetectedKey(--[[integer]] index) return LSL.NULL_KEY end;
241function --[[key]] LSL.llDetectedGroup(--[[integer]] index) return LSL.NULL_KEY end;
242function --[[integer]] LSL.llSameGroup(--[[key]] avatar) return 0 end;
243
244function --[[float]] LSL.llGetAlpha(--[[integer]] side) return 0.0 end;
245function LSL.llSetAlpha(--[[float]] alpha,--[[integer]] side) end;
246function LSL.llSetColor(--[[vector]] colour,--[[integer]] side) end;
247function LSL.llSetPrimitiveParams(--[[list]] params) end;
248function LSL.llSetScale(--[[vector]] scale) end;
249function LSL.llSetSitText(--[[string]] text) end;
250function LSL.llSetText(--[[string]] text, --[[vector]] colour,--[[float]] alpha) end;
251function LSL.llSitTarget(--[[vector]] pos, --[[rotation]] rot) end;
252
253function --[[integer]] LSL.llGetLinkNumber() return 0 end;
254function --[[string]] LSL.llGetObjectDesc() return "" end;
255function LSL.llSetObjectDesc(--[[string]] text) end;
256function --[[string]] LSL.llGetObjectName() return "" end;
257function LSL.llSetObjectName(--[[string]] text) end;
258
259function --[[string]] LSL.llGetInventoryName(--[[integer]] tyPe,--[[integer]] index) return "" end;
260function --[[integer]] LSL.llGetInventoryNumber(--[[integer]] tyPe) return 0 end;
261function --[[integer]] LSL.llGetInventoryType(--[[string]] name) return LSL.INVENTORY_SCRIPT end;
262function --[[key]] LSL.llGetNotecardLine(--[[string]] name,--[[integer]] index) return LSL.NULL_KEY end;
263
264function LSL.llDie() end;
265function --[[integer]] LSL.llGetFreeMemory() return 0 end;
266function --[[string]] LSL.llGetScriptName() return "" end;
267function --[[float]] LSL.llGetTime() return 0.0 end;
268function LSL.llResetOtherScript(--[[string]] name) msg("llResetOtherScript(" .. name .. ")") end;
269function LSL.llResetScript() end;
270function LSL.llResetTime() end;
271function LSL.llSetScriptState(--[[string]] name,--[[integer]] running) msg("llSetScriptState(" .. name .. "," .. running .. ")") end;
272function LSL.llSetTimerEvent(--[[float]] seconds) end;
273function LSL.llSleep(--[[float]] seconds) msg("llSleep(" .. seconds .. ")") end;
274 236
275function LSL.llPlaySound(--[[string]] name,--[[float]] volume) end; 237-- LSL avatar functions
276function LSL.llRezObject(--[[string]] name, --[[vector]] position, --[[vector]] velocity, --[[rotation]] rot,--[[integer]] channel) end;
277function LSL.llRezAtRoot(--[[string]] name, --[[vector]] position, --[[vector]] velocity, --[[rotation]] rot,--[[integer]] channel) end;
278
279function --[[vector]] LSL.llGetPos() return LSL.ZERO_VECTOR end;
280function LSL.llSetPos(--[[vector]] pos) end;
281function --[[rotation]] LSL.llGetRot() return LSL.ZERO_ROTATION end;
282function LSL.llSetRot(--[[rotation]] rot) end;
283
284function --[[rotation]] LSL.llEuler2Rot(--[[vector]] vec) return LSL.ZERO_ROTATION end;
285function --[[vector]] LSL.llRot2Euler(--[[rotation]] rot) return LSL.ZERO_VECTOR end;
286
287function --[[string]] LSL.llGetSubString(--[[string]] text,--[[integer]] start,--[[integer]] eNd) return "" end;
288function --[[integer]] LSL.llStringLength(--[[string]] text) return 0 end;
289function --[[string]] LSL.llStringTrim(--[[string]] text,--[[integer]] tyPe) return "" end;
290function --[[integer]] LSL.llSubStringIndex(--[[string]] text, --[[string]] sub) return 0 end;
291function --[[list]] LSL.llParseString2List(--[[string]] In, --[[list]] l, --[[list]] l1) return {} end;
292function --[[list]] LSL.llParseStringKeepNulls(--[[string]] In, --[[list]] l, --[[list]] l1) return {} end;
293 238
294function --[[key]] LSL.llAvatarOnSitTarget() return LSL.NULL_KEY end; 239function --[[key]] LSL.llAvatarOnSitTarget() return LSL.NULL_KEY end;
295function --[[list]] LSL.llGetAnimationList(--[[key]] id) return {} end; 240function --[[list]] LSL.llGetAnimationList(--[[key]] id) return {} end;
296function --[[key]] LSL.llGetKey() return LSL.NULL_KEY end;
297function --[[key]] LSL.llGetOwner() return LSL.NULL_KEY end;
298function --[[integer]] LSL.llGetPermissions() return 0 end; 241function --[[integer]] LSL.llGetPermissions() return 0 end;
299function --[[key]] LSL.llGetPermissionsKey() return LSL.NULL_KEY end; 242function --[[key]] LSL.llGetPermissionsKey() return LSL.NULL_KEY end;
300function --[[string]] LSL.llKey2Name(--[[key]] avatar) return "" end; 243function --[[string]] LSL.llKey2Name(--[[key]] avatar) return "" end;
301function LSL.llRequestPermissions(--[[key]] avatar,--[[integer]] perms) end; 244function LSL.llRequestPermissions(--[[key]] avatar,--[[integer]] perms) end;
245function --[[integer]] LSL.llSameGroup(--[[key]] avatar) return 0 end;
302function LSL.llStartAnimation(--[[string]] anim) end; 246function LSL.llStartAnimation(--[[string]] anim) end;
303function LSL.llStopAnimation(--[[string]] anim) end; 247function LSL.llStopAnimation(--[[string]] anim) end;
304function LSL.llUnSit(--[[key]] avatar) end; 248function LSL.llUnSit(--[[key]] avatar) end;
305 249
250
251-- LSL collision / detect / sensor functions
252
253function --[[key]] LSL.llDetectedGroup(--[[integer]] index) return LSL.NULL_KEY end;
254function --[[key]] LSL.llDetectedKey(--[[integer]] index) return LSL.NULL_KEY end;
255
256
257-- LSL communications functions
258
306function LSL.llDialog(--[[key]] avatar, --[[string]] caption, --[[list]] arseBackwardsMenu,--[[integer]] channel) end; 259function LSL.llDialog(--[[key]] avatar, --[[string]] caption, --[[list]] arseBackwardsMenu,--[[integer]] channel) end;
307function --[[integer]] LSL.llListen(--[[integer]] channel, --[[string]] name, --[[key]] id, --[[string]] msg) return 0 end; 260function --[[integer]] LSL.llListen(--[[integer]] channel, --[[string]] name, --[[key]] id, --[[string]] msg) return 0 end;
308function LSL.llListenRemove(--[[integer]] handle) end; 261function LSL.llListenRemove(--[[integer]] handle) end;
@@ -314,6 +267,16 @@ function LSL.llWhisper(--[[integer]] channel, --[[string]] text) msg("Channel
314function LSL.llMessageLinked(--[[integer]] link,--[[integer]] num, --[[string]] text, --[[key]] aKey) end; 267function LSL.llMessageLinked(--[[integer]] link,--[[integer]] num, --[[string]] text, --[[key]] aKey) end;
315 268
316 269
270-- LSL inventory functions.
271
272function --[[string]] LSL.llGetInventoryName(--[[integer]] tyPe,--[[integer]] index) return "" end;
273function --[[integer]] LSL.llGetInventoryNumber(--[[integer]] tyPe) return 0 end;
274function --[[integer]] LSL.llGetInventoryType(--[[string]] name) return LSL.INVENTORY_SCRIPT end;
275function --[[key]] LSL.llGetNotecardLine(--[[string]] name,--[[integer]] index) return LSL.NULL_KEY end;
276function LSL.llRezAtRoot(--[[string]] name, --[[vector]] position, --[[vector]] velocity, --[[rotation]] rot,--[[integer]] channel) end;
277function LSL.llRezObject(--[[string]] name, --[[vector]] position, --[[vector]] velocity, --[[rotation]] rot,--[[integer]] channel) end;
278
279
317-- LSL list functions. 280-- LSL list functions.
318 281
319function --[[list]] LSL.llCSV2List(--[[string]] text) return {} end; 282function --[[list]] LSL.llCSV2List(--[[string]] text) return {} end;
@@ -342,6 +305,10 @@ function --[[string]] LSL.llDumpList2String(--[[list]] l, --[[string]] separator
342 return result 305 return result
343end 306end
344 307
308function --[[integer]] LSL.llGetListLength(--[[list]] l)
309 return #l
310end
311
345function --[[string]] LSL.llList2CSV(--[[list]] l) 312function --[[string]] LSL.llList2CSV(--[[list]] l)
346 return LSL.llDumpList2String(l, ",") 313 return LSL.llDumpList2String(l, ",")
347end 314end
@@ -424,10 +391,6 @@ function --[[list]] LSL.llListInsertList(--[[list]] l, --[[list]] l1,--[[integer
424 return result 391 return result
425end 392end
426 393
427function --[[integer]] LSL.llGetListLength(--[[list]] l)
428 return #l
429end
430
431function --[[list]] LSL.llListReplaceList(--[[list]] l, --[[list]] part,--[[integer]] start,--[[integer]] eNd) 394function --[[list]] LSL.llListReplaceList(--[[list]] l, --[[list]] part,--[[integer]] start,--[[integer]] eNd)
432 local result = {} 395 local result = {}
433 local x = 1 396 local x = 1
@@ -459,6 +422,81 @@ function --[[list]] LSL.llListSort(--[[list]] l,--[[integer]] stride,--[[integer
459 return result 422 return result
460end 423end
461 424
425function --[[list]] LSL.llParseString2List(--[[string]] In, --[[list]] l, --[[list]] l1) return {} end;
426function --[[list]] LSL.llParseStringKeepNulls(--[[string]] In, --[[list]] l, --[[list]] l1) return {} end;
427
428
429-- LSL math functions
430
431function --[[rotation]] LSL.llEuler2Rot(--[[vector]] vec) return LSL.ZERO_ROTATION end;
432function --[[float]] LSL.llFrand(--[[float]] max) return 0.0 end;
433function --[[float]] LSL.llPow(--[[float]] number,--[[float]] places) return 0.0 end;
434function --[[vector]] LSL.llRot2Euler(--[[rotation]] rot) return LSL.ZERO_VECTOR end;
435function --[[integer]] LSL.llRound(--[[float]] number) return 0 end;
436
437
438-- LSL object / prim functions
439
440function LSL.llDie() end;
441function --[[key]] LSL.llGetKey() return LSL.NULL_KEY end;
442function --[[integer]] LSL.llGetLinkNumber() return 0 end;
443function --[[string]] LSL.llGetObjectDesc() return "" end;
444function --[[string]] LSL.llGetObjectName() return "" end;
445function --[[key]] LSL.llGetOwner() return LSL.NULL_KEY end;
446function LSL.llSetObjectDesc(--[[string]] text) end;
447function LSL.llSetObjectName(--[[string]] text) end;
448function LSL.llSetPrimitiveParams(--[[list]] params) end;
449function LSL.llSetSitText(--[[string]] text) end;
450function LSL.llSetText(--[[string]] text, --[[vector]] colour,--[[float]] alpha) end;
451function LSL.llSitTarget(--[[vector]] pos, --[[rotation]] rot) end;
452
453
454-- LSL rotation / scaling / translation functions
455
456function --[[vector]] LSL.llGetPos() return LSL.ZERO_VECTOR end;
457function --[[rotation]] LSL.llGetRot() return LSL.ZERO_ROTATION end;
458function LSL.llSetPos(--[[vector]] pos) end;
459function LSL.llSetRot(--[[rotation]] rot) end;
460function LSL.llSetScale(--[[vector]] scale) end;
461
462
463-- LSL script functions
464
465function --[[integer]] LSL.llGetFreeMemory() return 0 end;
466function --[[string]] LSL.llGetScriptName() return "" end;
467function LSL.llResetOtherScript(--[[string]] name) msg("llResetOtherScript(" .. name .. ")") end;
468function LSL.llResetScript() end;
469function LSL.llSetScriptState(--[[string]] name,--[[integer]] running) msg("llSetScriptState(" .. name .. "," .. running .. ")") end;
470
471
472-- LSL sound functions
473
474function LSL.llPlaySound(--[[string]] name,--[[float]] volume) end;
475
476
477-- LSL string functions
478
479function --[[string]] LSL.llGetSubString(--[[string]] text,--[[integer]] start,--[[integer]] eNd) return "" end;
480function --[[integer]] LSL.llStringLength(--[[string]] text) return 0 end;
481function --[[string]] LSL.llStringTrim(--[[string]] text,--[[integer]] tyPe) return "" end;
482function --[[integer]] LSL.llSubStringIndex(--[[string]] text, --[[string]] sub) return 0 end;
483
484
485-- LSL texture functions
486
487function --[[float]] LSL.llGetAlpha(--[[integer]] side) return 0.0 end;
488function LSL.llSetAlpha(--[[float]] alpha,--[[integer]] side) end;
489function LSL.llSetColor(--[[vector]] colour,--[[integer]] side) end;
490
491
492-- LSL time functions
493
494function --[[float]] LSL.llGetTime() return 0.0 end;
495function LSL.llResetTime() end;
496function LSL.llSetTimerEvent(--[[float]] seconds) end;
497function LSL.llSleep(--[[float]] seconds) msg("llSleep(" .. seconds .. ")") end;
498
499
462 500
463-- Crements stuff. 501-- Crements stuff.
464 502
@@ -467,6 +505,7 @@ function LSL.preIncrement(name) _G[name] = _G[name] + 1; return _G[name]; end;
467function LSL.postDecrement(name) local temp = _G[name]; _G[name] = _G[name] - 1; return temp; end; 505function LSL.postDecrement(name) local temp = _G[name]; _G[name] = _G[name] - 1; return temp; end;
468function LSL.postIncrement(name) local temp = _G[name]; _G[name] = _G[name] + 1; return temp; end; 506function LSL.postIncrement(name) local temp = _G[name]; _G[name] = _G[name] + 1; return temp; end;
469 507
508
470-- State stuff 509-- State stuff
471 510
472local currentState = {} 511local currentState = {}
@@ -550,6 +589,7 @@ function LSL.mainLoop(ourSID, x)
550 end 589 end
551end 590end
552 591
592
553-- Typecasting stuff. 593-- Typecasting stuff.
554 594
555function LSL.floatTypecast(x) 595function LSL.floatTypecast(x)