Channel problem 2
Posted: Monday 02 February, 2015 - 11:20
Hi!
I'm here again with a question I can not solve, and i'm sure it's not so difficult. It's related to another post i've made recently.
I have a robot with 3 possible outputs.I want it to send by channel 1 the atoms named 'mec' and other atoms by channels 2 and 3, but not in a random way, but to the first open channel of these two (channels 2 and 3), I mean to the one which has been longest waiting.
I don't know how to set that in 4DScript. I have this example but is the 'random case', and i would like to modify it.
If(
CompareText(Name(first(c)), [mec]) = true,
1,
IndexMax(NrOC(c)-1, OCReady(Count + 1,c)*Random(100000)) + 1
)
Can anyone help me?
Thanks a lot!!
I'm here again with a question I can not solve, and i'm sure it's not so difficult. It's related to another post i've made recently.
I have a robot with 3 possible outputs.I want it to send by channel 1 the atoms named 'mec' and other atoms by channels 2 and 3, but not in a random way, but to the first open channel of these two (channels 2 and 3), I mean to the one which has been longest waiting.
I don't know how to set that in 4DScript. I have this example but is the 'random case', and i would like to modify it.
If(
CompareText(Name(first(c)), [mec]) = true,
1,
IndexMax(NrOC(c)-1, OCReady(Count + 1,c)*Random(100000)) + 1
)
Can anyone help me?
Thanks a lot!!