-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackpack_relist_script.py
More file actions
91 lines (75 loc) · 2.7 KB
/
backpack_relist_script.py
File metadata and controls
91 lines (75 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import os
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
import time
from alive_progress import alive_bar
import tkinter as tk
from tk_gui import gui
def main():
root = tk.Tk()
userGui = gui(root)
root.mainloop()
try:
steamUser = userGui.steamUser
steamPass = userGui.steamPass
steamGuard = userGui.steamGuard
steamID64 = userGui.steamID64
except:
print("No inputs found")
exit()
# open up log-in screen
chromedriver = "chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)
driver.get("https://backpack.tf/login")
# enter username and password and mobile auth
username = driver.find_element(By.ID,"steamAccountName")
username.send_keys(steamUser)
time.sleep(1)
password = driver.find_element(By.ID,"steamPassword")
time.sleep(1)
password.send_keys(steamPass, Keys.TAB, Keys.ENTER)
time.sleep(1)
auth = driver.find_element(By.ID,"twofactorcode_entry")
auth.send_keys(steamGuard)
time.sleep(1)
auth.send_keys(Keys.ENTER)
driver.implicitly_wait(10)
try:
sign_in = driver.find_element(By.ID,"imageLogin")
sign_in.send_keys(Keys.ENTER)
except:
print("Signing in was not required")
time.sleep(5)
#infinite loop to check every 2700 seconds for items to bump
actionChains = ActionChains(driver)
while True:
x=1
i=1
while x>0:
trade_url="https://backpack.tf/classifieds?page={}&steamid={}".format(i,steamID64)
driver.get(trade_url)
driver.implicitly_wait(10)
elements = driver.find_elements(By.CSS_SELECTOR,"a.btn.btn-xs.btn-bottom.btn-default.listing-relist.listing-bump")
x = len(elements)
print("{}: Page".format(i))
print("{} items to bump".format(x))
time.sleep(1)
for element in elements:
actionChains.context_click(element).perform()
time.sleep(5)
i+=1
driver.get("https://backpack.tf/classifieds?page=i&steamid={}".format(steamID64))
print("Relisting complete")
print("Sleeping for 2700 seconds")
with alive_bar(54000) as bar:
for i in range(54000):
time.sleep(0.05)
bar()
if __name__ == "__main__":
main()