本文當筆記用的,此腳本啥比用
運行環境
* 本腳本使用lua編寫,運行於觸動精靈平台
* 手機需要root,模擬器不需要
* 平台搭建[跳轉](https://www.cnblogs.com/freeyouth/p/11685087.html)
function slip(d)----從下到上滑動手機屏幕
toast("滑動");
w , h = 400,1100;
os.execute("input mouse swipe "..w.." "..h.." "..w.." "..h+d)
end
function doubleclick(x,y)----雙擊點贊
touchInputDown(x,y);
mSleep(50);
touchInputUp(x,y);
mSleep(50);
touchInputDown(x,y);
mSleep(50);
touchInputUp(x,y);
mSleep(1000);
end
function choose()----隨機確定是否點贊
i = math.random(0,1);
if i==0 then
return true
else
return false
end
end
flag = runApp("com.smile.gifmaker")----開啟軟件
mSleep(5*1000)
if r==1 then
toast("啟動失敗");
mSleep(3000);
lua_exit();
mSleep(1000);
end
for i=0,10,1 do
slip(-700);
mSleep(1000);
if choose() then
doubleclick(500,500)
end
end
closeApp("com.smile.gifmaker")
----1080*1920
總結
local w,h = getDisplaySize()
dialog(w..":"..h)
snapshot("test.png",0,0,w,h