学习通自动翻书脚本
15秒,有的20秒才能翻一次,很操蛋。一本书要几个小时,十几页开始书就加载不出来,一片白,想跳转也不行,无语。于是写了个脚本。
AutoxJs:不需要Root权限 的 JavaScript 自动化软件.
官网 开源地址
AutoxJs脚本:(根据设备尺寸自行修改控制滑动的sml_move函数)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
| auto(); console.show(true) console.setTitle("学习通自动翻书", "#058dff", 40); console.setCanInput(false); console.setLogSize(18); console.setPosition(150, 500); console.info(Ftime() + " 启动成功!");
let timer = 0
while (1) { randomTime(15 * 1000) sml_move(882, 1325, 209, 1333, 450); console.log(Ftime() + " 第" + timer + "次"); timer += 1 }
function randomTime(t) { if (!t) { t = 1000 } var float = Math.random() * 0.4 * t; var sleep_time = float + t sleep(sleep_time) }
function Ftime(time) { if (time) { return new java.text.SimpleDateFormat("MM-dd-hh-mm-ss").format(new Date(time)); } else { return new java.text.SimpleDateFormat("yyyy-MM-dd--hh时-mm分-ss秒").format(new Date()); } }
function bezier_curves(cp, t) { cx = 3.0 * (cp[1].x - cp[0].x); bx = 3.0 * (cp[2].x - cp[1].x) - cx; ax = cp[3].x - cp[0].x - cx - bx; cy = 3.0 * (cp[1].y - cp[0].y); by = 3.0 * (cp[2].y - cp[1].y) - cy; ay = cp[3].y - cp[0].y - cy - by;
tSquared = t * t; tCubed = tSquared * t; result = { "x": 0, "y": 0 } result.x = (ax * tCubed) + (bx * tSquared) + (cx * t) + cp[0].x; result.y = (ay * tCubed) + (by * tSquared) + (cy * t) + cp[0].y; return result; }
function sml_move(qx, qy, zx, zy, time) { var xxy = [time]; var point = []; var dx0 = { "x": qx, "y": qy }
var dx1 = { "x": random(qx - 100, qx + 100), "y": random(qy, qy + 50) } var dx2 = { "x": random(zx - 100, zx + 100), "y": random(zy, zy + 50), } var dx3 = { "x": zx, "y": zy } for (var i = 0; i < 4; i++) {
eval("point.push(dx" + i + ")");
}
for (let i = 0; i < 1; i += 0.08) { xxyy = [parseInt(bezier_curves(point, i).x), parseInt(bezier_curves(point, i).y)]
xxy.push(xxyy);
}
gesture.apply(null, xxy); }
|