About repeat If

hello, i have problem about repeat if

i use this code, but it will infinity loop, i just want loop 2 times, or 3 times.

if 3 times, not found images, will stop

any solution? thanks so much

{
“Command”: “do”,
“Target”: “”,
“Value”: “”
},

{
  "Command": "visualSearch",
  "Target": "ifsolved_dpi_144.png",
  "Value": "found"
},
{
  "Command": "repeatIf",
  "Target": "${found} == 0",
  "Value": ""
},
{
  "Command": "echo",
  "Target": "Image found! (${found})",
  "Value": "#shownotification"
},
{
  "Command": "XClick",
  "Target": "clicksignup_dpi_144.png",
  "Value": ""
},

I think you do not need the loop at all!

visualSearch automatically looks for the image once every second until the image is found, or until the !timeout_wait limit is reached (whatever comes first).

visual wait