SHARE
TWEET

Untitled

a guest Oct 21st, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Pixel:
  2.     def __init__(self, position, color):
  3.         self.position = position
  4.         self.color = color
  5.  
  6.     color = ()
  7.     position = ()
  8.  
  9. from PIL import Image as pil_image
  10.  
  11. class Image:
  12.     def __init__(self, path):
  13.         self.path = path
  14.         self.image = pil_image.open(path)
  15.  
  16.  
  17.     def get_size(self):
  18.         return self.image.size
  19.  
  20.     def get_pixel(self, x, y):
  21.         pixels = self.image.load()
  22.         return Pixel((x, y), pixels[x, y])
  23.  
  24.     image = None
  25.     path = ""
  26.  
  27. from pynput.keyboard import Key
  28. from pynput.keyboard import Controller as KeyboardController
  29. class Controller:
  30.     def __init__(self):
  31.         self.keyboard = KeyboardController()
  32.  
  33.     keyboard = None
  34.  
  35.     def jump(self):
  36.         self.keyboard.press(Key.space)
  37.         print("Jumping...")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top