
OldBotBuilder
USA
Asked
— Edited

I am trying to write an Array of ControlCommand scripts but I get an error message when I Run it. What is the correct format for this kind of entry?
Thank you.
I believe the Array is looking for a $value to store, rather than a ControlCommand.
Are you looking to have a quick way to switch between ControlCommand() movements quickly?
Could you describe what your end goal is? Likely if we get an idea of what you'd like to achieve a few of us can offer a couple different scenarios on how to get there.
For the future, you may want to mark this kind of thread as "Needing Assistance" as you'll likely have many people offering scripting help due to the fact that they may get ez-credit for answering the question.
Yes, I want to switch between ControlCommand() movements quickly to give my 'Segway' robot random movements. I was going to select these movements with a 'GetRandom(Min,Max)' index into an array of movement commands.
My Custom Movement Panel has the normal 4 movements but I have added 4 more commands, 'spin left', 'spin right', 'backward left', and 'backward right'.
I did mark this thread as Needing Assistance.
I think you have the solution. I'll try it.
Thanks
j/k
P.S. BotBuilder, let me know if that works or if you need a better code example.
Worked exactly as I wanted. I should have looked for the obvious instead of the "elegant" solution.
Here is the script:
Code:
Thanks!
Just a thought.