Advertisement
LinuxUser95

Untitled

Sep 28th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. import pyautogui
  2. import time
  3.  
  4. def fish(x,y,r,g,b):
  5.         error = 0
  6.     while True:
  7.         button7location = pyautogui.pixelMatchesColor(x, y, (r, g, b), tolerance=50)
  8.         if button7location == True:
  9.             print "bierze"
  10.             time.sleep( 2 )
  11.             pyautogui.moveTo(575, 739)
  12.             pyautogui.click(button='right')
  13.             time.sleep( 2 )
  14.             pyautogui.moveTo(603, 734)
  15.             pyautogui.click(button='right')
  16.             time.sleep( 2 )
  17.             pyautogui.moveTo(575, 739)
  18.             pyautogui.click(button='right')
  19.         else:
  20.             print "nic nie bierze"
  21.             error += 1
  22.             if error == 5000:
  23.                 error = 0
  24.                 pyautogui.moveTo(575, 739)
  25.                 pyautogui.click(button='right')
  26.                 time.sleep( 2 )
  27.                 pyautogui.moveTo(603, 734)
  28.                 pyautogui.click(button='right')
  29.                 time.sleep( 2 )
  30.                 pyautogui.moveTo(575, 739)
  31.                 pyautogui.click(button='right')
  32.                  
  33.  
  34. x, y = pyautogui.position()
  35. r, g, b = pyautogui.pixel(x,y)
  36. fish(x,y,r,g,b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement