按键精灵在微信的自动看新闻,回消息的脚本代码: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 }, },
}
按键精灵在微信的看新闻,回消息代码
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...