06.jpg

一、Buff自动扫货脚本


Buff自动扫货脚本

"auto"; //系统配置初始化
auto.waitFor();
//初始化屏幕亮度  
device.setBrightnessMode(0);
device.setBrightness(9);
//初始化一些计数器和参数
var num1 = 0;
var check = 0;
var freq = 1;
var time = 1;
var sheep = 0;
var failNum = 0;
var successNum = 0;
var waitTime=0;
var price = rawInput("老板开个价吧!", "0.13");//自行设置收购价
var limit = rawInput("老板这票干多少个就收手?", "888");//注意csgo库存上限默认是1000
var ifFull = true;
//以下是自动购买脚本主体
autoBuy();

function autoBuy() {
    while (ifFull) {
        console.show();
        id("batchPurchaseButton").findOne().click();
        id("buyPriceEdit").findOne().setText(price);
        //price.setText("0.13");

        var a = null;
        while (a == null) {
            sleep(500);
            //a=className("android.widget.TextView").depth(2).drawingOrder(10).row(-1).findOne(1000);
            a = textContains("符合要求").findOnce();
            if (a !== null) {
                log(a.text());
                var textA = a.text();
            }
            waitTime = waitTime + 1;
            //log(waitTime);
            if (waitTime > 20) {
                waitTime = 0;
                log("网络不佳,返回重试")
                back();
                sleep(500);
                autoBuy();
            }
        }

        num1 = parseInt(textA);
        if (num1 > 0) {//一个简单的刷新频率控制逻辑,货少的时候自动降低查询频率
            freq = 1;
            id("buyCountEdit").findOne().setText(num1);
            log("输入购买数量:" + num1 + "件");
            buy(num1);
        } else if (freq < 2) {
            freq = freq + 0.1;
            back();
        } else if (freq >= 2) {
            freq = freq + 0.05;
            back();
        }

        if (successNum > limit) {
            log("仓库快满了,停止收购")
            ifFull = false;
            break;
        }
        waitTime = random(5000 * freq, 8000 * freq);
        var showTime = parseInt(waitTime / 1000);
        waitTime = 0;
        log("下次查询将在" + showTime + "秒后进行");
        checkRun();
        sleep(showTime * 1000);
    }
}

function buy(num1) {
    this.num1 = num1;
    log("批量购买" + num1 + "件");
    btn1 = id("submit").findOnce();
    btn2 = className("android.widget.Button").text("确认付款").findOnce();
    var n = 9;
    while (btn2 == null) {
        if (btn1 != null) {//利用每次循环的0.5秒sleep计时每隔5s提交一次
            n = n + 1
            if (n % 10 == 0) {
                var textInfo="尝试提交订单";
                purchase(btn1,textInfo);
            }
        }

        btn2 = id("actionButton").text("确认付款").findOnce();
        //btn1 = id("submit").findOnce();
        //log(btn2,btn1);
        if (btn2 != null) {
            log("订单提交成功啦");
            time = 1;
            break;
        }
        sleep(500);
    }
 
    btn3 = className("android.widget.Button").text("确定").findOnce();
    n = 9;
    var firstRun=true;
    while (btn3 == null) {
        if (btn2 != null) {
            n = n + 1
            if (n % 10 == 0) {
                textInfo="尝试支付订单";
                purchase(btn2,textInfo);
            }
        }

        btn2 = id("actionButton").text("确认付款").findOnce();
        btn3 = className("android.widget.Button").text("确定").findOnce();    
        if (btn3 != null) {
            log("购买完毕");
            time = 1;
            break;
        }
          if(btn2==null&&firstRun==true){
              log("订单支付成功啦!");
              log("购买中…");
              firstRun=false;
              }
        sleep(500);
    }
    className("android.widget.Button").depth(2).drawingOrder(3).row(-1).waitFor();
    sleep(500);
    var fail = className("android.widget.TextView").textContains("购买失败").findOnce();
    if (fail != null) {
        log("购买失败,返回");
        failNum = failNum + num1;
        className("android.widget.Button").depth(2).drawingOrder(3).row(-1).findOne().click();
        sleep(500);
        back();
        sleep(500);
        fail = className("android.widget.TextView").textContains("购买失败").findOnce();
        if (fail != null) { //特殊情况下返回失效,再次确认
            fail.click();
            sleep(500);
            back();
        }
        sleep(500);
        autoBuy();
    } else if (fail == null) {
        className("android.widget.Button").depth(2).drawingOrder(3).row(-1).waitFor();
        sleep(500);
        var partfailNotice = className("android.widget.TextView").textContains("部分失败").findOnce();
        if (partfailNotice != null) {
            log("订单有部分失败了");
            var partSuccessNum = Number(partfailNotice.text().replace(/[^0-9]/ig,""));          
            log("成功购买了" + num1 + "个中的" + partSuccessNum + "个");
            successNum = successNum + partSuccessNum;
            failNum = failNum + num1 - partSuccessNum;
        } else if (partfailNotice == null) {
            log("全部购买成功!");
            successNum = successNum + num1;
        }
        log("总计购买成功" + successNum + "/" + limit + "件,失败" + failNum + "件");
        className("android.widget.Button").depth(2).drawingOrder(3).row(-1).findOne().click();
        //sleep(1000);
        className("android.widget.Button").text("创建报价").waitFor();
        className("android.widget.Button").text("创建报价").findOne().click();
        log("开始创建报价");
        log("等待报价创建完成…");
        waitTrade();
    }
}

