import time
import pyautogui


time.sleep(2)

attackbutton = (1361, 300)


# found a pirate :
pirate = pyautogui.locateCenterOnScreen('pirates.png', region=(0, 0, 1920, 1080), grayscale=True, confidence=0.70)
if pirate is not None :
        pyautogui.moveTo(pirate) # move the mouse to the coords of the pirate
        time.sleep(1) #break 1 second
        pyautogui.click(pirate[0], pirate[1]) #click the pirate
        time.sleep(1)

#click on attack button :
for i in range (1):
    pyautogui.click(attackbutton[0] , attackbutton[1])

#click fleet
for x in (299, 564, 829, 1094, 1359, 1624):
    pyautogui.click(299, 268)
    time.sleep(3)