Advertisement
Lonely_Wanderer

magic

Apr 12th, 2021
921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import pyautogui
  2. import keyboard
  3.  
  4. w,h = pyautogui.size()
  5. w1 = w//2
  6. w=w//2
  7. h=h//2
  8.  
  9. def magic():
  10.     global w,h
  11.     while not keyboard.is_pressed("f"):
  12.         if keyboard.is_pressed("LEFT"):
  13.             w = w - 5
  14.             pyautogui.moveTo(w,h)
  15.             print("width: " + str(w-w1))
  16.             while keyboard.is_pressed("LEFT"): pass
  17.         if keyboard.is_pressed("RIGHT"):
  18.             w = w + 5
  19.             print("width: " + str(w-w1))
  20.             pyautogui.moveTo(w,h)
  21.             while keyboard.is_pressed("RIGHT"): pass
  22.        
  23.  
  24.  
  25. magic()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement