From a2c522fea2b941474b9efe7a858e5fffc1593486 Mon Sep 17 00:00:00 2001 From: APEX FIGHT Date: Tue, 8 Apr 2025 21:30:21 -0400 Subject: [PATCH] added iterationsper photo option --- config.jsonc | 3 ++- main.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.jsonc b/config.jsonc index 59647d5..8f745e6 100644 --- a/config.jsonc +++ b/config.jsonc @@ -1,4 +1,5 @@ { + "iterationsPerPhoto": 3, "photoInterval": 2, "targetColor": { "r": 85, @@ -6,5 +7,5 @@ "b": 49, "a": 255 }, - "tolerance": 2 + "tolerance": 20 } \ No newline at end of file diff --git a/main.js b/main.js index 9ec9ada..44c0efe 100644 --- a/main.js +++ b/main.js @@ -11,6 +11,7 @@ const targetColor = config.targetColor; const tolerance = config.tolerance; +const iterationsPerPhoto = config.iterationsPerPhoto; setInterval(eatDrywall, photoInterval * 1000); @@ -53,7 +54,7 @@ function clickRandomPixelOfColor(width, height, image) { } console.log(hits.length); - clickRandomDrywalls(hits,width,1); + clickRandomDrywalls(hits, width, iterationsPerPhoto); } @@ -84,6 +85,7 @@ function compareColors(c1, c2) { //compare two rgba color structs let sum2 = c2.r + c2.g + c2.b + c2.a; if (Math.abs(sum1 - sum2) < (tolerance * 4)) { + //console.log(Math.abs(sum1 - sum2)); return true; } else return false; }