Skip to content

Commit

Permalink
Merge pull request #31 from cndaqiang/dev
Browse files Browse the repository at this point in the history
体验服
  • Loading branch information
cndaqiang authored Aug 19, 2024
2 parents 7ff5a48 + f5598e8 commit 832dc61
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
Binary file removed assets/tpl1723973081723.png
Binary file not shown.
Binary file added assets/tpl1723993720207.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions tiyanfu.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
%USERPROFILE%\AppData\Local\anaconda3\python.exe -u tiyanfu.py config.ce.txt

REM config.ce.txt
REM [client]
REM # 仅在单进程时有效
REM mynode = 1
REM # 多进程时,多进程的数目
REM totalnode = 1
REM
REM LDPlayerdir = D:\GreenSoft\LDPlayer
REM LINK_dict = {
REM 1: "Android:///127.0.0.1:5557"}
; config.ce.txt
; [client]
; # 仅在单进程时有效
; mynode = 1
; # 多进程时,多进程的数目
; totalnode = 1
;
; LDPlayerdir = D:\GreenSoft\LDPlayer
; LINK_dict = {
; 1: "Android:///127.0.0.1:5557"}
19 changes: 10 additions & 9 deletions tiyanfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self):
#
self.timelimit = 60*60*2.0
# 更新时间
self.对战时间 = [0.1, 23.9]
self.对战时间 = [3.0, 4.0]

def run(self, times=0):
if not connect_status():
Expand Down Expand Up @@ -89,7 +89,7 @@ def run(self, times=0):
TimeECHO("正在更新中....")
sleep(waittime)
#
确定重启 = Template(r"tpl1723960034528.png", record_pos=(-0.001, 0.116), resolution=(960, 540))
确定重启 = Template(r"tpl1723960034528.png", record_pos=(-0.001, 0.116), resolution=(960, 540), threshold=0.9)
if self.Tool.existsTHENtouch(确定重启, "体验服.确定重启", savepos=False):
TimeECHO("确定重启")
sleep(waittime)
Expand All @@ -99,12 +99,14 @@ def run(self, times=0):
self.安装元素.append(Template(r"tpl1723551120394.png", record_pos=(0.415, 0.243), resolution=(960, 540)))
self.安装元素.append(Template(r"tpl1723551138518.png", record_pos=(-0.001, -0.033), resolution=(960, 540)))
self.安装元素.append(Template(r"tpl1723973068687.png", record_pos=(-0.017, -0.175), resolution=(960, 540)))
确定安装9 = Template(r"tpl1723973081723.png", record_pos=(-0.002, 0.157), resolution=(960, 540), target_pos=8)
self.安装按钮 = []
self.安装按钮.append(Template(r"tpl1723551120394.png", record_pos=(0.415, 0.243), resolution=(960, 540), target_pos=6))
self.安装按钮.append(Template(r"tpl1723993720207.png", record_pos=(-0.001, 0.18), resolution=(960, 540)))

安装界面, self.安装元素 = self.Tool.存在任一张图(self.安装元素, "体验服.安装元素")
确定安装 = Template(r"tpl1723551120394.png", record_pos=(0.415, 0.243), resolution=(960, 540), target_pos=6)
if 安装界面:
self.Tool.existsTHENtouch(确定安装, "确定安装", savepos=True)
self.Tool.existsTHENtouch(确定安装9, "确定安装9", savepos=True)
for i in self.安装按钮:
self.Tool.existsTHENtouch(i, f"安装按钮{i}", savepos=False)
sleep(waittime)
self.APPOB.重启APP()
#
Expand Down Expand Up @@ -156,13 +158,12 @@ def looprun(self, times=0):
leftmin = self.Tool.hour_in_span(startclock, endclock)*60.0
if leftmin > 0:
TimeECHO("剩余%d分钟进入新的一天" % (leftmin))
sleep(min(leftmin, 60)*60)
self.APPOB.关闭APP()
self.移动端.重启设备(leftmin*60)
continue
times = times+1
TimeECHO("="*10)
self.run()
self.APPOB.关闭APP()
self.移动端.关闭设备()


if __name__ == "__main__":
Expand Down

0 comments on commit 832dc61

Please sign in to comment.