-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path036cookieClickerBot.py
More file actions
52 lines (43 loc) · 1.04 KB
/
036cookieClickerBot.py
File metadata and controls
52 lines (43 loc) · 1.04 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
from selenium import webdriver
from selenium.webdriver.common.by import By
chrome_driver_path = ""
driver = webdriver.Chrome(executable_path=chrome_driver_path)
url = 'https://orteil.dashnet.org/cookieclicker/'
driver.get(url)
cookie = driver.find_element(By.XPATH,'//*[@id="bigCookie"]')
def gameLogic():
#upgradesFirst
buyUpgrade()
#buy products second
buyProducts()
def buyUpgrade():
for i in range(3):
try:
upgrade = driver.find_element(By.XPATH,'//*[@id="upgrade0"]')
upgrade.click()
except:
None
def buyProducts():
for i in range(18,-1,-1):
try:
product = driver.find_element(By.XPATH,f'//*[@id="product{i}"]')
for i in range(3):
product.click()
except:
None
def clickGoldenCookie():
try:
golden_cookie = driver.find_element(By.XPATH,f'//*[@id="shimmers"]')
golden_cookie.click()
except:
None
counter = 1
while True:
if counter%1000 == 0:
gameLogic()
counter = 1
elif counter%499 == 0:
clickGoldenCookie()
else:
cookie.click()
counter += 1