• Yes, blockly isn't great for that kind of thing - although it would be possible for someone to add a special block that would break out of an every X seconds block.

    For now though, I reckon you've got 2 options to do what you want:

    • Keep the every 5 second loop going all the time, and use a variable with an if myVariable block right inside the every 5 second loop. You can then stop things or start them by setting or clearing the variable.
    • Define a function, fiveSecs, and in that function add if (myCondition) { wait 5 secs { call fiveSecs } } - that's maybe the nicest...
  • I don't quite understand the first option. What would the variable do as far as exiting the loop

    And far as the second one, would I make this a recursive function? I'm just making sure that the program can be reset essentially (without literally pressing the reset button).

    Either way here's what I interpreted from your second option


    1 Attachment

    • screenshot2.png
About

Avatar for Progma @Progma started