Lua reference links

Open Source software contributions and discussions that supplement or extend the Palette / Light Palette software
Post Reply
User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Lua reference links

Post by RobertBell » Thu Jun 12, 2008 2:20 pm

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/
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
JohnGrimshaw
Posts: 1233
Joined: Tue Oct 16, 2007 12:51 pm
Primary Venue / Use: Other
Where I Am: International Man of Mystery
Location: Sydney, Australia
Contact:

Re: Lua reference links

Post by JohnGrimshaw » Fri Jun 13, 2008 6:08 pm

And this is a great place to get started, learning about Lua...
http://lua-users.org/wiki/TutorialDirectory
...and for more entertainment industry trivia and useless facts, just ask:
John Grimshaw
Managing Director
Stage Fast Pty Ltd

User avatar
RobertBell
Posts: 2421
Joined: Fri Oct 12, 2007 1:11 pm
Primary Venue / Use: Other
Where I Am: Horizon Control Inc
Location: On the dark side just north of Toronto
Contact:

Re: Lua reference links

Post by RobertBell » Tue Sep 30, 2008 1:00 pm

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
Robert Bell - Product Manager - Horizon Control Inc.

Post Reply