SLua: Default Script

A basic translation of the canonical LSL start script

default.lua
function state_entry()
   ll.Say(0, "Hello, Avatar!")
end
 
function touch_start(total_number)
   ll.Say(0, "Touched.")
end
 
-- Simulate the state_entry event
state_entry()
headers.lua
-- Example headers for standard LSL event handlers
 
function control(avatar_id, level, edge)
    ll.OwnerSay(string.format("control(%s, %s, %s)"))
end
 
function listen(channel, name, id, message)
    ll.OwnerSay(string.format("listen(%d, %s, %s, %s)", channel, name, id, message))
end
 
function run_time_permissions(perm)
    ll.OwnerSay(string.format("run_time_permissions(%s)", perm))
end
 
function state_entry()
    ll.OwnerSay("state_entry()")
end
 
function timer()
    ll.OwnerSay("timer()")
end
 
function touch_start(total_number)
    ll.OwnerSay(string.format("touch_start(%s)", total_number))
end
 
-- This is closer to Python's __main__
local function main()
    ll.OwnerSay("main()")
end
 
main()