Start a loop from a specific point
Hi everyone,
I'm playing roulette on a casino game and I want to create a while loop to place bets.
****the challenge:
Restart the script from the beginning (#point A) every time I win.
Starting with bet 1 (img3) and chips are placed on a number (i.e. number 3)
--Round 1:
#3 win: restart the script from the beginning.
#3 lose: place another bet (bet 2=img4)
--Round 2:
#3 win: restart the script from the beginning.
#3 lose: place another bet (bet 3=img5)
--etc...
Before placing bets, there is a waiting time which ends when "img2" appears.
The script ends after bet 3 if #3 lose.
****the problem:
Seems like my script doesn't recognize the condition (img1) and place the same bet (bet 1) over and over again.
****the script:
While True: #Point A
if not exists(img1, 0):
wait(img2, FOREVER)
click(img3)
continue
else:
if exists(img1, 0):
wait(img2, FOREVER)
click(img4)
break
While True: #Point B
if not exists(img1, 0):
wait(img2, FOREVER)
click(img3)
continue # Want to restart from point A, not point B
else:
if exists(img1, 0):
wait(img2, FOREVER)
click(img5)
break
#etc….
Can you help me please?
Thank you!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: