I need an infinite loop with this actions.
. image1: search for this image on a specific screen area, if "not found" send "e", this will make the image to show up, when image1 is detected wait 5 to 7 seconds, then send "w", then start from the begining again.
. image2: IT will appear randomly on certain area of the screen, when it appears, image1 actions should stop from working to not interfere with this actions , then resume image1 actions after this is done.
. image3: Same as above, but this image should have also priority of exection over image2, so both actions don't take place at the same time.
Basically:
Code: Select all
; #1
; stop while image2 and image3 are being executed, then resume.
imagesearch image1 not on the screen
send e
imagesearch image1 on the screen
sleep 5 to 7 (random sleep time)
send w
; #2
; if image3 is found at the same time, wait for those actions first, then resume this one.
imagesearch image2 on the screen
send e
sleep 10
send x
; #3
; always priority of execution
imagesearch image3 on the screen
send e
sleep 10
send z
The images i'm using are on the same folder as the script.