Advertisement
Guest User

Untitled

a guest
Oct 30th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.30 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver.common.by import By
  3. from selenium.webdriver.support.ui import WebDriverWait
  4. from selenium.webdriver.support import expected_conditions as EC
  5. import tkinter
  6. from tkinter import *
  7.  
  8.  
  9.  
  10.  
  11. #keeps track of which 'tab' program is on
  12. #1 Food log
  13. #2 Money Tracker
  14.  
  15. def buildWindow(windowName, windowTitle, size):
  16.     windowName=Tk()
  17.     windowName.title(windowTitle)
  18.     windowName.geometry(size)
  19.     bankButton = Button(windowName, text="AutoBank", width=15, height=2, command=autoBank).place(x=345, y=0)
  20.     goldButton = Button(windowName, text="Gold Finder", width=15, height=2, command=goldFind).place(x=000, y=0)
  21.     forumButton = Button(windowName, text="Forums", width=15, height=2, command=forumFunc).place(x=685, y=0)
  22.     print(windowName)
  23.     mainloop()
  24.    
  25.  
  26.  
  27. from bs4 import BeautifulSoup
  28. import time
  29. import random
  30. def goldFind():
  31.     goldButton.text("N/A")
  32. def forumFunc():
  33.     browser = webdriver.Chrome()
  34.     browser.get(('http://fusezed.com'))  
  35.    
  36. def autoBank():
  37.         #minTime=int(input('Enter minimum amount of time to wait before banking Hint: try 4900  '))
  38.         #maxTime=int(input('Enter maximum amount of time to wait before banking Hint: try 5900  '))
  39.    
  40.         for i in range(6):
  41.             usernameStr =
  42.             passwordStr =
  43.             print("Attempting purchase " + str(i))
  44.             #login Process
  45.             browser = webdriver.Chrome()
  46.             browser.get(('http://Kingsofchaos.com'))
  47.             time.sleep(15)
  48.             username = browser.find_element_by_name('usrname')
  49.             username.send_keys(usernameStr)
  50.             password = browser.find_element_by_name('peeword')
  51.             password.send_keys(passwordStr)
  52.             loginButton = browser.find_elements_by_class_name('login_input')
  53.             loginButton[2].click()
  54.  
  55.             #Sleep to make sure selenium doesnt fuck up
  56.             time.sleep(15)
  57.  
  58.  
  59.  
  60.  
  61.  
  62.             #Navigating to armory
  63.  
  64.             browser.get(('http://Kingsofchaos.com/armory.php'))
  65.             time.sleep(15)
  66.             content = browser.page_source
  67.  
  68.             #Scraping html for gold table
  69.             soup = BeautifulSoup(content, "lxml")
  70.             table = soup.find("td", attrs={"class":"menu_cell_repeater_vert"})
  71.             #Parsing table and manipulating string to get amount of gold
  72.             tableRow = table.find("tr")
  73.             goldString = (tableRow.get_text())
  74.             goldString=(goldString[31:])
  75.             goldString=goldString[:-19]
  76.             goldString = goldString.replace(',', '')
  77.             amount2buy = (int(goldString)//450000)
  78.  
  79.             #navigating armory and purchasing weapons
  80.             purchaseField = browser.find_element_by_name('buy_weapon[72]')
  81.             purchaseField.clear()
  82.             purchaseField.send_keys(amount2buy)
  83.             PurchaseButton = browser.find_element_by_name('buybut')
  84.             PurchaseButton.click()
  85.             time.sleep(15)
  86.             print('Purchase ' + str(i) + " Complete")
  87.             browser.close()
  88.             print("browser closed")
  89.             i=i+1
  90.             #Random time range to perform banking
  91.             time.sleep(random.randrange(minTime,maxTime))
  92.  
  93. buildWindow(windowName='master',windowTitle = "Swolo's yolo kit", size= "800x50")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement