Hello I hope I've come to the right section for this.
My code is as following and it does everything correct except clicking
the custom fishingbobber when it splashes.
Code:
package fiskaren;
import java.awt.*;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import java.io.IOException;
public class Fiskaren {
public static Robot Fiskaren;
public static Color cB;
public static int R = 0, G = 0, B = 0;
public static int bX = 0;
public static int bY = 0;
public static int FISHINGROD = 49;
public static void main(String[] args)
throws AWTException, IOException{
Fiskaren = new Robot();
Fiskaren.delay(5000);
fiska();
}
public static void fiska() {
//Cast Fishing Pole
Press(FISHINGROD);
Fiskaren.delay(5000);
Sikta();
}
public static void Sikta() {
Dimension sS = Toolkit.getDefaultToolkit().getScreenSize();
int x = Math.max(0, sS.width / 2 - 200);
int y = Math.max(0, sS.height / 2 - 200);
for (x = sS.width / 2 - 200; x < sS.width / 2 + 200; x+=3) {
for (y = sS.height / 2 - 200; y < sS.height / 2 + 200; y+=3) {
cB = Fiskaren.getPixelColor(x, y);
if (cB.getRGB() == -16777216) {
System.out.println("Bobber found at " + x + " " + y);
bX=x;
bY=y;
Fiskaren.mouseMove(bX, bY);
loot();
}
}
}
}
private static void loot() {
boolean scanning = true;
while (scanning) {
cB = Fiskaren.getPixelColor(bX, bY);
if (cB.getRGB() != -16777216){
scanning = false;
Fiskaren.mouseMove(bX, bY);
Fiskaren.delay(100);
Fiskaren.mousePress(InputEvent.BUTTON2_MASK);
Fiskaren.mouseRelease(InputEvent.BUTTON2_MASK);
Fiskaren.delay(7000);
fiska();
break;
}
}