本帖最后由 yanglr 于 2021-8-26 20:57 编辑
installLrPkg("/mnt/sdcard/Pictures/as.lr")
ret,res=showUIEx("as.ui",00,400,480,400)
if ret == 2 then
exitScript()
else
if res.idedit_gs == "" or res.idedit_wenj=="" or res.idedit_hyjm =="" or res.idedit_hyjm1=="" or res.idedit_huy=="" or res.idedit_huy1 =="" or res.idedit_xx =="" or res.idedit_xx1 =="" then
toast("参数未填完整")
sleep(2000)
restartScript()
else
gss=res.idedit_gs; wenj=res.idedit_wenj;yc1=res.idedit_hyjm;yc1_1=res.idedit_hyjm1;yc2=res.idedit_huy;yc2_2=res.idedit_huy1;yc3= res.idedit_xx;yc3_3=res.idedit_xx1
toast("配置读取完毕")
sleep(2000)
end
end
function 重载()
if cmpColorEx("178|571|1877F2,181|571|FFFFFF,299|586|FFFFFF,301|586|1877F2,226|572|1877F2,228|574|FFFFFF,207|604|1877F2,207|605|FFFFFF,162|589|1877F2",0.9) == 1 then
toast("重新载入")
sleep(3000)
tap(212,562)
sleep(2000)
swipe(200,200,200,600,300)
sleep(3000)
end
end
function 限制()
intX,intY = findMultiColor(70,315,232,372,"1F1F1F","1|1|1F1F1F|1|4|1F1F1F|1|7|FFFFFF|1|9|1F1F1F|-10|9|1F1F1F|-10|14|FFFFFF|15|3|FFFFFF|17|2|1F1F1F|29|8|1F1F1F|31|8|FFFFFF|44|-2|1F1F1F|44|-4|FFFFFF|79|13|FFFFFF|75|13|1F1F1F",0,1)
if intX>-1 and intY>-1 then
exitScript()
end
end
function hs(path)
path1 = "/mnt/sdcard/Pictures/".. path ..".txt"
if fileExist(path1) then
local stab =readFile(path1)
local ta,j ={},1
for lien in io.lines(path1) do
ta[j]=lien
j=j+1
end
math.randomseed(tostring(os.time()):reverse():sub(1,9))
local n =math.random(1,#ta )
return ta[n]
else
toast("请检查重试!")
sleep(5000)
exitScript()
end
end
hs(wenj) --首先检查文件存不存在
function 延迟(yc1,yc2)
print (yc1,yc2)
yc1=tonumber(yc1)
yc12=tonumber(yc2)
math.randomseed(tostring(os.time()):reverse():sub(1,9))
local n=math.random(yc1,yc2)
sleep(n*1000)
end
gs=0 --初始化个数
gss=tonumber(gss)
while gss>gs do
collectgarbage("setpause", 200)
collectgarbage("setstepmul", 200)
collectgarbage("collect")
hideHUD(id)
local id=createHUD()
showHUD(id,"总:"..gss .." 完成: " .. gs .. " 余:"..gss-gs,18,"0xffff0000","0xFF000000",0,170,30,00,0)
重载()
限制()
local intX,intY = findMultiColor(20,95,173,605,"050505","0|3|FFFFFF|11|1|FFFFFF|13|1|050505|33|14|050505|36|14|FFFFFF|113|0|050505|115|0|FFFFFF",0,1) --中
local intX1,intY1 = findMultiColor(1,97,209,655,"FFFFFF","-2|0|050505|-2|4|FFFFFF|-4|7|050505|3|16|050505|3|17|FFFFFF|167|8|FFFFFF|166|5|050505|163|16|050505|163|13|FFFFFF",0,1)
if intX>-1 or intX1>-1 then
print ("13123")
local index,intX,intY = findColor(391,95,473,676,"216FDB",0,1)
if intX>-1 and intY>-1 then
toast("刷新")
sleep(3000)
swipe(200,200,200,500,400)
sleep(1500)
index,intX,intY = findColor(204,301,231,794,"1877F2",0,0.95)
if intX>-1 and intY>-1 then
toast("进入")
tap(intX-80,intY)
延迟(yc1,yc1_1)
swipe(200,600,200,300,500)
sleep(5000)
end
end
end
collectgarbage("collect")
if cmpColorEx("45|64|FFFFFF,43|64|050505,32|66|FBFBFB,32|69|050505",0.95) == 1 then
toast(" ")
sleep(5000)
local intX,intY = findMultiColor(11,107,468,797,"1877F2","-4|3|FFFFFF|-12|4|FFFFFF|-12|6|1877F2|45|1|1877F2|43|1|FFFFFF|45|14|2A82F3|43|14|EDF4FE|25|14|1877F2",0,0.95)
sleep(100)
local intX1,intY1 = findMultiColor(6,98,456,798,"1877F2","0|2|F1F6FE|-7|2|FFFFFF|-7|4|1877F2|-7|6|FFFFFF|20|2|1877F2|22|2|FFFFFF|20|5|FFFFFF|17|7|1877F2|15|10|FFFFFF|23|11|FFFFFF|23|12|1877F2|24|9|1877F2|30|5|1877F2|30|2|FFFFFF|30|6|F8FBFF|30|8|1877F2|30|11|FFFFFF",0,0.9)
if intX>-1 and intY>-1 then
延迟(yc2,yc2_2)
tap(intX,intY)
sleep(5000)
elseif intX1>-1 then
延迟(yc2,yc2_2)
tap(intX1,intY1)
sleep(5000)
end
end
local intX,intY = findMultiColor(4,654,450,800,"050505","0|-2|FFFFFF|6|-5|FFFFFF|-12|3|050505|-12|5|FFFFFF|-12|6|050505|-10|74|050505|0|65|050505|-19|84|050505",0,0.95)
sleep(100)
local intX1,intY1 = findMultiColor(1,631,462,800,"050505","0|1|FFFFFF|0|3|050505|12|-3|050505|12|-5|FFFFFF|16|-7|050505|18|-9|FFFFFF|7|-5|FFFFFF|3|71|050505",0,0.90)
if intX>-1 and intY>-1 then
sleep(500)
tap(intX,intY)
sleep(5000)
swipe(200,200,200,780,300)
sleep(1000)
local intX,intY = findMultiColor(15,287,447,796,"1877F2","0|-1|F5F9FE|-6|1|1978F2|-6|-1|FFFFFF|-4|4|1877F2|-4|6|FFFFFF|-8|4|FFFFFF|19|-2|1877F2|68|9|E4EFFD",0,0.95)
if intX==-1 then
swipe(200,600,200,300,300)
end
elseif intX1>-1 then
sleep(500)
tap(intX1,intY1)
sleep(5000)
swipe(200,200,200,780,300)
sleep(1000)
local intX intX,intY = findMultiColor(15,287,447,796,"1877F2","0|-1|F5F9FE|-6|1|1978F2|-6|-1|FFFFFF|-4|4|1877F2|-4|6|FFFFFF|-8|4|FFFFFF|19|-2|1877F2|68|9|E4EFFD",0,0.95) --发送消息
if intX==-1 then
swipe(200,600,200,300,300)
end
end
local intX,intY = findMultiColor(335,740,478,798,"E8EFF4","3|0|0084FF|9|0|EBF0F4|11|0|0D8AFE|4|6|0084FF|47|8|FFFFFF|50|8|0084FF|55|8|FFFFFF|58|8|0084FF",0,1)
if intX>-1 and intY>-1 then
sleep(2000)
local index,intx,inty = findColor(439,389,449,722,"0084FF",0,0.98)
if intx>-1 and inty>-1 then
sleep(3000)
tap(1,32)
sleep(5000)
fg=true
else
tap(intX-30,intY)
延迟(yc3,yc3_3)
input = hs(wenj)
inputText(input)
sleep(2000)
end
end
if fg==true or gs1+1 == gs then --解决返回问题回回到主界面
local intX,intY = findMultiColor(20,95,173,605,"050505","0|3|FFFFFF|11|1|FFFFFF|13|1|050505|33|14|050505|36|14|FFFFFF|113|0|050505|115|0|FFFFFF",0,1) --中
local intX1,intY1 = findMultiColor(1,97,209,655,"FFFFFF","-2|0|050505|-2|4|FFFFFF|-4|7|050505|3|16|050505|3|17|FFFFFF|167|8|FFFFFF|166|5|050505|163|16|050505|163|13|FFFFFF",0,1) --英
local index,intx,inty = findColor(391,95,473,676,"216FDB",0,1) --找到旁边的全部
if intX==-1 and intx==-1 or intX1==-1 and intx ==-1 then
sleep(100)
if cmpColorEx("45|64|FFFFFF,27|64|050505,35|71|FFFFFF,31|68|050505,33|58|050505,36|58|FFFFFF,37|63|050505,37|61|FFFFFF",0.90) == 1 then
tap(32,66)
fg=nil ; gs1=nil
end
else
fg,gs1=nil
end
end
end
以上代码变动,可能不完整;仅供参考!
|