Default values for macro -> scripts not correct

Is this a feature? Is this a bug? Give us feedback to make it better!
Post Reply
User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

Default values for macro -> scripts not correct

Post by gooze » Wed Feb 20, 2008 4:31 pm

If you add a macro to a cue and choose script, some of the default values are not correct.
If you try to insert a window if you don't edit you get an error message. It has to do with the ' instead of " and some brackets not in the right place.
I found out the correct syntax, but only by trying.
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

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: Default values for macro -> scripts not correct

Post by RobertBell » Wed Feb 20, 2008 5:19 pm

Most of the inserted script calls (HC.***) have standard syntax suggestions, but none will work out of the box. You need to do manual editing. If you're doing simple operations, just use Commands and you cannot screw up the syntax as it's all pointer based.

Scripting is more complex and helps with show control programming (IF|THEN|ELSE). The Palette script macros use the Lua programming language.

What is Lua?

Lua is a powerful, fast, light-weight, embeddable scripting language.
Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

The manual is here: http://www.lua.org/manual/5.1/

While in the script editor, press S4-Test to check syntax. If there are errors, they will appear in the output window with a line number. The top of the editor tells you what line your cursor is on.

Some advanced examples of Lua scripts can be found here: http://www.horizoncontrol.com/mqhelp/mq ... cripts.htm
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

Re: Default values for macro -> scripts not correct

Post by gooze » Thu Mar 06, 2008 9:06 am

I mean this:

From the scripts you choose:
HC.MessageBox('message box string'[,'message box title'])

Then you hit {S4 - Test} and it replies:
Load error: [string '"']:1: ')' expected near '['

I don't know, but this looks a bit scary to me!

If the original would be:

HC.MessageBox('message','message box title')

and you'd hit Test, the result is much more encouraging to experiment. It gives you a message box and you'd see directly which part to edit to get the desired result.
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

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: Default values for macro -> scripts not correct

Post by RobertBell » Thu Mar 06, 2008 9:20 am

The syntax examples we use are similar to when you type

Code: Select all

dir /? 
from a DOS box. The stuff in square braces is optional. Lua and script writing is not for the meek. That is why we have commands. Maybe you want a Command for a dialog box?
Robert Bell - Product Manager - Horizon Control Inc.

User avatar
gooze
Posts: 1760
Joined: Tue Dec 18, 2007 12:42 pm
Location: Amsterdam, The Netherlands
Contact:

Re: Default values for macro -> scripts not correct

Post by gooze » Thu Mar 06, 2008 9:26 am

Maybe it's better for me that I stay away from scripts then, because it appeared really easy to use, but in fact it isn't it. Maybe the scripts should be more hidden. Or there should be a more clear Advanced options label on it? Now they apear to be on the same level as Comands
A message box is a good addition for the commands, as I use it as a reminder to save the show and put the lamp off for the moving lights after the last cue. It's also great for putting fly cues in the cuelist.
Floriaan Ganzevoort - Lighting designer
THEATERMACHINE design. production. operations.

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: Default values for macro -> scripts not correct

Post by JohnGrimshaw » Thu Mar 06, 2008 5:18 pm

Scripts "can" be scary to a new user, but I did exactly what Robert suggested, and went of to the Lua site to learn a little more.

It does take a little time to learn, but once you do, it is VERY powerful.

As you go through this process, I think it would be VERY helpful to note the things to need to know as you start on this journey (to help the people the follow). Tips like:
"--" any text on that line after this allows you to type NOTES about the script, and are ignored by computer
info in between "[" and "]" are options, and can be removed if you like

I agree there could be "samples" provided for each HC command - that would also help people understand how to manipulate it
...and for more entertainment industry trivia and useless facts, just ask:
John Grimshaw
Managing Director
Stage Fast Pty Ltd

Post Reply