<reponame>ceejay-el/chocha
import win32api, win32con
import time
import keyboard
import pyautogui


"""
rgb(1, 1, 1)
y: 330
x: 485  545   600   665
"""

def mouse_click(x, y):
    """
    move mouse on screen and click on black keys
    set click time to .3 seconds first
    """
    win32api.setCursorPos((x, y))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
    time.sleep(.3)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)

"""
implement infinite while loop that we terminate by pressing "q".
for each of the mouse positions, observe if pixel array values match the key values
if true, implement mouse click function to play
"""
while keyboard.is_pressed("q") == False:
    if pyautogui.pixel(485, 330)[0] == 1: mouse_click(485, 330)
    if pyautogui.pixel(545, 330)[0] == 1: mouse_click(545, 330)
    if pyautogui.pixel(600, 330)[0] == 1: mouse_click(600, 330)
    if pyautogui.pixel(665, 330)[0] == 1: mouse_click(665, 330)

import win32api, win32con
import time
import keyboard
import pyautogui


"""
rgb(1, 1, 1)
y: 330
x: 485  545   600   665
"""

def mouse_click(x, y):
    """
    move mouse on screen and click on black keys
    set click time to .3 seconds first
    """
    win32api.setCursorPos((x, y))
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y)
    time.sleep(.3)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y)

"""
implement infinite while loop that we terminate by pressing "q".
for each of the mouse positions, observe if pixel array values match the key values
if true, implement mouse click function to play
"""
while keyboard.is_pressed("q") == False:
    if pyautogui.pixel(485, 330)[0] == 1: mouse_click(485, 330)
    if pyautogui.pixel(545, 330)[0] == 1: mouse_click(545, 330)
    if pyautogui.pixel(600, 330)[0] == 1: mouse_click(600, 330)
    if pyautogui.pixel(665, 330)[0] == 1: mouse_click(665, 330)
rgb(1, 1, 1) y: 330 x: 485  545   600   665 move mouse on screen and click on black keys     set click time to .3 seconds first implement infinite while loop that we terminate by pressing "q". for each of the mouse positions, observe if pixel array values match the key values if true, implement mouse click function to play