function waitTrade() {
    var case1 = className("android.widget.Button").text("关闭").findOnce();
    var case2 = className("android.widget.Button").text("查看购买记录").findOnce();

    if (case1 || case2) {
        log("报价创建完毕,购买成功");
    }

    while (case1 == null && case2 == null) {
        var warn = className("android.widget.TextView").text("购买失败").findOnce();
        if (warn != null) {
            className("android.widget.Button").text("确定").findOne().click();
            break;
        }
        sleep(2000);
        sheep = sheep + 1;
        log(sheep + "只小羊…");//给无聊的人一点窥屏乐趣
        waitTrade();
        break;
    }

    if (case1 != null) {
        log("发现关闭按钮");
        case1.click();
    } else if (case2 != null) {
        log("发现查看购买记录按钮");
        case2.click();
        sleep(3000);
        back();
    }
}

function purchase(btn,textInfo) {
    this.btn = btn;
    this.textInfo=textInfo;
    btn.click();
    log(textInfo + time + "次");
    time = time + 1;
}

function checkRun() {
    check = check + 1;
    if (check >= 20) {
        log("保持后台常驻");
        check = 0;
        launch("org.autojs.autojs");
        waitForPackage("org.autojs.autojs");
        launch("com.netease.buff");
        waitForPackage("com.netease.buff");
    }
}


此脚本用于Buff App安卓客户端,使用方法:进入自己想要扫货的界面,点击执行脚本即可。可手动设置收购价格,收购数量,目前有个小瑕疵:
自动重试提交订单是按while循环次数做的计时,可能每隔5s多一些时间提交订单,不够准确,有大佬提供更精确的方法在此感谢!
如果有疑问或者觉得好用,欢迎回复交流

二、steam手机客户端自动勾选确认脚本


idConteains("multiconf_").untilFind().click()

没错,就一句,自动寻找所有勾选框勾选,您只需要滑动检查价格和道具是否正确,手动确认提交一次即可。

三、Csgo存入库存组件辅助连点按键精灵脚本


csgo游戏客户端内部库存存入库存组件辅助连点按键精灵脚本

MoveTo 600, 500
Delay 5
LeftClick 1
MoveTo 960, 500
Delay 5
LeftClick 1
MoveTo 1350, 500
Delay 5
LeftClick 1
MoveTo 1730, 500
Delay 5
LeftClick 1
MoveTo 2110, 500
Delay 5
LeftClick 1
MoveTo 2500, 500
Delay 5
LeftClick 1
MoveTo 2880, 500
Delay 5
LeftClick 1
MoveTo 3240, 500
Delay 5
LeftClick 1
MoveTo 600, 940
Delay 5
LeftClick 1
MoveTo 960, 940
Delay 5
LeftClick 1
MoveTo 1350, 940
Delay 5
LeftClick 1
MoveTo 1730, 940
Delay 5
LeftClick 1
MoveTo 2110, 940
Delay 5
LeftClick 1
MoveTo 2500, 940
Delay 5
LeftClick 1
MoveTo 2880, 940
Delay 5
LeftClick 1
MoveTo 3240, 940
Delay 5
LeftClick 1
MoveTo 600, 1380
Delay 5
LeftClick 1
MoveTo 960, 1380
Delay 5
LeftClick 1
MoveTo 1350, 1380
Delay 5
LeftClick 1
MoveTo 1730, 1380
Delay 5
LeftClick 1
MoveTo 2110, 1380
Delay 5
LeftClick 1
MoveTo 2500, 1380
Delay 5
LeftClick 1
MoveTo 2880, 1380
Delay 5
LeftClick 1
MoveTo 3240, 1380
Delay 5
LeftClick 1
MoveTo 600, 1800
Delay 5
LeftClick 1
MoveTo 960, 1800
Delay 5
LeftClick 1
MoveTo 1350, 1800
Delay 5
LeftClick 1
MoveTo 1730, 1800
Delay 5
LeftClick 1
MoveTo 2110, 1800
Delay 5
LeftClick 1
MoveTo 2500, 1800
Delay 5
LeftClick 1
MoveTo 2880, 1800
Delay 5
LeftClick 1
MoveTo 3240, 1800
Delay 5
LeftClick 1


此脚本用于全部勾选一整页道具(8x4=32)用,自行手动翻页,多次执行此脚本搭配快速勾选道具,然后手动点击“继续”按钮一次即可快速存入大量道具。
最后是steam市场网页chrome插件,批量上架,可以使用:

STEAM ECONOMY ENHANCER

自行下载TamperMonkey之类的脚本管理器搭配使用即可,选择库存需要上架道具>手动上架1个物品>选择价格和数量,提交耐心等待完成即可,建议一次不超过250个,搭配上面提到的steam手机客户端自动勾选确认脚本确认上架。
脚本请合理使用,封号自负。

Last modification:February 19, 2021
If you think my article is useful to you, please feel free to appreciate