-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidleon.py
250 lines (194 loc) · 4.78 KB
/
idleon.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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
from pyautogui import *
import pyautogui
import time
import win32api, win32com
import random
import subprocess
import keyboard
from PIL import Image
from io import BytesIO
from PIL import ImageOps
counter = 0
upgradePosY = 347
upgradePosX = 585
def holdclick(x,y):
win32api.SetCursorPos((x,y))
pyautogui.mouseDown()
time.sleep(random.uniform(5,7.5))
def doubleclick(x,y):
win32api.SetCursorPos((x,y))
pyautogui.doubleClick()
time.sleep(random.uniform(0.1,0.5))
def click(x,y):
win32api.SetCursorPos((x,y))
pyautogui.click()
time.sleep(random.uniform(0.1, 0.5))
def tripleclick(x,y):
win32api.SetCursorPos((x,y))
pyautogui.tripleClick
time.sleep(random.uniform(0.1, 0.5))
def resetlibrarysearchbar():
subprocess.Popen(command)
time.sleep(0.5)
click(215,180)
def find_squirrel():
picture = pyautogui.screenshot(region=(164,121,1276,722))
width, height = picture.width, picture.height
for x in range(0,1276,10):
for y in range(0,722,10):
r,g,b = picture.getpixel((x,y))
if b == 126:
click(x+180, y+131)
time.sleep(0.05)
break
def escape():
pyautogui.keyDown('escape')
time.sleep(random.uniform(0.25, 0.50))
pyautogui.keyUp('escape')
def change_world():
pyautogui.keyDown('m')
time.sleep(random.uniform(0.25, 0.50))
pyautogui.keyUp('m')
click(153,188)
time.sleep(random.uniform(0.25, 0.50))
click(652,834)
nombreJuego = ("Legends of Idleon MMO")
steam_path = "C:\Program Files (x86)\Steam\steam.exe"
command = [steam_path]
#search and open the game from steam library
subprocess.Popen(command)
time.sleep(1)
click(233,58)
click(83,185)
pyautogui.typewrite(nombreJuego)
time.sleep(0.5)
doubleclick(78,244)
#waiting for servers
time.sleep(20)
#set to windowed full screen
click(1364, 249)
time.sleep(2)
#select elemental sorcerer char
click(659, 786)
#press play
click(1760,760)
time.sleep(random.uniform(5, 7))
#close random event menu
click(144,447)
#load original image
image = Image.open('claim.PNG')
#search image on screen
location = pyautogui.locateOnScreen('claim.PNG', confidence= 0.8)
print("Location:", location)
time.sleep(1)
#check if the image was found
if location is not None:
#take a screenshot of screen region
left, top = location[0], location[1]
width, height = image.width, image.height
screenshot = pyautogui.screenshot(region=(left, top, width, height))
#Compare original image with screenshot
similarity = image == screenshot
print("Similarity:", similarity)
time.sleep(2)
if similarity is not None:
#click claim button
click(location[0], location[1])
print("Image was found")
else:
print('image was not found')
#click codex
click(1385,980)
#click quick ref
click(1170,214)
#click ez access
click(912,843)
#loop for claim ez access stuff
while counter < 2:
win32api.SetCursorPos((707, upgradePosY))
click(707, upgradePosY)
counter += 1
upgradePosY += 95
time.sleep(0.1)
if counter == 2:
counter = 0
break
#click arcade
click(1318,583)
#claim arcade balls
click(1556,75)
#launch arcade balls
holdclick(1724,970)
time.sleep(random.uniform(1.2, 1.5))
#waiting for arcade minigame
time.sleep(random.uniform(20, 20.5))
#close arcade upgrades menu
click(1626,165)
#close arcade
click(1814,72)
time.sleep(random.uniform(1,1.5))
#click codex button
click(1385,980)
#click gaming menu
click(1717,557)
#click harvest all button
click(1338,84)
time.sleep(random.uniform(2,2.5))
#click sprinkler
click(1171,501)
#click harvest all button
click(1338,84)
time.sleep(random.uniform(2,2.5))
#Squirrel claim acorn function
find_squirrel()
time.sleep(random.uniform(6,7))
#click fertilizer upgrades
click(1648,201)
#fertilizer upgrades loop
while counter < 3:
win32api.SetCursorPos((upgradePosX, 507))
click(upgradePosX, 507)
counter += 1
upgradePosX += 370
time.sleep(0.1)
if counter == 3:
counter = 0
break
#close gaming menu
escape()
#Select W2
pyautogui.keyDown('m')
time.sleep(random.uniform(0.25,0.5))
pyautogui.keyUp('m')
click(133,307)
#Teleport to W2 Town
click(680,348)
time.sleep(random.uniform(1,2.5))
click(652,834)
time.sleep(random.uniform(1,2.5))
#click cauldron
click(395,741)
time.sleep(random.uniform(3, 3.2))
#click liquid menu
click(297,102)
#Select 1st gem purchase
click(598,376)
time.sleep(random.uniform(0.5,0.6))
#buy it 3 times
for _ in range(3):
click(1233,616)
#Select 2st gem purchase
click(1390,498)
click(1103,422)
click(598,376)
time.sleep(random.uniform(0.5,0.6))
#buy it 3 times
for _ in range(3):
click(1233,616)
change_world()
#close game
time.sleep(2)
click(1894,13)
time.sleep(0.5)
#reset library search bar
resetlibrarysearchbar()