薅羊毛php源码,基于AutoJs实现的薅羊毛App专业版源码大分享---更新啦

var window = floaty.rawWindow(

);

window.setPosition(0, device.height / 2)

setInterval(() => { }, 1000);

//记录按键被按下时的触摸坐标

let x = 0;

let y = 0;

//记录按键被按下时的悬浮窗位置

let windowX;

let windowY;

//移动窗口

//按下时长超过此值则执行长按等动作

let downTime = 500;

//记录定时执行器的返回id

let Timeout = 0;

window.setSize(100, 100);

window.main.setOnTouchListener(

function (view, event) {

switch (event.getAction()) {

case event.ACTION_DOWN:

x = event.getRawX();

y = event.getRawY();

windowX = window.getX();

windowY = window.getY();

//创建一个定时器用来定时执行长按操作。

Timeout = setTimeout(() => {

toast("薅羊毛线程已经被关闭!");

threads.shutDownAll();

Timeout = 0;

}, downTime);

return true

case event.ACTION_MOVE:

//移动距离过大则判断为移动状态

if (Math.abs(event.getRawY() - y) > 5 && Math.abs(event.getRawX() - x) > 5) {

//移动状态清除定时器

if (Timeout) {

//定时器存在则清除定时器。

clearTimeout(Timeout);

Timeout = 0;

};

//移动手指时调整悬浮窗位置

window.setPosition(windowX + (event.getRawX() - x), windowY + (event.getRawY() - y));

};

return true;

case event.ACTION_UP:

if (Timeout) {

//清除定时器。

clearTimeout(Timeout);

Timeout = 0;

//执行点击事件。

toast("点击");

};

return true;

}

return true

}

)

}

/**

* 贝塞尔曲线

* @param {坐标点} ScreenPoint

* @param {偏移量} Offset

*/

function bezier_curves(ScreenPoint, Offset) {

cx = 3.0 * (ScreenPoint[1].x - ScreenPoint[0].x);

bx = 3.0 * (ScreenPoint[2].x - ScreenPoint[1].x) - cx;

ax = ScreenPoint[3].x - ScreenPoint[0].x - cx - bx;

cy = 3.0 * (ScreenPoint[1].y - ScreenPoint[0].y);

by = 3.0 * (ScreenPoint[2].y - ScreenPoint[1].y) - cy;

ay = ScreenPoint[3].y - ScreenPoint[0].y - cy - by;

tSquared =Offset * Offset;

tCubed = tSquared * Offset;

result = {

"x": 0,

"y": 0

};

result.x = (ax * tCubed) + (bx * tSquared) + (cx * Offset) + ScreenPoint[0].x;

result.y = (ay * tCubed) + (by * tSquared) + (cy * Offset) + ScreenPoint[0].y;

return result;

}

你可能感兴趣的:(薅羊毛php源码)