Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.37 KB | None | 0 0
  1. import pyautogui
  2. import time
  3.  
  4. from selenium import webdriver
  5. from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
  6. from selenium.webdriver.common.by import By
  7.  
  8. capabilities = webdriver.DesiredCapabilities().FIREFOX
  9. capabilities["marionette"] = True
  10. binary = FirefoxBinary('C:/Program Files/Mozilla Firefox/firefox.exe')
  11. driver = webdriver.Firefox(firefox_binary=binary, capabilities=capabilities, executable_path="C:/geckodriver.exe")
  12. driver.get("https://vk.com/mcdapp")
  13.  
  14. username = driver.find_element_by_id("quick_email")
  15. username.clear()
  16. username.send_keys("89270191276")
  17.  
  18. password = driver.find_element_by_id("quick_pass")
  19. password.clear()
  20. password.send_keys("kek200295044183")
  21.  
  22. driver.find_element_by_id("quick_login_button").click()
  23. time.sleep(10)
  24. srcToReplace = driver.find_element_by_css_selector('iframe#fXD')
  25. driver.execute_script("arguments[0].setAttribute('src', 'https://prod.front.mcdcoin.vk-apps.com/?v=1.05&vk_access_token_settings=friends%2Cstories&vk_app_id=6818829&vk_are_notifications_enabled=0&vk_is_app_user=1&vk_language=ru&vk_platform=&vk_ref=other&vk_user_id=164747949&sign=-zjJryiE5uxjGRa8etfP_q4wxD5mYZ5JMTqpzBAAAvo'); console.log('Done');", srcToReplace)
  26. time.sleep(5)
  27.  
  28. coordProduct = (1141, 962)
  29. coordBin = (1681, 946)
  30. coordShop = (1107, 322)
  31. coordEspresso = (1399, 721)
  32. coordMacBreakfast = (1381, 857)
  33. coordBuyEspresso  = (1416, 1076)
  34. coordBuyMacBreakfast= (1396, 1033)
  35. coordClose = (1797, 442)
  36.  
  37. cntEspresso = 0
  38. cntMacBreakfast = 0
  39.  
  40. buyTimeEspresso = time.time()
  41. buyTimeMacBreakfast = time.time()
  42.  
  43. time.sleep(3)
  44.  
  45. def closeShop():
  46.     pyautogui.click(coordClose())
  47.  
  48. def buyEspresso():
  49.     pyautogui.click(coordBin)
  50.     pyautogui.click(coordEspresso)
  51.     pyautogui.click(coordBuyEspresso)
  52.     closeShop()
  53.  
  54. def buyMacBreakfast():
  55.     pyautogui.click(coordBin)
  56.     pyautogui.click(coordMacBreakfast)
  57.     pyautogui.click(coordBuyMacBreakfast)
  58.     closeShop()
  59.  
  60. while 1:
  61.    
  62.     if cntEspresso < 5 and time.time() >= buyTimeEspresso:
  63.         buyEspresso()
  64.         cntEspresso += 1
  65.         buyTimeEspresso += 301
  66.    
  67.     if cntMacBreakfast < 3 and time.time()  >= buyTimeMacBreakfast:
  68.         buyMacBreakfast()
  69.         cntMacBreakfast += 1
  70.         buyTimeMacBreakfast += 1801      
  71.    
  72.     pyautogui.click(coordProduct)
  73.     pyautogui.dragTo(coordBin[0], coordBin[1],0.15, button='left')
  74.    
  75.     time.sleep(0.53)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement