整理硬盘发现这些脚本,代码老旧,可能有一些错误,或者功能不全。
查看附件好友: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
点击好友并向他发信息:sendMessage.lua
r =runApp("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