Me and my friend made a game and we are trying to create a bot for it.
Its repeating the same action over and over again. But the mouse always follows the same path from point A to point B.
Is there a way to make the mouse move from point A to point B and never make it use the same path?
This is the code for the bot:
// import the robotjs library
var robot = require('robotjs');
function main() {
console.log("Starting...");
sleep(4000);
// basic infinite loop
while (true) {
robot.moveMouse(764, 557);
robot.mouseClick();
robot.moveMouse(356, 432);
sleep(8000);
}
}
function sleep(ms) {
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
}
main();
Im new with coding so please have some mercy ;)