{"_id":"@aw1875/ghost-cursor","_rev":"3-95b7d2385d1573cd41223e759d188c1e","name":"@aw1875/ghost-cursor","dist-tags":{"latest":"1.1.10"},"versions":{"1.1.8":{"name":"@aw1875/ghost-cursor","version":"1.1.8","description":"Move your mouse like a human in puppeteer or generate realistic movements on any 2D plane","repository":{"type":"git","url":"git+https://github.com/Xetera/ghost-cursor.git"},"main":"lib/spoof.js","types":"lib/spoof.d.ts","scripts":{"prepare":"husky install && yarn lint && yarn build","build":"tsc","lint":"yarn ts-standard --fix","test":"exit 0"},"keywords":["bezier-curve","mouse-movement","botting"],"author":{"name":"Xetera"},"license":"ISC","dependencies":{"bezier-js":"^2.6.1"},"devDependencies":{"husky":"7","puppeteer":"13","ts-standard":"11","typescript":"4"},"gitHead":"11c047a18a1e4c7b7753a3d28e561e0b4c877ca7","bugs":{"url":"https://github.com/Xetera/ghost-cursor/issues"},"homepage":"https://github.com/Xetera/ghost-cursor#readme","_id":"@aw1875/ghost-cursor@1.1.8","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-8Ql5Qlyp3dnGj8zySGMWVGsKoKsv9j3ABzIvJAn4itNWMpRrwZ311c3jO4pxk5rirhvkyIuHIKNs1LuQduITkw==","shasum":"ec13d054fea2d173688b70526770f2fa0f1849e9","tarball":"https://registry.npmjs.org/@aw1875/ghost-cursor/-/ghost-cursor-1.1.8.tgz","fileCount":9,"unpackedSize":42254,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDHWpCRA9TVsSAnZWagAA92QP+wWPTLlSWDV+JOT4HLKR\nuipVLdnXYvDoxTxE9HWUar3J9ZXkCN1pObH0E/jAKt0zTnU356mPh5n16uK2\n2clhiyo5QpbRwevRUvoJLNSYj81a9qMkQSwcwQYBdc7wMlk/hiGXjzHmMZG3\nFi315yWdXuulsBLZbxcNb9iE1kqKLAh16kEEzrBX77e2kkgOdqxW2Qx/yJqV\neI0Y4EUdM73zuhnmOkXv6hKbG5//HtxnVgiGraa+j/bxsEvfOoNfrpN16u4U\n7I16VkcFABRLVu0pNOxiQT2y6Z3v/HEDv8/5aB96e0cf9g2TinSk19qE3Ff3\nQqJcGcwE/MWmARxkm1IoIycaVa0c7uf5MuRIUzfdTPp2bYXRKDKBeK1mYrUz\nOnSAVM/8b4OAQb0Q7gxvLZwN4m/16S8hMRtICDZZFzESko3PEmUdaWSMg0NH\nK771aKof6gNF8u6FF4V/AK4cGuqzVWfUuue2OHw6BVTc5Pq10rfh2Fn7Z6Ad\n2P7eLnoAYDNXraCSUvyfnbYbHMLneogGQYd6q1aS5ruayweyomcazjurE4kf\n2k/MVR2r7Vw0Jhejofq9KfERe9vlHQ8X4Ta6VINM84rvuAFVrFcK+z/noO3M\nASBE2NUWFf9eGuBu/Ft5yTaSLORCvxCn28Zv42DxyimQmRLHi3dC//fIyYq9\nYcVw\r\n=ZEbu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHZNRw5CKsh7eKitgELDPQsAIb/uelUZltBDsq75P6xxAiEA6sPhm7ZumKk2L4I/TCvY9Veo9sOrVYAoCQltKBHddjI="}]},"_npmUser":{"name":"aw1875","email":"aw1875@rit.edu"},"directories":{},"maintainers":[{"name":"aw1875","email":"aw1875@rit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-cursor_1.1.8_1644983721261_0.6731786492432525"},"_hasShrinkwrap":false},"1.1.9":{"name":"@aw1875/ghost-cursor","version":"1.1.9","description":"Move your mouse like a human in puppeteer or generate realistic movements on any 2D plane","repository":{"type":"git","url":"git+https://github.com/Xetera/ghost-cursor.git"},"main":"lib/spoof.js","types":"lib/spoof.d.ts","scripts":{"prepare":"husky install && yarn lint && yarn build","build":"tsc","lint":"yarn ts-standard --fix","test":"exit 0"},"keywords":["bezier-curve","mouse-movement","botting"],"author":{"name":"Xetera"},"license":"ISC","dependencies":{"bezier-js":"^2.6.1"},"devDependencies":{"husky":"7","puppeteer":"13","ts-standard":"11","typescript":"4"},"gitHead":"3dd0c3fc84635ba05cb0a30401547de31531b0ac","bugs":{"url":"https://github.com/Xetera/ghost-cursor/issues"},"homepage":"https://github.com/Xetera/ghost-cursor#readme","_id":"@aw1875/ghost-cursor@1.1.9","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-X9o4Ei4WL19886AhbJf21QUNzHh/W0Gsa7xY146dBROWK1lG/zluxkHWaANGDv4tNjP+w/7GlDYWnjBtJ1OOHw==","shasum":"c0878be509fb2182277a767aff44abf9e077a137","tarball":"https://registry.npmjs.org/@aw1875/ghost-cursor/-/ghost-cursor-1.1.9.tgz","fileCount":9,"unpackedSize":42413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDHcECRA9TVsSAnZWagAASwIP/37hb/m5z3R9phScN16K\n14Xo1q2ztKRlNokI0tkSOI3zh2K9qWS0OkZj0wM4IFyrxK0Nen9EgLy7ukqw\nPPxuDFtBakgOqg5EvgOAs5Ih6rcVzhnkkIspMD/he8sj3A+eJw/L/7cF/r8f\ny9FyIvnl1JlHQMcHCeZxlgkD5ATFZRcbrzzMaQhANOQ/IKL4RaxN8vlSoSvR\nRRhPQ2vZ54D65bPmQhqUpcvuZepvACd/ecrHan9ab25NeYdVVJClF70IT3U0\n6DM/gxgpwFi8qlOnuro0l/jTPtEzTJbGz+Q/fT6Y8Iz72YVworPCGGjS3+uV\ngFRIFdgxp04AQY8RIAHzYbW3sLjLt0LrGqNs1WrWfV3X88DWqjNPqP5+lDo8\ndv0ntdTGf79WonOFoNBrjO3xxGo1dzt5tD86+rKnjHeHskSxznvbGgyoVg5k\n+syiCaj2zhoQaiztOAecmbtU8ZwT9+NtisOTbBnOarVXYR17vT7Fr8AjO//O\nc2zyY0m+F/M076sk9OkZya5Dpek+wUYWya+GEwI/ot5Rg2+/ahrwfuJ+zsda\n1ysZyMhC7cKmx0nDx5zaMKrOWPL+oHgkMXzYmONdiDSF/b1aPWoBtd8+HLKa\n0N2rxSaucrCgaN+i6iS2W9x9PsyBe2hOQz0GI8ZWr+LCq7Q6uTWLQhOuuHwk\nPBKW\r\n=pkrl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBwJQ+8y6HEfGnLJByH/9yF7SwrFfKXr6szui2qFbQruAiEAux5XDk9pfgzrB3UCWn2iyiGiBXSswrdyxCRc9GQTiHg="}]},"_npmUser":{"name":"aw1875","email":"aw1875@rit.edu"},"directories":{},"maintainers":[{"name":"aw1875","email":"aw1875@rit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-cursor_1.1.9_1644984068419_0.5928110788705601"},"_hasShrinkwrap":false},"1.1.10":{"name":"@aw1875/ghost-cursor","version":"1.1.10","description":"Move your mouse like a human in puppeteer or generate realistic movements on any 2D plane","repository":{"type":"git","url":"git+https://github.com/aw1875/ghost-cursor.git"},"main":"lib/spoof.js","types":"lib/spoof.d.ts","scripts":{"prepare":"husky install && yarn lint && yarn build","build":"tsc","lint":"yarn ts-standard --fix","test":"exit 0"},"keywords":["bezier-curve","mouse-movement","botting"],"author":{"name":"Xetera"},"license":"ISC","dependencies":{"bezier-js":"^2.6.1"},"devDependencies":{"husky":"7","puppeteer":"13","ts-standard":"11","typescript":"4"},"gitHead":"84bb2edb071334f764225b3d2d5d528ffef4b994","bugs":{"url":"https://github.com/aw1875/ghost-cursor/issues"},"homepage":"https://github.com/aw1875/ghost-cursor#readme","_id":"@aw1875/ghost-cursor@1.1.10","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-LBi2mLhad/4KpAYfmJMUpgLT9Ftov5gGYr6lgI9l04IXl1HBlUrlerIdmdCRC6I85q4BaBLAargMa8x9QOaTmg==","shasum":"397acecdbacea110cf6f7e431ed054f1f2bee794","tarball":"https://registry.npmjs.org/@aw1875/ghost-cursor/-/ghost-cursor-1.1.10.tgz","fileCount":9,"unpackedSize":42414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDHeRCRA9TVsSAnZWagAA+TEQAJVTGhIq94Y7z3Qa9w7m\n2RDQ4HAOB33XtGvsoryElRMgnj2JNsfvmjHyPylQkkUII7F9VPiFC2FTqKDL\nAZ3DnmGHtj2Ou+LWO3pJfRAUp3hQzAVe0mTBTQ+ePkLFD0htHrCBI3avgHxH\nfgDn+mBXrVaJ59OrnpsTQhM7BHRTNfjzKMQa/l29pUysGphi+4X+f6wYE2gZ\nkvcWVvzIWG/1Jk/fynce7fN2rXBfUbZL+STXMMIwo8HBJf7xOxb+VtGkZfQU\nTwjaPmf/uS0PeZvDLO077/Ax+/GGbEwwldHzfLCpawzhzcMIAxL0RRMN8WY3\nnGjXX6xzrl1oOYfCX3L3Wf4LkMwKClCni640YdgiDeiUyGQEHqUv6FAboSKh\noHaY4gS4CHou/CxKHRlp74Wewpg2kKYzTagIws3CR0f26Pt0qWoEq0l6WjSB\nJ/cEcR8oAhFNaJznrw2oQFU95UnYYLTzCZ/zCjXtqp3jQ9D4d6XC78Gv6R7t\nVcN03YFSrVQG5LTWSplMb6R87aqSczgUdU0S0o92EtjoRafrELDkqN8wQ6ba\ntb37UoYiKiGEV8ByPdqyT1NRVBCwgnqN8gZurfyfzUpsSHJzeR1NnDToKxdF\nKqmGxh27TuLr4iBYLW7MDABkpov/Ac8RJltYU4mAEmbSh02vUgMwXCGIun8h\nFxbV\r\n=r8ut\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBfueCvGA2onxLuTzb6WAlHy5Hg1CHfJe6DoJX2ugrHkAiBpnsRYaSwUZhehB57j2r+TfEy340ua/VLuWXtZXlxDgA=="}]},"_npmUser":{"name":"aw1875","email":"aw1875@rit.edu"},"directories":{},"maintainers":[{"name":"aw1875","email":"aw1875@rit.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-cursor_1.1.10_1644984209412_0.3121369691007223"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-16T03:55:21.213Z","1.1.8":"2022-02-16T03:55:21.391Z","modified":"2022-04-04T16:49:12.565Z","1.1.9":"2022-02-16T04:01:08.604Z","1.1.10":"2022-02-16T04:03:29.562Z"},"maintainers":[{"name":"aw1875","email":"aw1875@rit.edu"}],"description":"Move your mouse like a human in puppeteer or generate realistic movements on any 2D plane","homepage":"https://github.com/aw1875/ghost-cursor#readme","keywords":["bezier-curve","mouse-movement","botting"],"repository":{"type":"git","url":"git+https://github.com/aw1875/ghost-cursor.git"},"author":{"name":"Xetera"},"bugs":{"url":"https://github.com/aw1875/ghost-cursor/issues"},"license":"ISC","readme":"# Ghost Cursor\n\n<img src=\"https://media2.giphy.com/media/26ufp2LYURTvL5PRS/giphy.gif\" width=\"100\" align=\"right\">\n\nGenerate realistic, human-like mouse movement data between coordinates or navigate between elements with puppeteer\nlike the definitely-not-robot you are.\n\n> Oh yeah? Could a robot do _**this?**_\n\n**Code modifications based off of [ghost-cursor](https://github.com/Xetera/ghost-cursor) package**\n\n## Installation\n\n```sh\nyarn add @aw1875/ghost-cursor\n```\n\nor with npm\n\n```sh\nnpm install @aw1875/ghost-cursor\n```\n\n## Usage\n\nGenerating movement data between 2 coordinates with associated timestamps.\n\n```js\nimport { path } from \"@aw1875/ghost-cursor\";\n\nconst from = { x: 100, y: 100 };\nconst to = { x: 600, y: 700 };\n\nconst route = path(from, to);\n\n/**\n * [\n *   { x: 100, y: 100, timestamp: 1640158937890 },\n *   { x: 126.70079722115054, y: 106.31184259284494, timestamp: 1640158939620 },\n *   { x: 151.74738386288035, y: 112.34993715686089, timestamp: 1640158939565 },\n *   { x: 175.33112687647585, y: 118.45478710608484, timestamp: 1640158939763 },\n *   { x: 197.6433932132232, y: 124.96689585455373, timestamp: 1640158939408 },\n *   ... and so on\n * ]\n */\n```\n\nUsage with puppeteer:\n\n```js\nimport { createCursor } from \"@aw1875/ghost-cursor\";\nimport puppeteer from \"puppeteer\";\n\nconst run = async (url) => {\n  const selector = \"#sign-up button\";\n  const browser = await puppeteer.launch({ headless: false });\n  const page = browser.newPage();\n  const cursor = createCursor(page);\n  await page.goto(url);\n  await page.waitForSelector(selector);\n  await cursor.click(selector);\n  // shorthand for\n  // await cursor.move(selector)\n  // await cursor.click()\n};\n```\n\n### Puppeteer-specific behavior\n\n- `cursor.move()` will automatically overshoot or slightly miss and re-adjust for elements that are too far away\n  from the cursor's starting point.\n- When moving over objects, a random coordinate that's within the element will be selected instead of\n  hovering over the exact center of the element.\n- The speed of the mouse will take the distance and the size of the element you're clicking on into account.\n\n<br>\n\n![ghost-cursor in action](https://cdn.discordapp.com/attachments/418699380833648644/664110683054538772/acc_gen.gif)\n\n> Ghost cursor in action on a form\n\n## How does it work\n\nBezier curves do almost all the work here. They let us create an infinite amount of curves between any 2 points we want\nand they look quite human-like. (At least moreso than alternatives like perlin or simplex noise)\n\n![](https://mamamoo.xetera.dev/😽🤵👲🧦👵.png)\n\nThe magic comes from being able to set multiple points for the curve to go through. This is done by picking\n2 coordinates randomly in a limited area above and under the curve.\n\n<img src=\"https://mamamoo.xetera.dev/🧣👎😠🧟✍.png\" width=\"400\">\n\nHowever, we don't want wonky looking cubic curves when using this method because nobody really moves their mouse\nthat way, so only one side of the line is picked when generating random points.\n\n<img src=\"http://simonwallner.at/ext/fitts/shannon.png\" width=\"250\" align=\"right\">\nWhen calculating how fast the mouse should be moving we use <a href=\"https://en.wikipedia.org/wiki/Fitts%27s_law\">Fitts's Law</a>\nto determine the amount of points we should be returning relative to the width of the element being clicked on and the distance\nbetween the mouse and the object.\n","readmeFilename":"README.md"}