Browse Source

Version number; automated release cycle; compiling to jar

master
Gitea 2 years ago
parent
commit
255fd66652
  1. 4
      MANIFEST.txt
  2. 15
      Makefile
  3. 17
      README.md
  4. 5
      src/xyz/unbewohnte/albionFisher/fisher.java
  5. 10
      src/xyz/unbewohnte/albionFisher/gui.java

4
MANIFEST.txt

@ -0,0 +1,4 @@
Manifest-Version: 1.0
Created-By: 18.0.1.1 (N/A)
Main-Class: fisher

15
Makefile

@ -1,10 +1,15 @@
src_dir:='src/xyz/unbewohnte/albionFisher'
release_dir:='release'
jar_name:='albionFisher.jar'
jar: all
jar cvmf MANIFEST.txt $(jar_name) *.class && rm *.class
all:
javac -Werror $(src_dir)/*.java && cp $(src_dir)/*.class . && rm $(src_dir)/*.class
mkdir -p $(release_dir)
mv *.class $(release_dir)
javac -Werror $(src_dir)/*.java && mv $(src_dir)/*.class .
# jar: all
# jar cvfm fisher.jar Manifest.txt gui.class fisher.class bobber.png
release: jar
mkdir -p $(release_dir)
mv $(jar_name) $(release_dir)
cp COPYING $(release_dir)
cp README.md $(release_dir)

17
README.md

@ -0,0 +1,17 @@
# albionFisher - albion online fisher bot
# Compiling
`make jar` if you're on GNU/Linux, else - `javac src/xyz/unbewohnte/albionFisher/*.java`
# Launch
`java -jar albionFisher.jar`
# Usage
1. Open the game, make it to the water source
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 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 (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

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

@ -26,6 +26,8 @@ import javax.swing.ImageIcon;
public class fisher {
static String VERSION = "v0.1.2";
static RGB BOBBER_COLOR = new RGB(255, 180, 31);
static boolean fishing = false;
@ -99,7 +101,7 @@ public class fisher {
bot = new Robot();
// GUI
gui.launchGUI("fisher");
gui.launchGUI("fisher", VERSION);
// update gui in the separate thread
Thread updateGUIThread = new Thread() {
@ -189,7 +191,6 @@ public class fisher {
// check if severe changes has occured in the image
if (meanDifference > meanDiffThreshold) {
// catch !
System.out.println("catch !");
bot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
bot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
break; // break out of loop still fishing so the next stage starts

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

@ -39,7 +39,7 @@ public class gui {
static JLabel meanDifferenceValueLabel;
static JLabel capturedImageLabel;
public static void launchGUI(String windowName) {
public static void launchGUI(String windowName, String version) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
@ -156,9 +156,15 @@ public class gui {
mousePositionLabel.setBounds(190, 230, 100, 30);
window.add(mousePositionLabel);
// version label
JLabel versionLabel = new JLabel(version);
versionLabel.setBounds(290, 230, 40, 30);
window.add(versionLabel);
// copyright
JLabel copyrightLabel = new JLabel("(c) Kasyanov N. A.");
copyrightLabel.setBounds(320, 230, 150, 30);
// copyrightLabel.setBounds(290, 230, 110, 30);
copyrightLabel.setBounds(335, 230, 110, 30);
window.add(copyrightLabel);
// show window

Loading…
Cancel
Save