From 3e04c2a22089c76c4883c8bde84c2599def6a85c Mon Sep 17 00:00:00 2001 From: Gitea Date: Fri, 17 Jun 2022 13:27:10 +0300 Subject: [PATCH] Adjusted timings a bit --- src/xyz/unbewohnte/albionFisher/fisher.java | 19 ++++++++----------- src/xyz/unbewohnte/albionFisher/gui.java | 10 ++++------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/xyz/unbewohnte/albionFisher/fisher.java b/src/xyz/unbewohnte/albionFisher/fisher.java index bd723ed..e6633dd 100644 --- a/src/xyz/unbewohnte/albionFisher/fisher.java +++ b/src/xyz/unbewohnte/albionFisher/fisher.java @@ -26,7 +26,7 @@ import javax.swing.ImageIcon; public class fisher { - static String VERSION = "v0.1.3"; + static String VERSION = "v0.1.4"; static RGB BOBBER_COLOR = new RGB(255, 180, 31); @@ -115,7 +115,7 @@ public class fisher { // fishing logic boolean windowActivated = false; boolean needToRecast = false; - int idleCountMsMax = 20000; // 20 seconds + int idleCountMsMax = 35000; // 35 seconds int idleCountMs = 0; while (true) { Thread.sleep(50); @@ -142,22 +142,21 @@ public class fisher { holdms = gui.holdMsSlider.getValue(); meanDiffThreshold = gui.meanDiffThresholdSlider.getValue(); - - Thread.sleep(500); - // activate window if needed if (!windowActivated) { - windowActivated = true; + bot.delay(100); + bot.mouseMove(xpos, ypos); bot.mousePress(InputEvent.BUTTON1_DOWN_MASK); - bot.delay(50); + bot.delay(25); bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + windowActivated = true; } // move the mouse to the position // give the game window needed vector - bot.delay(300); + bot.delay(250); bot.mouseMove(xpos-5, ypos-5); bot.mouseMove(xpos, ypos); @@ -256,11 +255,9 @@ public class fisher { if (bobberCoords.x == -1 && bobberCoords.y == -1 && initialBobberPosition.x != -1 && initialBobberPosition.y != -1) { // the game has been finished bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); - Thread.sleep(6000); + Thread.sleep(5000); break; } - - Thread.sleep(5); } } } catch (Exception e) { diff --git a/src/xyz/unbewohnte/albionFisher/gui.java b/src/xyz/unbewohnte/albionFisher/gui.java index 4cb61a3..2a6025b 100644 --- a/src/xyz/unbewohnte/albionFisher/gui.java +++ b/src/xyz/unbewohnte/albionFisher/gui.java @@ -116,11 +116,10 @@ public class gui { thresholdSliderLabel.setBounds(20, 135, 130, 20); window.add(thresholdSliderLabel); - - meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 30, 10); - meanDiffThresholdSlider.setValue(10); - meanDiffThresholdSlider.setMajorTickSpacing(10); - meanDiffThresholdSlider.setMinorTickSpacing(5); + meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 10, 5); + meanDiffThresholdSlider.setValue(3); + meanDiffThresholdSlider.setMajorTickSpacing(5); + meanDiffThresholdSlider.setMinorTickSpacing(1); meanDiffThresholdSlider.setPaintTicks(true); meanDiffThresholdSlider.setPaintLabels(true); meanDiffThresholdSlider.setBounds(150, 135, 170, 45); @@ -163,7 +162,6 @@ public class gui { // copyright JLabel copyrightLabel = new JLabel("(c) Kasyanov N. A."); - // copyrightLabel.setBounds(290, 230, 110, 30); copyrightLabel.setBounds(335, 230, 110, 30); window.add(copyrightLabel);