-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiIphone帮派任务
98 lines (87 loc) · 1.79 KB
/
iIphone帮派任务
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
-- 适用屏幕参数
SCREEN_RESOLUTION="640x1136";
SCREEN_COLOR_BITS=32;
ISFIND = 0
UI = {
{ 'TextView{-自动任务测试阶段-}' },
{ 'TextView{-师门|帮派}' },
{ 'DropList{第一栏|第二栏|第三栏}', 'TaskBar', '点击的任务栏:' }, -- 借鉴用户 qq33357486
{ 'TextView{-QQ:72012-}' },
};
-- 点击函数封装
function click(x, y)
touchDown(0, x, y)
mSleep(100)
touchUp(0)
end
-- 找图函数封装
function findImage(dir,msg)
mSleep(100)
x, y = findImageFuzzy(dir, 70)
if x ~= -1 and y ~= -1 then -- 如果x和y不等与-1,说明找到了
ISFIND = 1
mSleep(100)
click(x+5,y+5)
notifyMessage(msg) -- 显示yes
end
end
-- 点击任务栏
function quest()
x,y =333,996
if TaskBar == "第一栏" then
x = 439
y = 960
elseif TaskBar == "第二栏" then
x = 333
y = 996
elseif TaskBar == "第三栏" then
x = 260
y = 996
end
click(x,y);
end
-- 点击购买-img
function buy()
findImage("/var/梦幻西游/购买.bmp", "购买")
end
-- 点击使用-img
function use()
findImage("/var/梦幻西游/使用.bmp", "使用")
end
-- 点击上交-img
function handin()
findImage("/var/梦幻西游/上交.bmp", "上交")
end
-- 点击确定-img
function yes()
findImage("/var/梦幻西游/确定.bmp", "确定")
end
-- 帮派任务-img
function gang()
findImage("/var/梦幻西游/帮派任务.bmp", "帮派任务")
end
function doImg()
if ISFIND == 0 then
buy();--购买img
end
if ISFIND == 0 then
handin();--上交img
end
if ISFIND == 0 then
yes();--确定img
end
if ISFIND == 0 then
use();--使用img
end
if ISFIND == 0 then
gang();--帮派任务img
end
end
-- 主入口函数
function main()
while true do
quest();
mSleep(1000)
doImg();
end
end