From 57f3767d57fbac0fe90c069df32c82a9ecb6b307 Mon Sep 17 00:00:00 2001 From: APEX FIGHT Date: Tue, 8 Apr 2025 21:50:59 -0400 Subject: [PATCH] made better fuck you kys --- README.md | 5 ++++- click.py | 6 +++--- config.jsonc | 2 +- main.js | 13 ++----------- setup.bat | 1 + start.py | 19 +++++++++++++++++++ 6 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 start.py diff --git a/README.md b/README.md index b8ba1ad..4098747 100644 --- a/README.md +++ b/README.md @@ -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". diff --git a/click.py b/click.py index 76aae2d..cf34f6c 100644 --- a/click.py +++ b/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) \ No newline at end of file +pyautogui.moveTo(x,y, .1) +pydirectinput.moveTo(x,y) +pyautogui.click(clicks=4, interval=.1) \ No newline at end of file diff --git a/config.jsonc b/config.jsonc index 8f745e6..30b43ad 100644 --- a/config.jsonc +++ b/config.jsonc @@ -1,5 +1,5 @@ { - "iterationsPerPhoto": 3, + "iterationsPerPhoto": 6, "photoInterval": 2, "targetColor": { "r": 85, diff --git a/main.js b/main.js index 44c0efe..a440089 100644 --- a/main.js +++ b/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 diff --git a/setup.bat b/setup.bat index 672deea..a2bbdc2 100644 --- a/setup.bat +++ b/setup.bat @@ -1,4 +1,5 @@ python -m ensurepip pip install pyautogui pip install PyDirectInput +pip install keyboard npm i \ No newline at end of file diff --git a/start.py b/start.py new file mode 100644 index 0000000..61f5fc2 --- /dev/null +++ b/start.py @@ -0,0 +1,19 @@ +import subprocess +import keyboard + + +#async def subp(): +proc = subprocess.Popen("node main") + +#asyncio.run(subp()) + +while True: + try: + if keyboard.is_pressed('q'): + proc.kill() + exit() + + except: + print("q") + proc.kill() + exit()