//代码来源于admin 的别踩白块代码修改 启动后按下音量上键 停止运行
auto();
requestScreenCapture();

threads.start(function ()
{
events.observeKey();
//监听音量上键按下
events.onKeyDown("volume_up", function(event){
//toast("音量上键被按下了");
console.show();
console.log("关闭");
exit();

});
});

var y = 1920 * 2 / 3;
var x = 1080 / 4;
var x0 = 1080 / 6;
var pos = [ [x0, y], [x0 + x, y], [x0 + 2 * x, y], [x0 + 3 * x, y]];
sleep(1000);
//var conut=100;
while (true)
{
var img = captureScreen();
//try {
for (let i = 0; i < 4; i++) {
let c = images.pixel(img, pos[i][0], pos[i][1]);
if (colors.red(c) < 200) {
press(pos[i][0], pos[i][1], 1);
//images.saveImage(img, "/sdcard/"+new Date()+".png");
sleep(10);

    }  
}  
//} catch (err) {}

}

@朕乃明帝别踩白块辅助 中说:

//代码来源于admin 的别踩白块代码修改 启动后按下音量上键 停止运行
auto();
requestScreenCapture();

threads.start(function ()
{
events.observeKey();
//监听音量上键按下
events.onKeyDown("volume_up", function(event){
//toast("音量上键被按下了");
console.show();
console.log("关闭");
exit();

});
});

var y = 1920 * 2 / 3;
var x = 1080 / 4;
var x0 = 1080 / 6;
var pos = [ [x0, y], [x0 + x, y], [x0 + 2 * x, y], [x0 + 3 * x, y]];
sleep(1000);
//var conut=100;
while (true)
{
var img = captureScreen();
//try {
for (let i = 0; i < 4; i++) {
let c = images.pixel(img, pos[i][0], pos[i][1]);
if (colors.red(c) < 200) {
press(pos[i][0], pos[i][1], 1);
//images.saveImage(img, "/sdcard/"+new Date()+".png");
sleep(10);

    }  
}  
//} catch (err) {}

}

  • 4
    帖子
  • 1780
    浏览

与 Auto.js 的连接断开,我们正在尝试重连,请耐心等待