local
ocr, msg = createOCR({
type =
"tesseract"
,
path =
"res/"
,
lang =
"num"
})
local
function
Mytext(a,b,c,d)
if
ocr ~=
nil
then
local
rect = {a,b,c,d}
local
diff = {
"0xffffff-0x0f0f0f"
}
local
code, text = ocr:getText({
rect = rect,
diff = diff
})
if
code ==
0
then
return
text
end
end
end
function
tap(x, y)
touchDown(
0
, x, y);
mSleep(
100
);
touchUp(
0
, x, y);
end
local
is_ok =
0
init(
"0"
,
1
)
setScreenScale(
1080
,
1920
)
local
text =
string.match
(Mytext(
583
,
652
,
1299
,
729
),
"%s*(.-)%s*$"
)
local
t,t1,t2 =
0
while
true
do
x, y = findColor({
861
,
654
,
1025
,
729
},
"0|0|0xfcffff"
,
95
,
0
,
0
,
0
)
if
x > -
1
then
local
texta =
string.match
(Mytext(
498
,
648
,
1144
,
723
),
"%s*(.-)%s*$"
)
local
k=
string.len
(texta)
local
list1={}
for i=
1
,k
do
list1[i]=
string.sub
(texta,i,i)
end
for i=
1
,k
do
if
(
string.find
(list1[i],
"z"
) ~=
nil
)
then
tap(
1413
,
717
)
end
if
(
string.find
(list1[i],
"y"
) ~=
nil
)
then
tap(
1724
,
683
)
end
if
(
string.find
(list1[i],
"x"
) ~=
nil
)
then
tap(
1554
,
844
)
end
if
(
string.find
(list1[i],
"s"
) ~=
nil
)
then
tap(
1590
,
556
)
end
end
end
end