Advertisement
abasar

Cultris 2 auto settings

Apr 21st, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.03 KB | None | 0 0
  1. import argparse
  2. import time
  3. try:
  4.     import pyautogui
  5. except ImportError:
  6.     import pip
  7.     pip.main(['install', 'pyautogui'])
  8.     import pyautogui
  9.    
  10. FIRST = (593, 495)
  11. SECOND = (728, 504)
  12. THIRD = (854, 504)
  13. FOURTH = (981, 495)
  14. FIFTH = (1101, 499)
  15. SIXTH = (1245, 484)
  16. SEVENTH = (1360, 499)
  17. REPEAT_SPEED_SLIDER = (1300, 664)
  18. REPEAT_SPEED_SLIDER_END = (1432, 661)
  19. OK_BUTTON_2 = (1059, 781)
  20. ROTATE_LEFT = (1499, 529)
  21. ROTATE_RIGHT = (1483, 579)
  22. ROTATE_180 = (1482, 632)
  23. MOVE_DOWN = (659, 632)
  24. DROP_PIECE = (654, 681)
  25. ADVANCED = (1469, 753)
  26. BACK = (951, 332)
  27. OPTIONS = (750, 599)
  28.  
  29. COLORS = {
  30.     'yellow': 0,
  31.     'blue': 1,
  32.     'pink': 2,
  33.     'bright_blue': 3,
  34.     'white': 4,
  35.     'orange': 5,
  36.     'red': 6,
  37.     'green': 7
  38. }
  39.  
  40. parser = argparse.ArgumentParser()
  41. parser.add_argument('color', help='thez color')
  42. args = parser.parse_args()
  43. assert args.color in COLORS, "Choose a different color: %r" % '|'.join(COLORS.keys())
  44.  
  45. pyautogui.click(OPTIONS)
  46. time.sleep(0.2)
  47. pyautogui.click(ROTATE_LEFT)
  48. pyautogui.typewrite('z')
  49. time.sleep(0.1)
  50. pyautogui.click(ROTATE_RIGHT)
  51. pyautogui.typewrite('x')
  52. time.sleep(0.1)
  53. pyautogui.click(ROTATE_180)
  54. pyautogui.typewrite(['shift'])
  55. time.sleep(0.1)
  56. pyautogui.click(DROP_PIECE)
  57. pyautogui.typewrite(['up'])
  58. time.sleep(0.1)
  59. pyautogui.click(MOVE_DOWN)
  60. pyautogui.typewrite(['down'])
  61. pyautogui.moveTo(ADVANCED)
  62. pyautogui.click(ADVANCED)
  63.  
  64. POSITIONS = [FIRST, SECOND, THIRD, FOURTH, FIFTH, SIXTH, SEVENTH]
  65.  
  66. POSITIONS_COLORS = {
  67.     FIRST: 'yellow',
  68.     SECOND: 'green',
  69.     THIRD: 'pink',
  70.     FOURTH: 'blue',
  71.     FIFTH: 'bright_blue',
  72.     SIXTH: 'white',
  73.     SEVENTH: 'red'
  74. }
  75. time.sleep(0.5)
  76. for position in POSITIONS:
  77.     c = COLORS[args.color] + 8
  78.     diff = c - COLORS[POSITIONS_COLORS[position]]
  79.     if diff != 8:
  80.         for i in xrange(diff):
  81.             pyautogui.click(position)
  82.  
  83. pyautogui.moveTo(REPEAT_SPEED_SLIDER)
  84. pyautogui.dragTo(REPEAT_SPEED_SLIDER_END, duration=1.5)
  85. pyautogui.click(OK_BUTTON_2)
  86. pyautogui.moveTo(BACK)
  87. time.sleep(0.2)
  88. pyautogui.click()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement