Conditional Branching with a mouse error: IndexError: list index out of range

Hi,

I’m receiving this error:

if Equation_mouse.clicked_name[0] =='Solved_button':
IndexError: list index out of range

I am trying to create a conditional branch where a loop runs only if they make a mouse click.

I’ve set up the mouse component like this:

With this code component inserted into the same routine:

The doRK variable is then used in the following dummy loop to either run or skip the loop.

I’m not sure what I’m doing wrong if anyone can help!

Hi sorry,

the custom code component reads

if Equation_mouse.cliked[0] == 'Solved_button':
     dorRK = 1
else:
     doRK = 0

Solved it by doing this instead: