Skip to content

Instantly share code, notes, and snippets.

@BluumDK
Created March 24, 2022 10:42
Show Gist options
  • Select an option

  • Save BluumDK/417fa56cef08b29f54e502dc3639ef12 to your computer and use it in GitHub Desktop.

Select an option

Save BluumDK/417fa56cef08b29f54e502dc3639ef12 to your computer and use it in GitHub Desktop.
# X: 751 Y: 624 - Snake start position.
# RGB: ( 78, 124, 246) - Snake front.
# X: 1220 Y: 623 RGB: (162, 209, 73) - 1. turn
# X: 1307 Y: 340 RGB: (162, 209, 73) - 2. turn
# X: 630 Y: 309 RGB: (170, 215, 81) - 3. turn
# X: 592 Y: 909 RGB: (170, 215, 81) - 4. turn
import pyautogui
if pyautogui.pixel(1220, 623, (162, 209, 73)):
pyautogui.press('w')
if pyautogui.pixel(1307, 340, (162, 209, 73)):
pyautogui.press('a')
@BluumDK
Copy link
Copy Markdown
Author

BluumDK commented Mar 24, 2022

line 10, in <module>
    if pyautogui.pixel(1220, 623, (162, 209, 73)):
TypeError: pixel() takes 2 positional arguments but 3 were given

1220, and 623 are pixel cordinates, the last 3 are rgb code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment