本文共 2968 字,大约阅读时间需要 9 分钟。
转:
运行脚本需要在手机上安装Auto.js工具
下载地址下载Auto.js超链接
(无超链接按钮点击下方) https://wangzic.lanzous.com/iO34ohm0gje复制到JS中打开即可
var height = device.height;var width = device.width;var my_taobao = desc("我的淘宝");var task_list = text("赚喵币");var open_button=1;//"去参加"任务开启,默认开启,要关闭请自行改成0var open_button_money=1;//"去兑换"任务开启,默认开启,要关闭请自行改成0function appRun() //打开淘宝{ var version = device.release; toast("分辨率:"+width+"*"+height+"nn安卓"+version); sleep(3000); launchApp("手机淘宝"); toast("打开手机淘宝中..."); sleep(5000);}function randomTime(time1,time2)//产生随机时间{ var random_time = random(time1,time2); return random_time;}function swipeChange(move_length,duration,sleep_time) //模拟滑动{ swipe(width / 2 , height - move_length , width / 2,0,duration); sleep(sleep_time);}function bakcTo_Lisk() //“去浏览”到首页回到任务列表{ if(my_taobao.exists()) { getTask(); }}function autoSwipe_Another(button_text) //“去兑换”任务{ textContains(button_text).findOne().click(); sleep(1000); toast("完成"+"["+button_text+"]"+"任务"); sleep(1000);}function autoSwipe(button_text) //任务完成过程{ while(textContains(button_text).exists()) { if(button_text=="去观看") { textContains(button_text).findOne().click(); sleep(19000); back(); continue; } if(button_text=="去兑换") { autoSwipe_Another(button_text); continue; } if(button_text=="去参加") { sleep(5000); back(); continue; } toast(button_text + "正在进行"); textContains(button_text).findOne().click(); swipeChange(500,1000,1000); swipeChange(800,1000,2000); swipeChange(800,1000,3000); swipeChange(1000,1000,4000); sleep(randomTime(5000,8000)); if(desc(" 任务完成").exists()) { sleep(1000); back(); bakcTo_Lisk(); } else { sleep(4000); back(); bakcTo_Lisk(); } sleep(3000); } toast("完成"+"["+button_text+"]"+"任务"); sleep(2500);}function autoFinish() //安排每个任务{ if(text("签到").exists()) { text("签到").findOne().click(); sleep(2000); toast("签到成功"); sleep(2000); } toast("完成[签到]任务"); sleep(2000); if(open_button==1) { autoSwipe("去参与"); } if(open_button_money==1) { autoSwipe("去兑换"); } autoSwipe("去浏览"); autoSwipe("去逛逛"); autoSwipe("去浏览"); autoSwipe("去搜索"); toast("结束");}function getTask() //跳转到任务界面————>任务列表{ className("android.view.View").desc("搜索").clickable(true).findOne().click() sleep(200); id("searchEdit").setText("超级星秀猫"); sleep(2000); desc("搜索").findOne().click(); toast("正跳转到任务界面..."); task_list.waitFor(); //等待“领喵币”按钮出现 sleep(2000);//缓冲 toast("正在打开任务列表"); task_list.click(); sleep(2000);}function main() //主函数{ appRun(); getTask(); autoFinish();}main()
## 还在完善中
转:
转载地址:http://wszbz.baihongyu.com/