Page 1 of 1

Lua reference links

Posted: Thu Jun 12, 2008 2:20 pm
by RobertBell
From our manual:
Advanced scripting in Palette uses the Lua programming language and can be constructed to execute very complex routines that access the Processor's operating system, file system or other external non-lighting related devices. Lua is a full featured programming language that offers IF THEN ELSE type routines as well as user definable functions, string manipulation and local and global variable storage.
found on page http://www.horizoncontrol.com/mqhelp/mq ... cripts.htm where there are 3 examples including file access and timeofday routines

The defacto on-line manual for Lua
http://www.lua.org/manual/5.1/index.html#contents

A user group
http://lua-users.org/

Re: Lua reference links

Posted: Fri Jun 13, 2008 6:08 pm
by JohnGrimshaw
And this is a great place to get started, learning about Lua...
http://lua-users.org/wiki/TutorialDirectory

Re: Lua reference links

Posted: Tue Sep 30, 2008 1:00 pm
by RobertBell
or directly to search some sample code:

http://lua-users.org/wiki/SampleCode

Today I found this one and stole it outright. Can't believe Lua doesn't have a clean way of doing this direclty

Code: Select all

function round(val, decimal)
  if (decimal) then
    return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
  else
    return math.floor(val+0.5)
  end
end