Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- import tkinter
- from tkinter import *
- #keeps track of which 'tab' program is on
- #1 Food log
- #2 Money Tracker
- def buildWindow(windowName, windowTitle, size):
- windowName=Tk()
- windowName.title(windowTitle)
- windowName.geometry(size)
- bankButton = Button(windowName, text="AutoBank", width=15, height=2, command=autoBank).place(x=345, y=0)
- goldButton = Button(windowName, text="Gold Finder", width=15, height=2, command=goldFind).place(x=000, y=0)
- forumButton = Button(windowName, text="Forums", width=15, height=2, command=forumFunc).place(x=685, y=0)
- print(windowName)
- mainloop()
- from bs4 import BeautifulSoup
- import time
- import random
- def goldFind():
- goldButton.text("N/A")
- def forumFunc():
- browser = webdriver.Chrome()
- browser.get(('http://fusezed.com'))
- def autoBank():
- #minTime=int(input('Enter minimum amount of time to wait before banking Hint: try 4900 '))
- #maxTime=int(input('Enter maximum amount of time to wait before banking Hint: try 5900 '))
- for i in range(6):
- usernameStr =
- passwordStr =
- print("Attempting purchase " + str(i))
- #login Process
- browser = webdriver.Chrome()
- browser.get(('http://Kingsofchaos.com'))
- time.sleep(15)
- username = browser.find_element_by_name('usrname')
- username.send_keys(usernameStr)
- password = browser.find_element_by_name('peeword')
- password.send_keys(passwordStr)
- loginButton = browser.find_elements_by_class_name('login_input')
- loginButton[2].click()
- #Sleep to make sure selenium doesnt fuck up
- time.sleep(15)
- #Navigating to armory
- browser.get(('http://Kingsofchaos.com/armory.php'))
- time.sleep(15)
- content = browser.page_source
- #Scraping html for gold table
- soup = BeautifulSoup(content, "lxml")
- table = soup.find("td", attrs={"class":"menu_cell_repeater_vert"})
- #Parsing table and manipulating string to get amount of gold
- tableRow = table.find("tr")
- goldString = (tableRow.get_text())
- goldString=(goldString[31:])
- goldString=goldString[:-19]
- goldString = goldString.replace(',', '')
- amount2buy = (int(goldString)//450000)
- #navigating armory and purchasing weapons
- purchaseField = browser.find_element_by_name('buy_weapon[72]')
- purchaseField.clear()
- purchaseField.send_keys(amount2buy)
- PurchaseButton = browser.find_element_by_name('buybut')
- PurchaseButton.click()
- time.sleep(15)
- print('Purchase ' + str(i) + " Complete")
- browser.close()
- print("browser closed")
- i=i+1
- #Random time range to perform banking
- time.sleep(random.randrange(minTime,maxTime))
- buildWindow(windowName='master',windowTitle = "Swolo's yolo kit", size= "800x50")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement