You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing loops does not work. Additionally, repeating code by manually copying and pasting the same code multiple times still does not repeat the actions.
The text was updated successfully, but these errors were encountered:
The code written in the 'EMAR robot programming' tools is essentially Javascript and should allow everything you can do in Javascript, including loops, randomization, and defining/calling functions. Below is a simple example that I just tested and seems to work.
var greetings = ["hello", "hi", "greetings"];
var buttonName = null;
for (let i=0; i<greetings.length; i++) {
let rand = getRandomInt(greetings.length);
console.log(">>>>>>> " + i);
console.log("rand " + rand);
robot.setScreen(i);
robot.speak(greetings[rand]);
await robot.sleep(2000);
}
function getRandomInt(max) {
return Math.floor(Math.random() * max);
}
Writing loops does not work. Additionally, repeating code by manually copying and pasting the same code multiple times still does not repeat the actions.
The text was updated successfully, but these errors were encountered: