@@ -109,11 +109,8 @@ public boolean startDrawing(GraphicsConfiguration monitor, Rectangle canvasArea,
109109 }
110110
111111 // Change the color
112- if (lastColor != blob .colorIndex ) {
113- if (!clickColor (robot , palette .getColorButton (BorstUtils .getClosestColor (blob .color )), 8 , autoDelay )) {
114- // LOGGER.warn("Potentially failed to change color! Will still keep try drawing");
115- }
116-
112+ if (lastColor != blob .colorIndex ) { // Without 20 here it will not work
113+ clickColor (robot , palette .getColorButton (BorstUtils .getClosestColor (blob .color )), 20 , autoDelay );
117114 lastColor = blob .colorIndex ;
118115 actions ++;
119116 }
@@ -145,7 +142,7 @@ public boolean startDrawing(GraphicsConfiguration monitor, Rectangle canvasArea,
145142 int sy = (int ) ty + displayY ;
146143
147144 lastPoint .setLocation (sx , sy );
148- clickPointScaled (robot , lastPoint , autoDelay );
145+ clickPointScaledDrawColor (robot , lastPoint , autoDelay );
149146
150147 if ((i % autosaveInterval ) == 0 ) {
151148 clickPoint (robot , palette .getSaveButton (), autoDelay );
@@ -179,7 +176,7 @@ private void clickPoint(Robot robot, Point point, int times, double delay) throw
179176 /**
180177 * Click a point on the screen with a scaled point
181178 */
182- private void clickPointScaled (Robot robot , Point point , double delay ) throws PaintingInterrupted {
179+ private void clickPointScaledDrawColor (Robot robot , Point point , double delay ) throws PaintingInterrupted {
183180 double time = System .nanoTime () / 1000000.0 ;
184181
185182 robot .mouseMove (point .x , point .y );
@@ -246,7 +243,7 @@ private void clickSize(Robot robot, Point point, int maxAttempts, double delay)
246243 }
247244 }
248245
249- private boolean clickColor (Robot robot , Point point , int maxAttempts , double delay ) throws PaintingInterrupted {
246+ private void clickColor (Robot robot , Point point , int maxAttempts , double delay ) throws PaintingInterrupted {
250247 Point colorPreview = palette .getColorPreview ();
251248 Color before = robot .getPixelColor (colorPreview .x , colorPreview .y );
252249
@@ -256,28 +253,9 @@ private boolean clickColor(Robot robot, Point point, int maxAttempts, double del
256253
257254 Color after = robot .getPixelColor (colorPreview .x , colorPreview .y );
258255 if (!before .equals (after )) {
259- return true ;
260- }
261- }
262-
263- return false ;
264- }
265-
266- private boolean clickColorTest (Robot robot , Point point , int maxAttempts , double delay ) throws PaintingInterrupted {
267- Point colorPreview = palette .getColorPreview ();
268- Color before = robot .getPixelColor (colorPreview .x , colorPreview .y );
269-
270- // Make sure that we press the size
271- while (maxAttempts -- > 0 ) {
272- clickPointScaled (robot , point , delay );
273-
274- Color after = robot .getPixelColor (colorPreview .x , colorPreview .y );
275- if (!before .equals (after )) {
276- return true ;
256+ return ;
277257 }
278258 }
279-
280- return false ;
281259 }
282260
283261 /**
0 commit comments