therealjayvi

autocouponbot.py

Nov 3rd, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.71 KB | None | 0 0
  1. import string
  2. import random
  3. from time import sleep
  4. import pyautogui as pgui
  5.  
  6. coupon_box_pos_1 = (132, 469)
  7. coupon_box_pos_2 = (126,492)
  8. captcha_box_pos = (35, 192)
  9. claim_faucet_pos = (107, 243)
  10.  
  11. coupon_hint = "WIN-6I6W-D7BV-NSKB-4"
  12.  
  13. with open('attempts.txt') as f:
  14.     old_tries = f.read().splitlines()
  15.  
  16.  
  17. def id_generator(size=3, chars=string.ascii_uppercase + string.digits):
  18.     return ''.join(random.choice(chars) for _ in range(size))
  19.  
  20. def guess():
  21.     while True:
  22.         try:
  23.             gen = id_generator()
  24.             if '0' in gen:
  25.                 continue
  26.             elif '5' in gen:
  27.                 continue
  28.             elif '6' in gen:
  29.                 continue
  30.             elif '7' in gen:
  31.                 continue
  32.             elif '8' in gen:
  33.                 continue
  34.             elif '9' in gen:
  35.                 continue
  36.             elif 'A' in gen:
  37.                 continue
  38.             elif 'B' in gen:
  39.                 continue
  40.             elif 'C' in gen:
  41.                 continue
  42.             elif 'D' in gen:
  43.                 continue
  44.             elif 'E' in gen:
  45.                 continue
  46.             elif 'F' in gen:
  47.                 continue
  48.             elif 'G' in gen:
  49.                 continue
  50.             elif 'Q' in gen:
  51.                 continue
  52.             elif 'R' in gen:
  53.                 continue
  54.             elif 'S' in gen:
  55.                 continue
  56.             elif 'T' in gen:
  57.                 continue
  58.             elif 'U' in gen:
  59.                 continue
  60.             elif 'V' in gen:
  61.                 continue
  62.             elif 'X' in gen:
  63.                 continue
  64.             elif 'Y' in gen:
  65.                 continue
  66.             else:
  67.                 return coupon_hint + gen
  68.                 break
  69.         except BaseException:
  70.             pass
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. new_tries = []
  79. x = 0
  80. while True:
  81.     try:
  82.         n = guess()
  83.         if n not in old_tries and n not in new_tries:
  84.             new_tries.append(str(n))
  85.         else:
  86.             continue
  87.         if x == 0:
  88.             pgui.moveTo(coupon_box_pos_1)
  89.             sleep(1)
  90.             x = x + 1
  91.         else:
  92.             pgui.moveTo(coupon_box_pos_2)
  93.             sleep(1)
  94.         pgui.click()
  95.         pgui.click()
  96.         pgui.hotkey('command', 'a', 'delete')
  97.         pgui.typewrite(n)
  98.         pgui.moveTo(captcha_box_pos)
  99.         pgui.click()
  100.         #sleep(3)
  101.         input("Waiting to hit enter...")
  102.         pgui.moveTo(claim_faucet_pos)
  103.         pgui.click()
  104.         pgui.click()
  105.         #sleep(2)
  106.     except KeyboardInterrupt:
  107.         with open('attempts.txt', 'a+') as f:
  108.             for tries in new_tries:
  109.                 f.write(tries)
  110.                 f.write("\n")
  111.         break
Advertisement
Add Comment
Please, Sign In to add comment