Page 1 of 1

Lua Cuelist question

Posted: Tue Dec 15, 2009 10:14 am
by tom
I thought this one would have been easy but....

a = HC.GetProperty('system','currentcuelist','name')
HC.MessageBox(a) --this works
HC.CueListGo(a) -- this doesn't

Any ideas?

Re: Lua Cuelist question

Posted: Tue Dec 15, 2009 3:59 pm
by RobertBell
It was returning the cue list name with crap (probably a tab) on the end. Try this

Code: Select all

function trim (s)
  return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end

a = HC.GetProperty('system','currentcuelist','name')
print(trim(a))
HC.CueListGo(trim(a)) -- this works 

Re: Lua Cuelist question

Posted: Wed Dec 16, 2009 10:17 am
by tom
Yep, thanks. That did the trick.

What i've done with it is to connect the script to a fader on the up through and down through value (50%, same script for both triggers). I use this as a silent go button for those moments where i have to sit in the hall and theres a very quiet bit in the preformance. Nothing worse than sitting near a noisy operator during a show. Tap, tap tap. I used to have to change the script for each piece or cuelist.

Anychance on elaborating on what this part exactly does - "^%s*(.-)%s*$"

Re: Lua Cuelist question

Posted: Wed Dec 16, 2009 6:55 pm
by RobertBell
It's all standard ANSI-C format crap. Common in PHP and C and the like.