求一个最简单的脚本,我是外卖骑手,每天抢单需要用手指在屏幕上由上往下滑动,用来刷新新来的订单,每天手指与屏幕摩擦无数次,指头都磨破皮了,求大神解决我的这个困惑。

就是从上至下滑动的脚本,两秒划一次,无限划就可以了

@爆米花爆爆 可以的,留微信,我加你微信!

auto.waitFor();
var window = floaty.window(
<frame>
<button id="action" text="开始" w="90" h="40" bg="#77444444"/>
</frame>
);

var Akeep = false,
Time = 0,
ji = 40;
setInterval(function() {
if (Akeep) {
Time++;
if (Time == ji) {
Time = 0;
swipe(500, 500, 500, 1500, 200);
}
}
}, 50);

var execution = null;

var x = 0,
y = 0;
var windowX, windowY;
var downTime;

window.action.setOnTouchListener(function(view, event) {
switch (event.getAction()) {
case event.ACTION_DOWN:
x = event.getRawX();
y = event.getRawY();
windowX = window.getX();
windowY = window.getY();
downTime = new Date().getTime();
return true;
case event.ACTION_MOVE:

        window.setPosition(windowX + (event.getRawX() - x),
            windowY + (event.getRawY() - y));
        
        if (new Date().getTime() - downTime > 1500) {
            exit();
        }
        return true;
    case event.ACTION_UP:
        
        if (Math.abs(event.getRawY() - y) < 5 && Math.abs(event.getRawX() - x) < 5) {
            onClick();
        }
        return true;
}
return true;

});

function onClick() {
if (window.action.getText() == '开始') {
Akeep = true;
window.action.setText('停止');
} else {
Akeep = false;
Time=0;
window.action.setText('开始');
}
}

  • 6
    帖子
  • 1484
    浏览

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