Compare commits

..

No commits in common. 'master' and 'v0.1.2' have entirely different histories.

  1. 4
      .gitignore
  2. 10
      README.md
  3. 4
      src/xyz/unbewohnte/albionFisher/RGB.java
  4. 31
      src/xyz/unbewohnte/albionFisher/fisher.java
  5. 12
      src/xyz/unbewohnte/albionFisher/gui.java
  6. 2
      src/xyz/unbewohnte/albionFisher/imgutils.java

4
.gitignore vendored

@ -1,3 +1 @@
release/
albionFisher.jar
*.zip
release/

10
README.md

@ -1,7 +1,7 @@
# albionFisher - albion online fishing bot
# albionFisher - albion online fisher bot
# Compiling
`make jar` if you're on GNU/Linux, else - translate the commands in the makefile to compile
`make jar` if you're on GNU/Linux, else - `javac src/xyz/unbewohnte/albionFisher/*.java`+`jar cvmf MANIFEST.txt albionFisher.jar *.class && rm *.class`
# Launch
`java -jar albionFisher.jar`
@ -11,7 +11,7 @@
2. Set your cursor at the exact position where you want to drop the bobber
3. Look at the coordinates on the fisher's window and put them in the xy fields
4. By trial and error specify needed hold time in miliseconds so you could see ingame bobber being in the center of fisher's sight box (by clicking "fish" button)
5. With the same method set difference threshold (in most cases it is somewhere around 2-3)
6. Start the bot again and leave the mouse cursor as is
5. With the same method set difference threshold (in most cases it is somewhere around 3-4 if you fish horizontally, 1-2 if vertically)
6. Start the bot again and leave the computer as is
Moving the mouse automatically stops the bot so you can move onto the next spot or entirely stop fishing without the manual click on "stop" button
Moving the mouse automatically (though not very reliably) stops the bot so you can move onto the next spot or entirely stop fishing without manual click on "stop" button

4
src/xyz/unbewohnte/albionFisher/rgb.java → src/xyz/unbewohnte/albionFisher/RGB.java

@ -16,12 +16,12 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
public class rgb {
public class RGB {
public int r;
public int g;
public int b;
public rgb(int r, int g, int b) {
public RGB(int r, int g, int b) {
this.r = r;
this.g = g;
this.b = b;

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

@ -26,9 +26,9 @@ import javax.swing.ImageIcon;
public class fisher {
static String VERSION = "v0.1.6";
static String VERSION = "v0.1.2";
static rgb BOBBER_COLOR = new rgb(255, 180, 31);
static RGB BOBBER_COLOR = new RGB(255, 180, 31);
static boolean fishing = false;
@ -101,7 +101,7 @@ public class fisher {
bot = new Robot();
// GUI
gui.launchGUI("albionFisher", VERSION);
gui.launchGUI("fisher", VERSION);
// update gui in the separate thread
Thread updateGUIThread = new Thread() {
@ -139,21 +139,22 @@ public class fisher {
holdms = gui.holdMsSlider.getValue();
meanDiffThreshold = gui.meanDiffThresholdSlider.getValue();
Thread.sleep(500);
// activate window if needed
if (!windowActivated) {
bot.delay(100);
windowActivated = true;
bot.mouseMove(xpos, ypos);
bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
bot.delay(25);
bot.delay(50);
bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
windowActivated = true;
}
// move the mouse to the position
// give the game window needed vector
bot.delay(250);
bot.delay(300);
bot.mouseMove(xpos-5, ypos-5);
bot.mouseMove(xpos, ypos);
@ -243,21 +244,11 @@ 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(5000);
if (mousePos_x != xpos && mousePos_y != ypos) {
fishing = false;
}
Thread.sleep(6000);
break;
}
if (bobberCoords.x == -1 && bobberCoords.y == -1 && initialBobberPosition.x == -1 && initialBobberPosition.y == -1) {
// false-positive !
// recast
Thread.sleep(5000);
break;
}
Thread.sleep(5);
}
}
} catch (Exception e) {

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

@ -102,7 +102,7 @@ public class gui {
holdSliderLabel.setBounds(20, 90, 70, 20);
window.add(holdSliderLabel);
holdMsSlider = new JSlider(JSlider.HORIZONTAL, 0, 1100, 250);
holdMsSlider = new JSlider(JSlider.HORIZONTAL, 0, 1500, 250);
holdMsSlider.setValue(250);
holdMsSlider.setMajorTickSpacing(500);
holdMsSlider.setMinorTickSpacing(250);
@ -116,10 +116,11 @@ public class gui {
thresholdSliderLabel.setBounds(20, 135, 130, 20);
window.add(thresholdSliderLabel);
meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 10, 5);
meanDiffThresholdSlider.setValue(3);
meanDiffThresholdSlider.setMajorTickSpacing(5);
meanDiffThresholdSlider.setMinorTickSpacing(1);
meanDiffThresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 30, 10);
meanDiffThresholdSlider.setValue(10);
meanDiffThresholdSlider.setMajorTickSpacing(10);
meanDiffThresholdSlider.setMinorTickSpacing(5);
meanDiffThresholdSlider.setPaintTicks(true);
meanDiffThresholdSlider.setPaintLabels(true);
meanDiffThresholdSlider.setBounds(150, 135, 170, 45);
@ -162,6 +163,7 @@ 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);

2
src/xyz/unbewohnte/albionFisher/imgutils.java

@ -33,7 +33,7 @@ public class imgutils {
return sum / (img.getWidth() * img.getHeight());
}
public static Point getPixelCoordinates(BufferedImage img, rgb color) {
public static Point getPixelCoordinates(BufferedImage img, RGB color) {
for (int y = 0; y < img.getHeight(); y++) {
for (int x = 0; x < img.getWidth(); x++) {
int imgColor = img.getRGB(x, y);

Loading…
Cancel
Save