dustyroo

Untitled

Mar 29th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. import time
  2. import random
  3. import pyautogui
  4. import keyboard
  5. import mouse
  6.  
  7. starter = 0
  8. black = 0
  9.  
  10. def change():
  11. global starter
  12. global black
  13.  
  14. first_cord, second_cord = pyautogui.position()
  15. if pyautogui.pixelMatchesColor(first_cord, second_cord, (0, 0, 0), tolerance=20) is True:
  16. black = 1
  17. print('Stay Safe!')
  18. elif pyautogui.pixelMatchesColor(663, 1079, (164, 206, 239), tolerance=20) is not True:
  19. time.sleep(1)
  20. pyautogui.press('/')
  21. time.sleep(1)
  22. pyautogui.moveTo(668, 1058)
  23. time.sleep(1)
  24. pyautogui.click()
  25. time.sleep(1)
  26. pyautogui.moveTo(1781, 924)
  27. time.sleep(1)
  28. pyautogui.click()
  29. time.sleep(1)
  30. pyautogui.press('esc')
  31. time.sleep(1)
  32. print('we have done it!')
  33. starter += 1
  34. else:
  35. return
  36.  
  37.  
  38. while True:
  39. time.sleep(20)
  40. change()
  41. print('Restart #: '+ str(starter))
  42. if starter == 30 or black == 1:
  43. breakimport time
  44. import random
  45. import pyautogui
  46. import keyboard
  47. import mouse
  48.  
  49. starter = 0
  50. black = 0
  51.  
  52. def change():
  53. global starter
  54. global black
  55.  
  56. first_cord, second_cord = pyautogui.position()
  57. if pyautogui.pixelMatchesColor(first_cord, second_cord, (0, 0, 0), tolerance=20) is True:
  58. black = 1
  59. print('Stay Safe!')
  60. elif pyautogui.pixelMatchesColor(663, 1079, (164, 206, 239), tolerance=20) is not True:
  61. time.sleep(1)
  62. pyautogui.press('/')
  63. time.sleep(1)
  64. pyautogui.moveTo(668, 1058)
  65. time.sleep(1)
  66. pyautogui.click()
  67. time.sleep(1)
  68. pyautogui.moveTo(1781, 924)
  69. time.sleep(1)
  70. pyautogui.click()
  71. time.sleep(1)
  72. pyautogui.press('esc')
  73. time.sleep(1)
  74. print('we have done it!')
  75. starter += 1
  76. else:
  77. return
  78.  
  79.  
  80. while True:
  81. time.sleep(20)
  82. change()
  83. print('Restart #: '+ str(starter))
  84. if starter == 30 or black == 1:
  85. break
Add Comment
Please, Sign In to add comment