* @param {import('@e2b/desktop').Sandbox} desktop - E2B desktop sandbox * @param {number} width - The width of the window * @param {number} height - The height of the window
(desktop, width, height)
| 41 | * @param {number} height - The height of the window |
| 42 | */ |
| 43 | async function moveAround(desktop, width, height) { |
| 44 | console.log('\n> Randomly moving mouse and right clicking 5 times...') |
| 45 | for (let i = 0; i < 5; i++) { |
| 46 | const x = Math.floor(Math.random() * width) |
| 47 | const y = Math.floor(Math.random() * height) |
| 48 | await desktop.moveMouse(x, y) |
| 49 | console.log(` - Moved mouse to ${x}, ${y}`) |
| 50 | await desktop.rightClick() |
| 51 | console.log(` - Right clicked ${i}`) |
| 52 | console.log(' - Waiting 2 seconds...\n') |
| 53 | await wait(2000) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | async function main() { |
| 58 | console.log('> Waiting for electron app to be ready...') |
no test coverage detected