finished up grid detection.
This commit is contained in:
parent
41d174195e
commit
1246884be9
11 changed files with 1037 additions and 19 deletions
|
|
@ -202,7 +202,7 @@ export class InputSender {
|
|||
y: start.y + dy * 0.75 + perpY * (Math.random() - 0.5) * spread,
|
||||
};
|
||||
|
||||
const steps = clamp(Math.round(distance / 15), 15, 40);
|
||||
const steps = clamp(Math.round(distance / 30), 8, 20);
|
||||
|
||||
for (let i = 1; i <= steps; i++) {
|
||||
const rawT = i / steps;
|
||||
|
|
@ -214,30 +214,30 @@ export class InputSender {
|
|||
const jitterY = i < steps ? Math.round((Math.random() - 0.5) * 2) : 0;
|
||||
|
||||
this.moveMouseRaw(Math.round(pt.x) + jitterX, Math.round(pt.y) + jitterY);
|
||||
await sleep(2 + Math.random() * 3); // 2-5ms between steps
|
||||
await sleep(1 + Math.random() * 2); // 1-3ms between steps
|
||||
}
|
||||
|
||||
// Final exact landing
|
||||
this.moveMouseRaw(x, y);
|
||||
await randomDelay(10, 25);
|
||||
await randomDelay(5, 15);
|
||||
}
|
||||
|
||||
async leftClick(x: number, y: number): Promise<void> {
|
||||
await this.moveMouse(x, y);
|
||||
await randomDelay(50, 100);
|
||||
await randomDelay(20, 50);
|
||||
this.sendMouseInput(0, 0, 0, MOUSEEVENTF_LEFTDOWN);
|
||||
await randomDelay(30, 80);
|
||||
await randomDelay(15, 40);
|
||||
this.sendMouseInput(0, 0, 0, MOUSEEVENTF_LEFTUP);
|
||||
await randomDelay(30, 60);
|
||||
await randomDelay(15, 30);
|
||||
}
|
||||
|
||||
async rightClick(x: number, y: number): Promise<void> {
|
||||
await this.moveMouse(x, y);
|
||||
await randomDelay(50, 100);
|
||||
await randomDelay(20, 50);
|
||||
this.sendMouseInput(0, 0, 0, MOUSEEVENTF_RIGHTDOWN);
|
||||
await randomDelay(30, 80);
|
||||
await randomDelay(15, 40);
|
||||
this.sendMouseInput(0, 0, 0, MOUSEEVENTF_RIGHTUP);
|
||||
await randomDelay(30, 60);
|
||||
await randomDelay(15, 30);
|
||||
}
|
||||
|
||||
async ctrlRightClick(x: number, y: number): Promise<void> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue