Browse Source

Auto recast on too long idle

master v0.1.3
Gitea 2 years ago
parent
commit
69d875298e
  1. 16
      src/xyz/unbewohnte/albionFisher/fisher.java

16
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.2"; static String VERSION = "v0.1.3";
static RGB BOBBER_COLOR = new RGB(255, 180, 31); static RGB BOBBER_COLOR = new RGB(255, 180, 31);
@ -114,6 +114,9 @@ public class fisher {
// fishing logic // fishing logic
boolean windowActivated = false; boolean windowActivated = false;
boolean needToRecast = false;
int idleCountMsMax = 20000; // 20 seconds
int idleCountMs = 0;
while (true) { while (true) {
Thread.sleep(50); Thread.sleep(50);
@ -167,7 +170,15 @@ public class fisher {
Thread.sleep(3500); Thread.sleep(3500);
// wait for fish as long as the user does not move the mouse // wait for fish as long as the user does not move the mouse
idleCountMs = 0;
needToRecast = false;
while (true) { while (true) {
if (idleCountMs >= idleCountMsMax) {
// something must be wrong
needToRecast = true;
break;
}
if (mousePos_x != xpos && mousePos_y != ypos) { if (mousePos_x != xpos && mousePos_y != ypos) {
fishing = false; fishing = false;
break; // break out of loop with fishing flag set to FALSE break; // break out of loop with fishing flag set to FALSE
@ -197,12 +208,13 @@ public class fisher {
} }
Thread.sleep(50); Thread.sleep(50);
idleCountMs += 50;
} }
// play minigame if still fishing // play minigame if still fishing
lastMean = 0.0f; lastMean = 0.0f;
currentMean = 0.0f; currentMean = 0.0f;
if (!fishing) { if (!fishing || needToRecast) {
continue; continue;
}; };

Loading…
Cancel
Save