when my code exits this while loop and if statement :
if im.getpixel((258,375)) == (30,37,43):
battle = True
print('lets Battle!!')
time.sleep(10)
leftClick()
while battle == True:
mousePos(503,487)
leftClick()
leftClick()
time.sleep(5)
im = screenGrab()
if im.getpixel((258,375)) != (30,37,43) and im.getpixel((258,375)) != (99, 114, 121) and im.getpixel((258,375)) != (225, 225, 225):
battle = False
break
print('battle Over')
break
The code ends the parent while loop:
while 1 == 1:
im = screenGrab()
if im.getpixel((258,375)) == (30,37,43):
battle = True
print('lets Battle!!')
time.sleep(10)
leftClick()
while battle == True:
mousePos(503,487)
leftClick()
leftClick()
time.sleep(5)
im = screenGrab()
if im.getpixel((258,375)) != (30,37,43) and im.getpixel((258,375)) != (99, 114, 121) and im.getpixel((258,375)) != (225, 225, 225):
battle = False
break
print('battle Over')
break
left(2)
right(2)
I have been trying for ages but I can't get left() and right() to run and the loop to continue after the if statement ends.
Thanks for your help.