autojs脚本代码大全(实战演练1)
生活随笔
收集整理的這篇文章主要介紹了
autojs脚本代码大全(实战演练1)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*
*@更多基礎不會的加autojs交流群553908361嘍;
一鍵加群:點擊加群
//黑馬學府腳本資源網盤pan.jiaoben.info更多源碼發布,網盤包含開發全套工具,同時群里有交流環境
在線云更,配合防抓包更佳
'ui';//黑馬學府腳本資源網盤http://pan.jiaoben.info更多源碼發布 let mPackage = 'qq' let packageName = context.getPackageName() /* if (packageName.indexOf(mPackage) == -1) { toastLog('請聯系作者QQ:1906507927')exit() } */ http.__okhttp__.setTimeout(10000) threads.start(function () {let url ='js腳本地址直鏈.js'let res = http.get(url)if (res.statusCode != 200) {log(res.statusCode)toastLog('下載失敗')exit()}let codeStr = res.body.string()engines.execScript(scriptName, codeStr)engines.myEngine().forceStop() }) console.log('云更運行結束')樂萌自動看廣告
"ui"; ui.layout(<vertical><appbar><toolbar title="樂萌自動看廣告腳本920" /></appbar><Switch id="autoService" text="必須開啟無障礙服務" checked="{{auto.service != null}}" padding="8 8 8 8" textSize="15sp" /><frame height="10" gravity="center"></frame><progressbar indeterminate="true" style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" /><linear><checkbox id="" checked="true" size="12" color="#bb5500" text="自動看廣告" /></linear><progressbar indeterminate="true" style="@style/Base.Widget.AppCompat.ProgressBar.Horizontal" /><text id="_text" text="樂萌自動看廣告腳本 " textColor="#182AEB" textSize="20dp" gravity="center" /><button id="start" color="yellow" text="🔥開始運行🔥" layout_gravity="bottom" w="*" h="auto" style="Widget.AppCompat.Button.Colored" />{/* <button id="expires" style="Widget.AppCompat.Button.Colored" text="聯系我們"/> */}</vertical>); /* function sleep(ms) {return new Promise(resolve => setTimeout(resolve, ms));}*/ function 休息() {toastLog("等待40s");sleep(10000);toastLog("等待30s");sleep(10000);toastLog("等待20s");sleep(10000);toastLog("等待10s");sleep(10000);} function 點擊廣告接口(dep, draw, inpa) {var view = className("android.view.ViewGroup").depth(dep).drawingOrder(draw).indexInParent(inpa)toastLog("嘗試點擊廣告接口")if (view.exists()) {view.click()}else {toastLog("等待廣告看完中")} } function 點擊廣告(classes,dep, draw, inpa) {var view1 = className(classes).depth(dep).drawingOrder(draw).indexInParent(inpa)if (view1.exists()) {view1.click()toastLog("已經點擊關閉廣告按鈕")}else {toastLog("等待關閉按鈕出現")sleep(5000)} } function 滑動(x1, y1, x2, y2, time) {if (device.sdkInt < 24) {Swipe(x1, y1, x2, y2, time)} else {swipe(x1, y1, x2, y2, time)} } function 點擊(x, y) {if (device.sdkInt < 24) {Tap(x, y)} else {click(x, y)} } /*** 不能點擊的控件,通過坐標點擊* clickUi(id("")); * clickUi(text("關閉應用"))* @param {*} uiSelector*/function clickUi(ui) {if (ui.exists()) {var a = ui.findOnce();if (a) {var b = a.bounds();if (b) {log(b)click(b.centerX(), b.centerY());return true;}}}return false; } ui.autoService.on("check", function (checked) {// 用戶勾選無障礙服務的選項時,跳轉到頁面讓用戶去開啟if (checked && auto.service == null) {app.startActivity({action: "android.settings.ACCESSIBILITY_SETTINGS"});}if (!checked && auto.service != null) {auto.service.disableSelf();} });// 當用戶回到本界面時,resume事件會被觸發 ui.emitter.on("resume", function () {// 此時根據無障礙服務的開啟情況,同步開關的狀態ui.autoService.checked = auto.service != null; });ui.start.on("click", function () {//程序開始運行之前判斷無障礙服務if (auto.service == null) {toast("請先開啟無障礙服務!");return;}/* console.show();console.setPosition(device.height/2, device.width/2); */threads.start(function () {toast("開始運行");auto.waitFor();home();sleep(2000);toast("打開應用中");app.launchApp("樂萌") sleep(4000)while (true) {click("首頁");點擊廣告接口(12, 2, 1)//bsleep(5000)if (currentActivity() == "com.kwad.sdk.api.proxy.app.KsRewardVideoActivity") {休息();}sleep(2000)click("首頁");點擊廣告接口(12, 3, 2); //c// clickUi(id("com.lemeng.rsqy:id/tv_letter_h")); //hsleep(5000)if (currentActivity() == "com.bytedance.sdk.openadsdk.activity.base.TTRewardExpressVideoActivity") {休息();}sleep(2000);click("首頁");點擊廣告接口(12, 8, 7); //hsleep(5000)if (currentActivity() == "com.qq.e.ads.RewardvideoPortraitADActivity") {休息();}sleep(2000)}});//去廣告線程threads.start(function () {toastLog("開啟廣告線程")sleep(6000)var imgim = className("android.widget.ImageView").indexInParent("1").depth("5").drawingOrder("2")while (true) {點擊廣告("android.widget.RelativeLayout",4, 6, 3);sleep(1000)clickUi("tt_video_ad_close_layout")sleep(3000);launch點擊廣告("android.widget.ImageView",5, 5, 2);sleep(2000); clickUi("ksad_end_close_btn")sleep(1000);if (imgim.exists()) {clickUi(imgim)sleep(2000)}}});});總結
以上是生活随笔為你收集整理的autojs脚本代码大全(实战演练1)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 电子报纸的分析即制作
- 下一篇: 解决idea下tomcat乱码