Hi,
Since this is my first post here, excuse me if I'm doing something wrong.
I've been struggling with LUA in Grandma3 (Version 1.9.2.2)
I've a code written that works in Grandma2, but somehow it doesn't work in Grandma3.
So hopefully someone can help me out with this one.
To be clear I want to create multiple sequences.
Like this: Fixture 10 at Sequence 10 and label it as the fixture is called with it's number.
Fixture 11 at Sequence 11 and so on...
Code
function getNonEmptyStartValue (msg, placeholder)
placeholder = placeholder or ''
local userInput = ''
repeat
userInput = tonumber(gma.ti(msg, placeholder))
until userInput ~= placeholder
return userInput
end
function getNonEmptyEndValue (msg, placeholder)
placeholder = placeholder or ''
local userInput = ''
repeat
userInput = tonumber(gma.ti(msg, placeholder))
until userInput ~= placeholder
return userInput
end
function main ()
DimmerValue = '100'
local targetStartFixID = getNonEmptyStartValue('First Fix ID')
local targetEndFixID = getNonEmptyEndValue('Last Fix ID')
for CurrentFixID=targetStartFixID, targetEndFixID, 1 do
gma.feedback('Current FixID = ' .. CurrentFixID)
gma.cmd ('Selection Fixture ' .. CurrentFixID)
TextLabel = 'DMX ' .. CurrentFixID
gma.feedback('TextLabel = ' .. TextLabel)
gma.echo('' .. TextLabel)
gma.cmd ('At ' .. DimmerValue)
gma.cmd ('Store Sequence ' .. CurrentFixID)
-- gma.cmd ('Label Fixture ' .. CurrentFixID )
end
gma.echo('start = ' .. targetStartFixID)
gma.echo('eind = ' .. targetEndFixID)
gma.cmd ('SetVar $StartFixID '.. targetStartFixID)
gma.cmd ('SetVar $EndFixID ' .. targetEndFixID)
gma.cmd ('Label Sequence $StartFixID Thru $EndFixID')
gma.cmd ('Clearall')
end
return main
Display More
Thanks already!
Kind Regards,
Kevin