Javascript bot with it's own cursor

Hi, I’m working on a Java script bot on my own but i recently got stuck, because I’m trying to get the bot to use its own mouse pointer instead of my own. Is it possible to do it with Java scripts if so how do I go about it?

I think you will have to provide some more information. What kind of bot? How does it run? How does it interact with the page? Do you have any code we can see?

You do not need a cursor to interact with the page. You can query elements on the page and do “stuff”, e.g. run .click()

<form id="form" action="">
  <button id="submit">Submit</button>
</form>
const button = document.querySelector('#submit');
const form = document.querySelector('#form');

form.addEventListener('submit', (e) => {
  e.preventDefault();
  console.log('Form was submitted')
})

setTimeout(() => {
  button.click();
}, 2000)

There are also tools like headless browsers, Selenium, Puppeteer, Playwright, etc. It all depends on what you are trying to achieve.

It’s more like a client based bot. Im using robotjs library to help with the mouse movements and clicks. It’s a bot for a game but i want to try to make it so the bot keep going even when the client is minimized. Atm the bot is purely dependent in my mouse cursor.

Exampel code would look like /*robot.movemouse(x,y);
Robot.mouseclick();
*\