forked from boluokk/e7Helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
139 lines (137 loc) · 4.41 KB
/
main.lua
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
-- 系统时间
time = systemTime
-- https://gitee.com/boluokk/e7-helper/raw/master/release/ 废弃(被屏蔽了)
-- https://gitcode.net/otato001/e7hepler/-/raw/master/
-- https://gitea.com/boluoii/e7Helper/raw/branch/master/
-- 热更源
update_source_arr = {
'https://gitee.com/boluokk/e7_helper/raw/master/',
'https://gitea.com/boluoii/e7Helper/raw/branch/master/',
'https://gitcode.net/otato001/e7hepler/-/raw/master/',
}
update_source = table.remove(update_source_arr, math.random(1, #update_source_arr))
update_source_fallback = table.remove(update_source_arr, math.random(1, #update_source_arr))
click_start_tip = '你的star, 是作者的最大帮助'
-- apk level 限制
is_apk_old = function() return getApkVerInt() < 0 end
apk_old_warning = "怎么还有人用" .. getApkVerInt()
release_date = "03.31 11:13"
release_content = '新版竞技场UI修改, 热更开启'
-- 获取workPath
root_path = getWorkPath() .. '/'
-- 禁止热更新
hotupdate_disabled = true
-- log 日志显示在左下角
-- true stoat 打印
-- false print 打印
logger_display_left_bottom = true
-- 打印当前执行到哪里了(会输出某个图色名)
detail_log_message = not logger_display_left_bottom
-- 禁用测试
disable_test = true
-- 截图延迟
capture_interval = 0
-- 游戏代理识图间隔
game_running_capture_interval = 3
-- 所有配置文件名称
fileNames = {'config.txt',
'fightConfig.txt',
'bagConfig.txt',
'functionSetting.txt',
'advSetting.txt'}
-- 点击延迟
tap_interval = 0
-- app运行时间
app_is_run = time()
--server pkg name
server_pkg_name = {
["国服"] = 'com.zlongame.cn.epicseven',
['B服'] = 'com.zlongame.cn.epicseven.bilibili',
['国际服'] = 'com.stove.epic7.google',
}
-- 当前服务器
current_server = "国际服"
-- wait 间隔
wait_interval = .3
-- 是否异常退出
is_exception_quit = false
-- UI配置完毕
ui_config_finish = false
-- 已经进入过游戏首页
isBack = false
-- loggerID
logger_ID = nil
-- 获取状态码
sgetNumberConfig = function (key, defval) return tonumber(getNumberConfig(key, defval)) end
-- 是否是刷书签
is_refresh_book_tag = sgetNumberConfig('is_refresh_book_tag', 0)
-- 当前任务
current_task_index = sgetNumberConfig("current_task_index", 0)
-- 异常退出次数
exception_count = sgetNumberConfig('exception_count', 1)
-- 当前账号任务
current_task = {}
-- 检查游戏状态 10s
check_game_status_interval = 10 * 1000
-- 检查图色识别时间
getMillisecond = function (secound) return secound * 1000 end
-- 单位秒
check_game_identify_timeout = getMillisecond(15)
-- 其他ssleep间隔
other_ssleep_interval = 1
-- 单任务休息时间
single_task_rest_time = 5
-- 开源说明手册地址
open_resource_doc = 'https://boluokk.github.io/e7Helper/'
-- 全局关卡次数(用来代理的时候提示: 代理中 1/100)
global_stage_count = 0
-- 打印配置信息
print_config_info = false
-- 分辨率 720x1280
-- 或者 1280x720
local disPlayDPI = 320
displaySizeWidth, displaySizeHeight = getDisplaySize()
require("point")
require('path')
require("util")
require("userinterface")
require("test")
-- 异常处理
setEventCallBack()
-- 用户配置是否关闭热更
if not hotupdate_disabled then
hotupdate_disabled = uiConfigUnion({'advSetting.txt'})['关闭热更']
end
local scriptStatus = sgetNumberConfig("scriptStatus", 0)
-- 热更新开始
if scriptStatus == 0 then
consoleInit()
initLocalState()
initPostCheckProcess()
slog(click_start_tip, 3)
slog('最近更新时间: '..release_date)
slog('最近更新内容: '..release_content or '暂无')
if not hotupdate_disabled then hotUpdate() end
sui.show()
else
setNumberConfig("scriptStatus", 0)
-- 加载本地配置
current_task = uiConfigUnion(fileNames)
local configReTryCount = current_task['重试次数'] or 5
-- 多次异常关闭脚本
-- 退出游戏还是重启游戏 ?
if exception_count > configReTryCount then
slog('连续'..configReTryCount..'次异常退出')
setNumberConfig("exception_count", 1)
exit()
else
setNumberConfig("exception_count", exception_count + 1)
end
if is_refresh_book_tag == 1 then
path.刷书签(sgetNumberConfig("refresh_book_tag_count", 0))
elseif is_refresh_book_tag == 2 then
path.升3星狗粮()
else
path.游戏开始()
end
end