-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrichang.lua
More file actions
150 lines (130 loc) · 3.9 KB
/
Copy pathrichang.lua
File metadata and controls
150 lines (130 loc) · 3.9 KB
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
function enter_main_function()
local current_state = check_current_state()
if current_state == 1 then
elseif current_state == 11 then
elseif current_state == 21 then
my_toast(id, '正在战斗中!等待完成战斗进入主界面。。')
end_combat(0)
mSleep(2000)
return enter_main_function()
elseif current_state == 22 then
my_toast(id, '在探索副本')
tap(80, 100) --退出探索本
mSleep(1000)
tap(1244, 842)
mSleep(1000)
return enter_main_function()
elseif current_state == 3 then
my_toast(id, '在探索界面')
local x, y = myFindColor(顶点退出)
sysLogLst(x, y)
tap(x, y)
mSleep(3000)
return enter_main_function()
else
local redcross_x, redcross_y = myFindColor(右上红叉)
if redcross_x > -1 then
tap(redcross_x, redcross_y)
mSleep(1000)
return enter_main_function()
else
my_toast(id, '请手动进入主界面!')
mSleep(2000)
return enter_main_function()
end
end
end
-----------------------------------------------------送心--------------------------------------------------
function give_friend_heart()
enter_main_function()
mSleep(1000)
sub_function:case('friend')
mSleep(1000)
local song_t = 0
local shou_t = 0
while song_t < 10 or shou_t < 10 do
local song_x, song_y = myFindColor(送心)
local shou_x, shou_y = myFindColor(收心)
if song_x > -1 and song_t < 10 then
tap(song_x, song_y)
song_t = song_t +1
my_toast(id, '送心'..song_t..'/10')
mSleep(300)
elseif shou_x > -1 and shou_t < 10 then
tap(shou_x, shou_y)
shou_t = shou_t +1
my_toast(id, '收心'..shou_t..'/10')
mSleep(300)
else
swip(500, 955, 500, 475)
mSleep(300)
end
end
end
-----------------------------------------------------买厕纸--------------------------------------------------
function buy_toilet_paper()
enter_main_function()
mSleep(1000)
sub_function:case('shop')
tap(844, 405)
mSleep(500)
local xunzhang_num = dialogInput("请输入兑换勋章的个数(或勋章总数)", "0", "确认");
local target_num = math.floor(xunzhang_num/20)
local choice = dialogRet("您想要兑换"..xunzhang_num..'个勋章,共计'..target_num..'厕纸。 确定兑换吗?', "确定", "取消", "", 0);
sysLog(choice)
if choice == 1 then
lua_exit()
else
mSleep(1000)
local counter = 0
while counter < target_num do
tap(821, 651)
mSleep(1000)
tap(1037, 938)
mSleep(1000)
tap(1000, 1052)
mSleep(1000)
counter = counter + 1
my_toast(id, '厕纸兑换'..counter..'/'..target_num)
end
end
end
-----------------------------------------------------日常汇总--------------------------------------------------
function sub_richang(richang_results)
if richang_results['100'] == '0' then
give_friend_heart()
elseif richang_results['100'] == '1' then
buy_toilet_paper()
end
mSleep(1000)
end
function main_richang(richang_ret,richang_results)
if richang_ret==0 then
toast("您选择了取消,停止脚本运行")
lua_exit()
end
sysLog(richang_results['101'])
if richang_results['101'] == '4' then
sub_richang(richang_results)
enter_main_function()
lua_exit()
--肝狗粮,
elseif richang_results['101'] == '0' then
ts_ret,ts_results = showUI("tansuo.json")
sub_richang(richang_results)
return main_tansuo(ts_ret,ts_results)
elseif richang_results['101'] == '1' then
tupo_ret,tupo_results = showUI("tupo.json")
sub_richang(richang_results)
return main_tupo(tupo_ret,tupo_results)
elseif richang_results['101'] == '2' then
yqfy_ret,yqfy_results = showUI("yqfy.json")
sub_richang(richang_results)
return main_yqfy(yqfy_ret,yqfy_results)
elseif richang_results['101'] == '3' then
enter_yeyuanhuo()
yyh_ret,yyh_results = showUI("yeyuanhuo.json")
sub_richang(richang_results)
return main_yeyuanhuo(yyh_ret,yyh_results)
end
end