天天看點

腳本精靈一些腳本

整理硬碟發現這些腳本,代碼老舊,可能有一些錯誤,或者功能不全。

檢視附件好友:nearByFriend.lua

當時測試可以打開附件好友的個人資訊

function click(x,y)
    touchDown(x,y)
    mSleep(200)
    touchUp(x,y)
end
r=runApp("com.tencent.mm","com.tencent.mm.plugin.nearby.ui.NearbyFriendsUI");
if r == 0 then
    delay = 3000;

    mSleep(delay);
    while true 
    do
        local currX=300;
        local currY=500;
        click(currX,currY)
        mSleep(3000)

        bid,class = frontAppBid(); 
        if class == ".plugin.profile.ui.ContactInfoUI" then
             toast("使用者")
       else
       break;
    end
    break;
    end
end      

添加好友:addFriend.lua

當時測試可以調出添加好友視窗,螢幕大小不一樣,可能失效

runApp("com.tencent.mm","com.tencent.mm.plugin.subapp.ui.pluginapp.AddMoreFriendsUI")
touchDown(300,350)
touchUp(300,350)
inputText("18217269772")
touchDown(300,350)
touchUp(300,350)      

查詢正在運作app的id及程序名稱:getFrontAppClassName.lua

for i=1,10 do
mSleep(5000)
bid,class = frontAppBid(); 
dialog(bid.."\r\n"..class);
end      
"com.tencent.mm");
if r ==0 then
delay = 3*1000;
btnFindPos = {x=720,y=108};
mSleep(delay);
touchDown(btnFindPos.x,btnFindPos.y);
touchUp(btnFindPos.x,btnFindPos.y);

inputText("\b的黎波裡");
mSleep(delay);
friendPos = {x=108,y=520};
touchDown(friendPos.x,friendPos.y);
touchUp(friendPos.x,friendPos.y);
mSleep(delay);
touchDown(108,1850);
touchUp(108,1850);
mSleep(delay);
inputText("\b這是輔助腳本精靈發來的消息");
touchDown(1000,1850);
touchUp(1000,1850);
closeApp("com.tencent.mm");
else
dialog("無法打開微信!")
end      

繼續閱讀