← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #708157]: Want to continue with my Script when a counter on screen stops

 

Question #708157 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/708157

Emmi Jackson posted a new comment:
Hello,

Welcome to SikuliX! To address your issue, you can create a script that
continuously observes the counter and clicks on the specified area until
the counter stops increasing. Here's a basic example to get you started:

python
Copy code
# Import the necessary SikuliX functions
from sikuli import *

# Set the region where the counter is located
counter_region = Region(100, 100, 200, 200)  # Adjust coordinates as needed

# Set the region to click on a certain part of the screen
click_region = Region(300, 300, 50, 50)  # Adjust coordinates as needed

# Function to check if the counter is still increasing
def is_counter_increasing():
    # Implement your logic to check if the counter is increasing
    # For example, compare current and previous values, or look for specific visual cues
    # Return True if the counter is still increasing, False otherwise
    pass

# Main script
while is_counter_increasing():
    click(click_region)  # Click on the specified region every second
    wait(1)  # Wait for 1 second before the next iteration

# Continue with the rest of your script after the counter stops increasing
# Add your code here

In the is_counter_increasing function, you should implement the logic to
check if the counter is still increasing. This might involve comparing
the current and previous values of the counter or looking for visual
cues on the screen.

Adjust the coordinates and regions in the script according to the actual
layout of your screen.

I hope this helps! If you have specific details about the counter or the
screen layout, I can provide more tailored assistance.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.