Skip to content

Instantly share code, notes, and snippets.

@SauravKanchan
Last active September 18, 2017 18:06
Show Gist options
  • Save SauravKanchan/1997459e9a81ac1c00ec6869072ae947 to your computer and use it in GitHub Desktop.
Save SauravKanchan/1997459e9a81ac1c00ec6869072ae947 to your computer and use it in GitHub Desktop.
Playing piano tiles with PyAutoGUI
# -*- coding: utf-8 -*-
"""
@author: Saurav Kanchan
"""
import pyautogui as pt
import time
time.sleep(5)
pt.FAILSAFE = True
while True:
if pt.pixelMatchesColor(518, 557, (32, 32, 32)): pt.click(518, 557)
elif pt.pixelMatchesColor(622, 557, (32, 32, 32)): pt.click(622, 557)
elif pt.pixelMatchesColor(725, 557, (32, 32, 32)): pt.click(725, 557)
elif pt.pixelMatchesColor(846, 557, (32, 32, 32)): pt.click(846, 557)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment