small script to play messenger game
Basketball Against Friends
Just for fun.
Thinking out a convenient way of scripting amused me more than swiping on phones everyday.
- node.js
I run the script on v9.11.1
.
But I believe it will works on most patches of node.
The script is nothing more than simulating the swiping gesture.
This is what it does for you:
- move mouse to certain position
- mouse down
- drag up to certain position
- mouse up
press 0-9 to shoot with different strength
- clone this repo then run:
node index.js
- open up
Basketball Against Friends
on messenger - press
0-9
to shoot (strength from min to max) - press
Q
to quit
The script will behave differently due to various sizes of screen.
You may need to adjust the mouse position by changing these lines in index.js
to fit your condition:
const { width: SCREEN_WIDTH } = robot.getScreenSize()
// customize your mouse position here
const X = SCREEN_WIDTH / 2
const Y_FROM = 350
const Y_TO = 300
const STRENGTH_DIFFERENCE = 10
X
: axis X of mouse position (center of your screen by default)Y_FROM
: axis Y of mouse down positionY_TO
: axis Y of mouse up positionSTRENGTH_DIFFERENCE
: the default strength difference
pressing key 0-9
trigger swiping mouse from [X, Y_FROM + key * STRENGTH_DIFFERENCE]
to [X, Y_TO]
happy scripting 🎉