0

I am making a script that make my character do the fishing automatically

fishAppear = "exclamationMark.png"
getFish = Pattern("pullBackFishRod.png").targetOffset(2,0)
Settings.MoveMouseDelay = 0
# this three lines will click on the fishButton to drop the fish road to the sea
if exists(fishButton):
    for x in range(4):
        click (fishButton)

After the fish rod drop to the sea, I wait for the fish to get hooked, when the fish get hooked, there will be an exclamation mark show up for about 1 second. so I wait for the fishAppear image to show up

wait(fishAppear, 2 * 60)
if exists(fishAppear):
    for y in range(4):
        click(getFish)

The problem now is: the getFish button only show up for like 1 second after the fish get hooked. When the script detects fishAppear, then it take some time to click on the getFish button, which the getFish button already disappeared.

How can I make the script faster but so it can search the fishAppear image faster? Thanks!

zhinee
  • 105
  • 1
  • 10

1 Answers1

0

If the getFish button appears on a specific region of the screen, use Region class to restrict the area of search. Sikuli will react much faster.