Browse Source

Adjusted timings a bit

master v0.1.4
Gitea 2 years ago
parent
commit
3e04c2a220
  1. 19
      src/xyz/unbewohnte/albionFisher/fisher.java
  2. 10
      src/xyz/unbewohnte/albionFisher/gui.java

19
src/xyz/unbewohnte/albionFisher/fisher.java

@ -26,7 +26,7 @@ import javax.swing.ImageIcon;
public class fisher { public class fisher {
static String VERSION = "v0.1.3"; static String VERSION = "v0.1.4";
static RGB BOBBER_COLOR = new RGB(255, 180, 31); static RGB BOBBER_COLOR = new RGB(255, 180, 31);
@ -115,7 +115,7 @@ public class fisher {
// fishing logic // fishing logic
boolean windowActivated = false; boolean windowActivated = false;
boolean needToRecast = false; boolean needToRecast = false;
int idleCountMsMax = 20000; // 20 seconds int idleCountMsMax = 35000; // 35 seconds
int idleCountMs = 0; int idleCountMs = 0;
while (true) { while (true) {
Thread.sleep(50); Thread.sleep(50);
@ -142,22 +142,21 @@ public class fisher {
holdms = gui.holdMsSlider.getValue(); holdms = gui.holdMsSlider.getValue();
meanDiffThreshold = gui.meanDiffThresholdSlider.getValue(); meanDiffThreshold = gui.meanDiffThresholdSlider.getValue();
Thread.sleep(500);
// activate window if needed // activate window if needed
if (!windowActivated) { if (!windowActivated) {
windowActivated = true; bot.delay(100);
bot.mouseMove(xpos, ypos); bot.mouseMove(xpos, ypos);
bot.mousePress(InputEvent.BUTTON1_DOWN_MASK); bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
bot.delay(50); bot.delay(25);
bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
windowActivated = true;
} }
// move the mouse to the position // move the mouse to the position
// give the game window needed vector // give the game window needed vector
bot.delay(300); bot.delay(250);
bot.mouseMove(xpos-5, ypos-5); bot.mouseMove(xpos-5, ypos-5);
bot.mouseMove(xpos, ypos); bot.mouseMove(xpos, ypos);
@ -256,11 +255,9 @@ public class fisher {
if (bobberCoords.x == -1 && bobberCoords.y == -1 && initialBobberPosition.x != -1 && initialBobberPosition.y != -1) { if (bobberCoords.x == -1 && bobberCoords.y == -1 && initialBobberPosition.x != -1 && initialBobberPosition.y != -1) {
// the game has been finished // the game has been finished
bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
Thread.sleep(6000); Thread.sleep(5000);
break; break;
} }
Thread.sleep(5);
} }
} }
} catch (Exception e) { } catch (Exception e) {

10
src/xyz/unbewohnte/albionFisher/gui.java

@ -116,11 +116,10 @@ public class gui {
thresholdSliderLabel.setBounds(20, 135, 130, 20); thresholdSliderLabel.setBounds(20, 135, 130, 20);
window.add(thresholdSliderLabel); window.add(thresholdSliderLabel);
meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 10, 5);
meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 30, 10); meanDiffThresholdSlider.setValue(3);
meanDiffThresholdSlider.setValue(10); meanDiffThresholdSlider.setMajorTickSpacing(5);
meanDiffThresholdSlider.setMajorTickSpacing(10); meanDiffThresholdSlider.setMinorTickSpacing(1);
meanDiffThresholdSlider.setMinorTickSpacing(5);
meanDiffThresholdSlider.setPaintTicks(true); meanDiffThresholdSlider.setPaintTicks(true);
meanDiffThresholdSlider.setPaintLabels(true); meanDiffThresholdSlider.setPaintLabels(true);
meanDiffThresholdSlider.setBounds(150, 135, 170, 45); meanDiffThresholdSlider.setBounds(150, 135, 170, 45);
@ -163,7 +162,6 @@ public class gui {
// copyright // copyright
JLabel copyrightLabel = new JLabel("(c) Kasyanov N. A."); JLabel copyrightLabel = new JLabel("(c) Kasyanov N. A.");
// copyrightLabel.setBounds(290, 230, 110, 30);
copyrightLabel.setBounds(335, 230, 110, 30); copyrightLabel.setBounds(335, 230, 110, 30);
window.add(copyrightLabel); window.add(copyrightLabel);

Loading…
Cancel
Save