def clickImage(im): screen = ImageGrab.grab() coords = findSubimage(im, screen) if not coords: print("Couldn't find image to click") return windowsBot.click(coords[0], coords[1])
def selectOpenGame(im): screen = ImageGrab.grab() coords = findSubimage(wwfYourMove, screen) if not coords: print("Try 2") coords = findSubimage(wwfYourMove2, screen) if not coords: return False #should choose a game randomly. Just first game for now. windowsBot.click(coords[0]+20, coords[1]+20) time.sleep(2) return True
def selectOpenGame(im): screen = ImageGrab.grab() coords = findSubimage(wwfYourMove, screen) if not coords: print("Try 2") coords = findSubimage(wwfYourMove2, screen) if not coords: return False #should choose a game randomly. Just first game for now. windowsBot.click(coords[0] + 20, coords[1] + 20) time.sleep(2) return True
def clickBoardAt(x0, y0): windowsBot.click(offset[0] + shiftX + x0, offset[1] + shiftY + y0)