Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYX committed Jul 3, 2024
1 parent 42acfe0 commit 0ffaf29
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
4 changes: 2 additions & 2 deletions actions/character.csv
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ dot,,,1
����,,,5
����,,,3
����,"ͬг,����",,1
����,,,5
����,"�滤,����",����ع鲻��ʽ,3
����,,"�ع鲻��ʽ,����ʽ,�鲻��ʽ",5
����,"�滤,����",,3
����,,,1
����,,,5
����,,,3
Expand Down
45 changes: 23 additions & 22 deletions diver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from collections import defaultdict

# 版本号
version = "v7.11"
version = "v7.13"


class DivergentUniverse(UniverseUtils):
Expand Down Expand Up @@ -457,10 +457,6 @@ def event(self):
start = self.now_event == event_id[1]
self.now_event = event_id[1]
print('event_id:', event_id)
if self.debug and event_id[0] == -1:
print(self.ts.res)
while 1:
time.sleep(1)
if '事件' not in self.merge_text(self.ts.find_with_box([92, 195, 54, 88])):
return

Expand All @@ -472,6 +468,10 @@ def event(self):
self.click((self.tx, self.ty))
# 事件选择界面
elif self.check("star", 0.1828, 0.5000, mask="mask_event", threshold=0.965):
if self.debug and event_id[0] == -1:
print(self.ts.res)
while 1:
time.sleep(1)
tx, ty = self.tx, self.ty
self.ts.forward(self.screen)
clicked = 0
Expand Down Expand Up @@ -585,23 +585,24 @@ def align_event(self, key, deep=0):
if abs(event_text - 950) > 40:
self.press(key,0.2)
event_text_after = self.find_event_text()
if event_text_after == 0:
return
sub = event_text - event_text_after
if key == 'a':
sub = -sub
print('sub:', sub)
if sub < 60:
sub = 100
if sub < 200:
sub = int((event_text_after - 950) / min(150, sub))
sub = min(5, max(-5, int(sub)))
for _ in range(sub):
self.press('d',0.2)
time.sleep(0.1)
for _ in range(-sub):
self.press('a',0.2)
time.sleep(0.1)
if event_text_after:
sub = event_text - event_text_after
if key == 'a':
sub = -sub
print('sub:', sub)
if sub < 60:
sub = 100
if sub < 200:
sub = int((event_text_after - 950) / min(150, sub))
sub = min(5, max(-5, int(sub)))
for _ in range(sub):
self.press('d',0.2)
time.sleep(0.1)
for _ in range(-sub):
self.press('a',0.2)
time.sleep(0.1)
else:
self.press('a' if key == 'd' else 'd', 0.2)
self.forward_until(['事件','奖励','遭遇','交易'], timeout=2.5, moving=0)
else:
if deep < 3:
Expand Down
2 changes: 1 addition & 1 deletion utils/diver/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def find_with_box(self, box=None, redundancy=10, forward=0, mode=0):
if box[3]==540 or box[3] == 350 and self.father.debug:
tm = str(int(time.time()*100)%1000000)
cv.imwrite('img/'+tm+'.jpg',self.father.screen[box[2]:box[3],box[0]:box[1]])
cv.imwrite('img/'+tm+'w.jpg',self.filter_non_white(self.father.screen[box[2]:box[3],box[0]:box[1]]))
cv.imwrite('img/'+tm+'w.jpg',self.filter_non_white(self.father.screen[box[2]:box[3],box[0]:box[1]], mode=mode))
ans = []
for res in self.res:
if box is None:
Expand Down

0 comments on commit 0ffaf29

Please sign in to comment.