滴滴货运「自动抢单」脚本源码,部分源码展示 :
function 启动脚本() {
var 最低价格 = (!ui.最低价格.text().trim() == "") ? parseInt(ui.最低价格.text().trim()) : 50;
var 最高价格 = (!ui.最高价格.text().trim() == "") ? parseInt(ui.最高价格.text().trim()) : 500;
var 刷新等待最低 = (!ui.刷新等待最低.text().trim() == "") ? parseInt(ui.刷新等待最低.text().trim()) : 3;
var 刷新等待最高 = (!ui.刷新等待最高.text().trim() == "") ? parseInt(ui.刷新等待最高.text().trim()) : 5;
alert("启动成功 ~", "脚本已开启\n请进入【抢单大厅】界面\n脚本会自动识别运行\n别忘记开启:听单中!")
text("听单中").waitFor()
toast("开始抢单中...");
sleep(3000);
滴滴货运抢单(最低价格, 最高价格, 刷新等待最低, 刷新等待最高);
}
function get_rmb(type, rmb_bottom) {
var rmb = text("¥").packageName("com.didiglobal.express.driver")
.boundsInside(device.width / 2, rmb_bottom, device.width, device.height)
.visibleToUser(true).findOnce();
// console.log(rmb);
if (rmb) {
var rmb_depth, rmb_drawingOrder, rmb_indexInParent;
rmb_depth = rmb.depth();
rmb_drawingOrder = rmb.drawingOrder();
rmb_indexInParent = rmb.indexInParent();
// console.log(rmb_depth, rmb_drawingOrder, rmb_indexInParent);
// console.log(rmb_depth, rmb_drawingOrder + 1, rmb_indexInParent + 1);
var qian = packageName("com.didiglobal.express.driver")
.depth(rmb_depth)
// .drawingOrder(rmb_drawingOrder + 1)
.indexInParent(rmb_indexInParent + 1)
.boundsInside(device.width / 2, rmb_bottom, device.width, device.height)
.visibleToUser(true).findOnce();
// console.log(qian);
if (qian) {
var jine = qian.text();
// console.log("金额:" + jine);
if (type == 1) {
var qian_bounds = {};
var qian_right = qian.bounds().right;
var qian_bottom = qian.bounds().bottom;
// console.log(qian_right, qian_bottom);
qian_bounds = {
right: qian_right,
bottom: qian_bottom,
};
return qian_bounds;
} else if (type == 2) {
var qian_x = qian.bounds().centerX();
var qian_y = qian.bounds().centerY();
click(qian_x, qian_y);
} else {
return jine;
}
} else {
return false;
}
} else {
return false;
}
}
© 版权声明
THE END