Output multiple messages from script

Oct 5, 2009 at 7:02am

Output multiple messages from script

I know how to output an array from a script (Ruby via ajm.ruby) as a single executable message like so:
['setcell', 0, 1, 'val', 100] => setcell 0 1 val 100

I want to output multiple messages. A button containing this text sends two setcell messages:
setcell 0 1 val 100, setcell 0 2 val 100

Combining the arrays only executes the first setcell:
['setcell', 0, 1, 'val', 100, 'setcell', 0, 2, 'val', 100] => setcell 0 1 val 100 setcell 0 2 val 100

Combining the arrays with a comma separator also only executes the first setcell:
['setcell', 0, 1, 'val', 100, ',', 'setcell', 0, 2, 'val', 100] => setcell 0 1 val 100 , setcell 0 2 val 100
* I know there’s no space before the comma in the functional button, but I don’t know how to get rid of it.

Nesting the arrays gives me a literal string that doesn’t execute:
[['setcell', 0, 1, 'val', 100]['setcell', 0, 2, 'val', 100]] =>
[['setcell', 0, 1, 'val', 100]['setcell', 0, 2, 'val', 100]]

Any guidance would be greatly appreciated. Thanks!

Peter

#45732
Oct 20, 2009 at 6:27am

I resolved this by disabling the eval outlet (@evaloutlet -1) and specifying another outlet (out0 x). Now to figure out how to get ajm.ruby to accept multiparameter method calls…

#164910

You must be logged in to reply to this topic.