Skip to content

Commit

Permalink
Merge branch 'main' of github.com:CHNZYX/Auto_Simulated_Universe
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYX committed Aug 30, 2023
2 parents 66a6be6 + adf1a57 commit 172ca2d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
1 change: 1 addition & 0 deletions align_angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def main(cnt=10, safe=0, ang=[1,1,3], su=None):
ax += 100
ay += j
su.multi *= ax / ay
su.multi += 1e-9
config.angle = str(su.multi)
config.save()
if safe == 0:
Expand Down
Binary file modified imgs/auto_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/f.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/tp.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 20 additions & 10 deletions states.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
pyautogui.FAILSAFE=False

# 版本号
version = "v5.25 stable"
version = "v5.30 beta"


class SimulatedUniverse(UniverseUtils):
Expand Down Expand Up @@ -143,11 +143,14 @@ def route(self):
if self._stop:
break
self.get_screen()
if begin and not self.check("f", 0.4240,0.4407) and not self.check("abyss/1",0.8568,0.6769):
#self.click_target('imgs/auto_2.jpg',0.9,True) # 如果需要输出某张图片在游戏窗口中的坐标,可以用这个
'''
if begin and not self.check("f", 0.4437,0.4231) and not self.check("abyss/1",0.8568,0.6769):
begin = 0
self.press("F4")
time.sleep(0.6)
self.get_screen()
# self.click_target('imgs/floor/ff1.jpg',0.9,True) # 如果需要输出某张图片在游戏窗口中的坐标,可以用这个
'''
res = self.normal()
# 未匹配到图片,降低匹配阈值,若一直无法匹配则乱点
if res == 0:
Expand Down Expand Up @@ -188,7 +191,7 @@ def normal(self):
bk_lst_changed = self.lst_changed
self.lst_changed = time.time()
# 战斗界面
if self.check("auto_2", 0.3755,0.0333):
if self.check("c", 0.9464,0.1287, threshold=0.985) or self.check("auto_2", 0.0583,0.0769):
# 需要打开自动战斗
if self.check("c", 0.9464,0.1287, threshold=0.985):
self.press('v')
Expand Down Expand Up @@ -244,17 +247,17 @@ def normal(self):
time.sleep(1)
return 1
# F交互界面
elif self.check("f", 0.4240,0.4407):
elif self.check("f", 0.4437,0.4231) or self.check("f",0.4448,0.4231):
# is_killed:是否是禁用交互(沉浸奖励、复活装置、下载装置)
is_killed = 0
time.sleep(0.4)
self.get_screen()
if self.check("f", 0.4240,0.4407):
if self.check("f", 0.4437,0.4231) or self.check("f",0.4448,0.4231):
for _ in range(4):
img = self.check('z',0.3182,0.4333,mask="mask_f",large=False)
img = self.check('z',0.3344,0.4241,mask="mask_f",large=False)
text = self.ts.sim_list(self.tk.interacts,img)
if not text:
img = self.check('z',0.3302,0.4503,mask="mask_f",large=False)
if text is None:
img = self.check('z',0.3365,0.4231,mask="mask_f",large=False)
text = self.ts.sim_list(self.tk.interacts,img)
if text is not None:
break
Expand Down Expand Up @@ -452,6 +455,8 @@ def normal(self):
self.click((0.1083, 0.1009))
if con:
self.get_level()
else:
self.floor = 0
self.floor_init=1
elif self.check("start", 0.6594, 0.8389):
self.fail_count=0
Expand Down Expand Up @@ -519,7 +524,12 @@ def normal(self):
time.sleep(2)
self.click((0.3750,0.9398))
time.sleep(2)
self.click((0.1562,0.2250))
self.click((0.3750,0.8398))
pyautogui.scroll(-1)
time.sleep(0.1)
pyautogui.scroll(-1)
time.sleep(0.3)
self.click((0.1562,0.1250))
elif self.check("enhance", 0.9208,0.9380):
time.sleep(1.5)
for i in [None,(0.7984,0.6824),(0.6859,0.6824)]:
Expand Down
8 changes: 4 additions & 4 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,13 @@ def get_level(self):
time.sleep(1)

def goodf(self):
if not self.check("f", 0.4240,0.4407):
if not self.check("f", 0.4437,0.4231) and not self.check("f",0.4448,0.4231):
return False
img = self.check('z',0.3182,0.4333,mask="mask_f",large=False)
img = self.check('z',0.3344,0.4241,mask="mask_f",large=False)
text = self.ts.sim_list(self.tk.interacts,img)
if text is None:
# 使用新坐标重新尝试
img = self.check('z',0.3302,0.4503,mask="mask_f",large=False)
img = self.check('z',0.3365,0.4231,mask="mask_f",large=False)
text = self.ts.sim_list(self.tk.interacts,img)
is_killed = text in ['沉浸','紧锁','复活','下载']
return text is not None and not is_killed
Expand Down Expand Up @@ -665,7 +665,7 @@ def get_direc_only_minimap(self):
self.press('w',0.3)
if self.mini_state==1 and self.floor==11:
pyautogui.click()
time.sleep(0.6)
time.sleep(0.8)
pyautogui.click()
time.sleep(0.6)
self.press('w',0.3)
Expand Down

0 comments on commit 172ca2d

Please sign in to comment.