-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcookieclicker.py
60 lines (46 loc) · 1.14 KB
/
cookieclicker.py
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
from pyautogui import *
import pyautogui
import time
import win32api, win32com
import random
import subprocess
def click(x,y):
win32api.SetCursorPos((x,y))
pyautogui.click()
time.sleep(random.uniform(0.1,0.5))
def doubleclick(x,y):
win32api.SetCursorPos((x,y))
pyautogui.doubleClick()
time.sleep(random.uniform(0.1,0.5))
counter = 0
upgradePosY = 387
nombreJuego = ("Cookie Clicker")
steam_path = "C:\Program Files (x86)\Steam\steam.exe"
command = [steam_path]
#opening steam and searching for game
subprocess.Popen(command)
time.sleep(1)
click(233,58)
click(83,185)
pyautogui.typewrite(nombreJuego)
time.sleep(0.5)
doubleclick(78,244)
time.sleep(7)
#loop for buildings upgrades
while counter < 6:
win32api.SetCursorPos((1749, upgradePosY))
click(1749, upgradePosY)
counter += 1
upgradePosY += 63
time.sleep(0.1)
if counter == 6:
break
time.sleep(random.uniform(0.8, 1))
#close game
click(1903,7)
#reset steam search bar
subprocess.Popen(command)
time.sleep(0.5)
click(215,180)
#run bitheroes.script
subprocess.run(['python','C:\\Users\\CarlosJD\\Documents\\AutoFarmer\\bitheroes.py'])