made better fuck you kys
This commit is contained in:
parent
a2c522fea2
commit
57f3767d57
@ -3,7 +3,10 @@
|
||||
A bot for eat drywall probably idk.
|
||||
|
||||
|
||||
Setup with `start setup.bat`.
|
||||
|
||||
Run with `node main`.
|
||||
Run with `python start.py`.
|
||||
|
||||
Press "q" anywhere to quit.
|
||||
|
||||
Configure in "config.jsonc".
|
||||
|
6
click.py
6
click.py
@ -6,6 +6,6 @@ x = int(sys.argv[1])
|
||||
y = int(sys.argv[2])
|
||||
|
||||
print("\n" + str(x) + str(y) + "\n")
|
||||
pyautogui.moveTo(x,y, .3)
|
||||
pydirectinput.moveTo(x,y, .3)
|
||||
pyautogui.click(clicks=2, interval=.35)
|
||||
pyautogui.moveTo(x,y, .1)
|
||||
pydirectinput.moveTo(x,y)
|
||||
pyautogui.click(clicks=4, interval=.1)
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"iterationsPerPhoto": 3,
|
||||
"iterationsPerPhoto": 6,
|
||||
"photoInterval": 2,
|
||||
"targetColor": {
|
||||
"r": 85,
|
||||
|
13
main.js
13
main.js
@ -3,6 +3,7 @@ const ss = require("node-screenshots");
|
||||
const proc = require("child_process");
|
||||
const fs = require("fs");
|
||||
|
||||
|
||||
let config = JSON.parse(fs.readFileSync("./config.jsonc"));
|
||||
|
||||
const photoInterval = config.photoInterval;
|
||||
@ -17,17 +18,7 @@ setInterval(eatDrywall, photoInterval * 1000);
|
||||
|
||||
|
||||
|
||||
var readline = require('readline');
|
||||
|
||||
readline.emitKeypressEvents(process.stdin);
|
||||
|
||||
if (process.stdin.isTTY)
|
||||
process.stdin.setRawMode(true);
|
||||
|
||||
process.stdin.on('keypress', (chunk, key) => {
|
||||
if (key && key.name == 'q')
|
||||
process.exit();
|
||||
});
|
||||
|
||||
|
||||
async function eatDrywall() {
|
||||
@ -66,7 +57,7 @@ async function clickRandomDrywalls(hits, width, repetitions) {
|
||||
let target = deRasterize(hits[click], width);//get coordinates of random pixel
|
||||
console.log("Clicking: " + JSON.stringify(target));
|
||||
console.log(proc.exec("python click.py " + target.x + " " + target.y).toString());
|
||||
await new Promise(resolve => setTimeout(resolve, 300));
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
}
|
||||
}
|
||||
function rasterize(x, y, width) { //scale to image
|
||||
|
@ -1,4 +1,5 @@
|
||||
python -m ensurepip
|
||||
pip install pyautogui
|
||||
pip install PyDirectInput
|
||||
pip install keyboard
|
||||
npm i
|
Loading…
x
Reference in New Issue
Block a user