Page 1 of 1

Look macros

Posted: Thu Mar 17, 2011 12:45 am
by amoyer
Since we finally got 10.8.2 installed this week I'm now trying to setup macros in all of the playback buttons. One of the sets of macros that I'm trying to setup is for gobo rotation (CW fast, CW slow, stop, CCW slow, CCW fast). We added time to these as we noticed that were changing too abruptly but this of course didn't fix changing from CW to CCW.

What I was hoping to do was add a script that checked to see what direction the gobo was spinning and if spinning in the opposite direction, take it to a stop first then change direction and go back up to speed.

Using HC.AttributeGetValue I can get the direction of the selected fixture but that is really as far as I can get. I know I need to use "if then else end" functions but I seem to be missing something.

Code: Select all

a=HC.AttributeGetValue('live', '1', 'gb Mode')
b='Rot CW'

if (a==b) then
    HC.ButtonWingButtonPress (1, 1)
    HC.ButtonWingButtonPress (1, 2)
Regardless of whether the fixture is set to 'Rot CW' or 'Rot CCW' it still is doing the 'else' option.



Re: Look macros

Posted: Thu Mar 17, 2011 3:25 am
by MickCrozier
This is something I've been to meaning to chat to the good folk at horizon about.

Some atrributes appear not accesable. Colo(u)r and Gobo 2 come to mind.
Others are a bit funny - Strobe can not return a value ('Strobe+V'), but will return the display text (such as 'Open') with 'Strobe'.
Colour A (as written in the ML window) can only be set using 'Color A', but can be read with 'Colour A' or 'Color A'
Any of the phantom attributes I've tried such as 'gb mode' can not be set and appear to return an empty string when read.
In your case:
a =
b = 'Rot CW'

a never = b

A nice trick is to use print(a) - it will appear in the debug pane just below the script.

Re: Look macros

Posted: Fri Mar 18, 2011 11:00 am
by amoyer
If I put the script

Code: Select all

print(HC.AttributeGetValue('live','181','gb Mode'))
I get a response of 'Rot CCW'

It appears that I can't get it to either equal or not equal another value to get it to do the 'if... then... else... end' function. :(

Re: Look macros

Posted: Fri Mar 18, 2011 7:08 pm
by MickCrozier
I had a play here and it wouldn't go
There will be a separator after the word

Robert wrote some better code for this, but I can't find it - here's what I use

Code: Select all

a = HC.AttributeGetValue('live', '1', 'gb Mode')
n = #a
while n > 0 and a:find("^%s", n) do n = n - 1 end

a = a:sub(1, n)