按鍵精靈在微信的自動看新聞,回消息的腳本代碼:Function rndTap(x,y)Dim suijiRandomize suiji = Int(((4-0+1) * Rnd()) + 1) Tap x + suiji, y + suijiEnd Function//隨機滑屏Function rndMove(x,y,x1,y1,yanshi)Dim suijiRandomize suiji = Int(((4 - 0 + 1) * Rnd()) + 1)TouchDown x + suiji, y + suiji, 1TouchMove x1 + suiji, y1 + suiji, 1, yanshi + suiji * 100TouchUp 1End Function//多點降低相似度找色Function sfindColor(t)FindMultiColor t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[12],t[13] //t[8]相似度If t[12] = -1 And t[13] = -1 ThenFindMultiColor t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]-0.1,t[14],t[15] //t[8]相似度If t[14] > -1 And t[15] > -1 Then TracePrint t[14],t[15]t[11] = 1If t[10] = 1 Then rndTap(t[14],t[15])Delay 100End IfElse TracePrint"還是沒找到"&t[9]t[11] = 0TracePrint t[11]End IfElse TracePrint t[12],t[13]t[11] = 1If t[10] = 1 Then rndTap t[12],t[13]Delay 100End IfEnd IfEnd Function//降低相似度找圖Function sfindPic(t)Dim intX,intYFindPic t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],intX,intY //t[8]相似度If intX = -1 And intY = -1 ThenFor 2Dim intX1,intY1FindPic t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]-0.1,intX1,intY1 //t[8]相似度If intX1 > -1 And intY1 > -1 Then If t[10]=1 ThenrndTap(intX1,intY1)Delay 1500End IfExit ForElse TracePrint"還是沒找到"&t[9]t[11] = 0TracePrint t[11]End IfNextElse If t[10]=1 ThenrndTap(intx,inty)Delay 100End IfEnd IfEnd Function//重啟appFunction 重啟app(apk)KeyPress "Home"Delay 2000KillApp apkRunApp apkDelay 20000End FunctionFunction 讀取(a,路徑)//a傳入空數組接收,路徑傳入要讀取的文件路徑Dim 行數Dim 結果=array()Dim i=1行數 = File.linesnumber(路徑) //讀取該文本文件的行數TracePrint 行數 //返回行數2For 行數 結果 = File.ReadLines(路徑)//調試輸出數組TracePrint 結果[i]a[i]=結果[i]i=i+1NextEnd Function//以上為通用函數
Function runfront(t,apk)//把應用放置在前臺運行,t定義為空數組,接收運行結果If Sys.IsRunning(apk) = true Then TracePrint"app正在運行" t[1]=1 Else TracePrint "app沒有運行,即將運行app" RunApp apk Delay 3000End If If Sys.AppIsFront(apk) = True Then TracePrint "app在前臺" t[2]=1 Else TracePrint "app不在前臺" RunApp apk Delay 3000End IfEnd FunctionFunction findmenu(t,z)//找底部導航,t,z定義為空數組,接收運行結果For i=0 to 5sfindColor (menu1)Delay 500 If menu1[11] = 0 Then TracePrint"not at menu1" t[1]=0 sfindColor (menu2) Delay 500 If menu2[11] = 0 Then TracePrint"not at menu2" t[2]=0 sfindColor (menu3) Delay 500 If menu3[11] = 0 Then TracePrint"not at menu3" t[3]=0 sfindColor (menu4) Delay 500 If menu4[11] = 0 Then TracePrint"not at menu4,not at any menu!" t[4] = 0 KeyPress "Back" Delay 3000 If i = 5 Then TracePrint"back 5 times,not find yet!" z[1]=0 End If Else TracePrint"at menu4" t[4] = 1 Exit For End If Else TracePrint"at menu3" t[3] = 1 Exit For End If Else TracePrint"at menu2" t[2] = 1 Exit For End If Else TracePrint"at menu1" t[1] = 1 Exit For End IfNextEnd FunctionFunction gomenu(t,z)//去某個底部導航,t為findmenu的接收參數的數組,數組z[1]傳入要找的menu序號,z[2]傳入menu的x坐標z[3]傳入menu的y坐標If t[1] = 1 Then TracePrint "you at menu1,is going to menu",z[1] rndTap z[2],z[3]End IfIf t[4] = 1 Then TracePrint "you at menu4,is going to menu",z[1] rndTap z[2],z[3] Delay 1500 TracePrint "you at menu already"End IfIf t[3] = 1 Then TracePrint "yoyu at menu3,is going to menu",z[1] rndTap z[2],z[3] Delay 1500 TracePrint "you at menu already"End IfIf t[2] = 1 Then TracePrint "you at menu2,is going to menu",z[1] rndTap z[2],z[3] Delay 1500 TracePrint "you at menu already"End IfEnd Function
Function appdied(apk)//卡死判斷,卡死重啟,附帶返回主頁面功能,apk放入重啟包名Dim t=array()Dim t1=array()Dim z=array()findmenu t, zIf z[1] = 0 Then Delay 2000 runfront t1, apk Delay 2000 If t1[1] = 1 and t1[2] = 1 Then TracePrint "maybe it died,let's reboot" Delay 2000 重啟app (apk) Delay 8000 End IfEnd IfEnd Function Function reserchaim(reserch,aim)//點擊某處并輸入。reserch傳入輸入框坐標,aim傳入搜索的內容 TracePrint"is going to tap inputbox" rndTap reserch[1], reserch[2] Delay 2500 TracePrint"is going to input",aim InputText aim Delay 2500 End FunctionFunction dojob(aim) //做任務子程序,aim傳入輸入的內容 Dim t=array() Dim z=array(1,128,1830) findmenu (t,z) TracePrint t[1],t[2],t[3],t[4] gomenu(t,z) Dim reserch=array(849,123) reserchaim reserch, aim Delay 3000 rndTap 343,400//點擊最常使用 Delay 3000 TracePrint "you are in aim now,is going to do job" Delay 500End Function
Dim menu1=array(0,0,0,0,"61C108-222222","-13|-16|61C108-222222,-25|12|61C108-222222,-18|26|61C108-222222,-5|-40|F7F7F7-222222,88|6|F7F7F7-222222,-4|40|F7F7F7-222222,255|-4|000000-222222,265|-9|F7F7F7-222222,511|-2|000000-222222",0,0.9,1,0,1,1,1,1)Dim menu2=array(0,0,0,0,"61C108-222222","-23|0|61C108-222222,1|-43|61C108-222222,14|-17|F7F7F7-222222,4|10|F7F7F7-222222,247|-24|000000-222222,261|-26|F7F7F7-222222,532|-8|000000-222222,547|-4|F7F7F7-222222",0,0.9,2,0,1,1,1,1)Dim menu3=array( 0,0,0,0,"F7F7F7-222222","-17|6|61C108-222222,0|-15|61C108-222222,-35|-11|F7F7F7-222222,1|34|F7F7F7-222222,27|21|F7F7F7-222222,262|-3|000000-222222,270|-11|F7F7F7-222222,-263|-12|020202-222222,-274|-13|F7F7F7-222222",0,0.9,3,0,1,1,1,1) Dim menu4=array(0,0,0,0,"61C108-222222","2|-41|61C108-222222,-18|2|61C108-222222,-10|-17|F7F7F7-222222,14|-14|F7F7F7-222222,-238|-19|000000-222222,-250|-17|F7F7F7-222222,-533|-25|000000-222222,-539|-34|F7F7F7-222222,-778|-20|000000-222222",0,0.9,4,0,1,1,1,1)
Function readcontent(x,y,i)//x,y傳入新聞所在坐標,i傳入向下滑動500像素的次數 TracePrint "is going to read the content" Delay 1000 rndTap x, y TracePrint"wait for content loading " Delay 10000 For i rndMove 364, 1890, 338, 1390, 1500 Delay 2000 Next TracePrint"read content success" Delay 1000End FunctionFunction job1()//從首頁到讀完新聞全過程appdied ("com.tencent.mm")Delay 5000dojob ("騰訊新聞")Delay 3000readcontent(394,1771,3)KeyPress "Back"Delay 3000TracePrint"back to content list"Delay 500readcontent(400,1558,3)KeyPress "Back"Delay 3000TracePrint"back to content list"Delay 500readcontent(408,1367,3)KeyPress "Back"Delay 3000TracePrint"back to content list"Delay 500readcontent(450,1091,3)KeyPress "Back"Delay 3000TracePrint"back to content list"Delay 500TracePrint"read complete"Delay 500End FunctionFunction 勾選執行1(a)//a放入任務序列Dim 多選1多選1 = ReadUIConfig("多選框1")TracePrint ReadUIConfig("多選框1")If 多選1 = True Then job1()Else TracePrint"你沒勾選任務",aDelay 500End IfEnd Function
Function job2()Dim i=1Dim a=array()Dim b=array()讀取 a, "/sdcard/MobileAnjian/微信號.txt"Delay 2000TracePrint a[i]appdied ("com.tencent.mm")Delay 5000DoIf a[i] = null or a[i] = 0 Then Exit Do End Ifdojob (a[i])Delay 3000//寫打開聊天框之后的程序rndTap 373, 1848Delay 2000讀取 b, "/sdcard/MobileAnjian/消息.txt"Delay 2000TracePrint b[i]Delay 500If b[i] = null or b[i] = 0 Then InputText "hello,how do you do?"Delay 3000Else InputText b[i]Delay 5000End If
rndTap 1013, 1842Delay 2500
i = i + 1LoopEnd FunctionFunction 勾選執行2(a)//a放入任務序列Dim 多選2多選2 = ReadUIConfig("多選框2")TracePrint ReadUIConfig("多選框2")If 多選2 = True Then job2()Else TracePrint"你沒勾選任務",aDelay 500End IfEnd Function
勾選執行1(1)勾選執行2(2)///////////////////////////////////////////////////////圖形界面代碼:界面1:{ 功能頁面: { 多選框: { 注釋:"文字大小、高度、寬度是可選屬性,如需使用默認值,可保持值為0或直接刪除此屬性", 名稱:"多選框1", 提示內容:"閱讀騰訊新聞", 點擊響應:"函數名1", 選中:false, 文字大小:0, 高度:0, 寬度:0 }, 多選框: { 注釋:"文字大小、高度、寬度是可選屬性,如需使用默認值,可保持值為0或直接刪除此屬性", 名稱:"多選框2", 提示內容:"發送消息", 點擊響應:"函數名1", 選中:false, 文字大小:0, 高度:0, 寬度:0 }, }, 說明頁面: { 文字框: { 注釋:"文字大小、高度、寬度是可選屬性,如需使用默認值,可保持值為0或直接刪除此屬性", 名稱:"文字框1", 顯示內容:"請將微信好友的微信名或者微信號寫入mobileanjian文件夾下,微信號.txt文檔中。請將聊天內容寫入mobileanjian文件夾下,消息.txt文檔中", 文字大小:0, 高度:0, 寬度:0 }, },
}??
按鍵精靈在微信的看新聞,回消息代碼
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。