Thanks for that @MrMen. I can confirm it works, however I’m a bit confused by the logic… It seems that in the second event (first sub-event) it picks all boxes, narrows it down to the red ones, then narrows it down to the ones without the mouse cursor over them. It then pick a random box from that selection. Great! But then it goes into the while loop to see if the cursor is over the box. As far as I can tell, that’ll never be the case…
So I played around with this myself and simplified it down to this:
Surprisingly this works, and there’s no loop! I didn’t need to worry about whether a red or green box is clicked on, so I removed those conditions.
Thank you very much @MrMen for your assistance and patience, and thank you also to @CTXB for proposing the idea of being able to do this without a loop (sorry we didn’t believe you ).