commit b994789979676379415729758f143834de47f3ce Author: Joshua Sigona Date: Thu Sep 2 22:19:20 2021 +0900 Create basic functionality diff --git a/bin/sig/Direction.class b/bin/sig/Direction.class new file mode 100644 index 0000000..8d2cb9c Binary files /dev/null and b/bin/sig/Direction.class differ diff --git a/bin/sig/HousingTracker.class b/bin/sig/HousingTracker.class new file mode 100644 index 0000000..13d7284 Binary files /dev/null and b/bin/sig/HousingTracker.class differ diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..de81dfe Binary files /dev/null and b/screenshot.png differ diff --git a/screenshot_0_0.png b/screenshot_0_0.png new file mode 100644 index 0000000..547c70d Binary files /dev/null and b/screenshot_0_0.png differ diff --git a/screenshot_0_1.png b/screenshot_0_1.png new file mode 100644 index 0000000..ccf5260 Binary files /dev/null and b/screenshot_0_1.png differ diff --git a/screenshot_0_10.png b/screenshot_0_10.png new file mode 100644 index 0000000..776ec26 Binary files /dev/null and b/screenshot_0_10.png differ diff --git a/screenshot_0_11.png b/screenshot_0_11.png new file mode 100644 index 0000000..2a4bed6 Binary files /dev/null and b/screenshot_0_11.png differ diff --git a/screenshot_0_12.png b/screenshot_0_12.png new file mode 100644 index 0000000..4a27595 Binary files /dev/null and b/screenshot_0_12.png differ diff --git a/screenshot_0_13.png b/screenshot_0_13.png new file mode 100644 index 0000000..01cecc5 Binary files /dev/null and b/screenshot_0_13.png differ diff --git a/screenshot_0_14.png b/screenshot_0_14.png new file mode 100644 index 0000000..39ccc5e Binary files /dev/null and b/screenshot_0_14.png differ diff --git a/screenshot_0_2.png b/screenshot_0_2.png new file mode 100644 index 0000000..fcacd54 Binary files /dev/null and b/screenshot_0_2.png differ diff --git a/screenshot_0_3.png b/screenshot_0_3.png new file mode 100644 index 0000000..a2eb5e7 Binary files /dev/null and b/screenshot_0_3.png differ diff --git a/screenshot_0_4.png b/screenshot_0_4.png new file mode 100644 index 0000000..201c88b Binary files /dev/null and b/screenshot_0_4.png differ diff --git a/screenshot_0_5.png b/screenshot_0_5.png new file mode 100644 index 0000000..6de9f8d Binary files /dev/null and b/screenshot_0_5.png differ diff --git a/screenshot_0_6.png b/screenshot_0_6.png new file mode 100644 index 0000000..48f849c Binary files /dev/null and b/screenshot_0_6.png differ diff --git a/screenshot_0_7.png b/screenshot_0_7.png new file mode 100644 index 0000000..00c969e Binary files /dev/null and b/screenshot_0_7.png differ diff --git a/screenshot_0_8.png b/screenshot_0_8.png new file mode 100644 index 0000000..89f4477 Binary files /dev/null and b/screenshot_0_8.png differ diff --git a/screenshot_0_9.png b/screenshot_0_9.png new file mode 100644 index 0000000..3003149 Binary files /dev/null and b/screenshot_0_9.png differ diff --git a/screenshot_1_0.png b/screenshot_1_0.png new file mode 100644 index 0000000..4e2de36 Binary files /dev/null and b/screenshot_1_0.png differ diff --git a/screenshot_1_1.png b/screenshot_1_1.png new file mode 100644 index 0000000..2577e4b Binary files /dev/null and b/screenshot_1_1.png differ diff --git a/screenshot_1_10.png b/screenshot_1_10.png new file mode 100644 index 0000000..f42a032 Binary files /dev/null and b/screenshot_1_10.png differ diff --git a/screenshot_1_11.png b/screenshot_1_11.png new file mode 100644 index 0000000..8e70bd0 Binary files /dev/null and b/screenshot_1_11.png differ diff --git a/screenshot_1_12.png b/screenshot_1_12.png new file mode 100644 index 0000000..e9f2e09 Binary files /dev/null and b/screenshot_1_12.png differ diff --git a/screenshot_1_13.png b/screenshot_1_13.png new file mode 100644 index 0000000..26016e3 Binary files /dev/null and b/screenshot_1_13.png differ diff --git a/screenshot_1_14.png b/screenshot_1_14.png new file mode 100644 index 0000000..347a6ab Binary files /dev/null and b/screenshot_1_14.png differ diff --git a/screenshot_1_2.png b/screenshot_1_2.png new file mode 100644 index 0000000..ec832e6 Binary files /dev/null and b/screenshot_1_2.png differ diff --git a/screenshot_1_3.png b/screenshot_1_3.png new file mode 100644 index 0000000..498857e Binary files /dev/null and b/screenshot_1_3.png differ diff --git a/screenshot_1_4.png b/screenshot_1_4.png new file mode 100644 index 0000000..fc343a4 Binary files /dev/null and b/screenshot_1_4.png differ diff --git a/screenshot_1_5.png b/screenshot_1_5.png new file mode 100644 index 0000000..c403743 Binary files /dev/null and b/screenshot_1_5.png differ diff --git a/screenshot_1_6.png b/screenshot_1_6.png new file mode 100644 index 0000000..2c86f74 Binary files /dev/null and b/screenshot_1_6.png differ diff --git a/screenshot_1_7.png b/screenshot_1_7.png new file mode 100644 index 0000000..dda2996 Binary files /dev/null and b/screenshot_1_7.png differ diff --git a/screenshot_1_8.png b/screenshot_1_8.png new file mode 100644 index 0000000..d2cb3ec Binary files /dev/null and b/screenshot_1_8.png differ diff --git a/screenshot_1_9.png b/screenshot_1_9.png new file mode 100644 index 0000000..9f1ec8f Binary files /dev/null and b/screenshot_1_9.png differ diff --git a/src/sig/Direction.java b/src/sig/Direction.java new file mode 100644 index 0000000..566a24e --- /dev/null +++ b/src/sig/Direction.java @@ -0,0 +1,16 @@ +package sig; + +import java.awt.event.KeyEvent; + +public enum Direction { + UP(KeyEvent.VK_UP), + DOWN(KeyEvent.VK_DOWN), + LEFT(KeyEvent.VK_Q), + RIGHT(KeyEvent.VK_E); + + int keycode; + + Direction(int keycode) { + this.keycode=keycode; + } +} diff --git a/src/sig/HousingTracker.java b/src/sig/HousingTracker.java new file mode 100644 index 0000000..9f67770 --- /dev/null +++ b/src/sig/HousingTracker.java @@ -0,0 +1,116 @@ +package sig; +import java.awt.AWTException; +import java.awt.Color; +import java.awt.image.BufferedImage; +import java.awt.FontFormatException; +import java.awt.GraphicsEnvironment; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.KeyEvent; +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.imageio.ImageIO; + +public class HousingTracker{ + + public static Robot r = null; + public static final Point WHITE_UI_SELECTION_PIXEL = new Point(650,73); + public static final Point NONBLACK_UI_PIXEL = new Point(843,967); + public static final int SCANSTART_X = 601; + public static final int SCANSTART_Y = 415; + public static final Rectangle SCANSTART_REGION = new Rectangle(601,415,330,24); + public static final Rectangle NAMESTART_REGION = new Rectangle(119,0,16,11); + public static Map> PLOTSTATE = new HashMap>(); + + public static final String[] REGIONS = new String[] {"Kugane","Gridania","Uldah","Limsa"}; + public static final int CURRENT_REGION = 0; + + public static void main(String[] args) throws IOException, FontFormatException { + try { + r = new Robot(); + + r.delay(3000); + //Starts at 601,415 + /*BufferedImage i = CaptureScreen(env, r); + for (int x=0;x<2;x++) { + for (int y=0;y<15;y++) { + ImageIO.write(i.getSubimage(SCANSTART_REGION.x+SCANSTART_REGION.width*x,SCANSTART_REGION.y+SCANSTART_REGION.height*y,SCANSTART_REGION.width,NAMESTART_REGION.height),"png",new File("screenshot_"+x+"_"+y+".png")); + } + }*/ + //CompleteALoadingPhase(); + //Walk(Direction.RIGHT,1000); + //OpenResidentialMenu(); + } catch (AWTException e) { + e.printStackTrace(); + } + } + + private static void CaptureResidentialData() { + GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); + BufferedImage i = null; + try { + i = CaptureScreen(env); + } catch (IOException e1) { + e1.printStackTrace(); + } + for (int x=0;x<2;x++) { + for (int y=0;y<15;y++) { + Image plot_img = i.getSubimage(SCANSTART_REGION.x+SCANSTART_REGION.width*x,SCANSTART_REGION.y+SCANSTART_REGION.height*y,SCANSTART_REGION.width,NAMESTART_REGION.height); + } + } + } + + private static void OpenResidentialMenu() { + PressKey(KeyEvent.VK_ESCAPE);r.delay(500); + PressKey(KeyEvent.VK_ESCAPE);r.delay(500); + PressKey(KeyEvent.VK_NUMPAD0); + r.delay(500); + Color screen_col = r.getPixelColor(WHITE_UI_SELECTION_PIXEL.x, WHITE_UI_SELECTION_PIXEL.y); + if (screen_col.getRed()>=200&&screen_col.getGreen()>=200&&screen_col.getBlue()>=200) { + System.out.println("Aetherythe Selected....Begin Processing."); + PressKey(KeyEvent.VK_NUMPAD0);r.delay(2000); + PressKey(KeyEvent.VK_NUMPAD7);r.delay(200); + PressKey(KeyEvent.VK_NUMPAD0);r.delay(2000); + PressKey(KeyEvent.VK_NUMPAD7);r.delay(200); + PressKey(KeyEvent.VK_NUMPAD0);r.delay(2000); + } else { + System.out.println("Could not select Aetheryte!! Moving on..."); + } + } + + private static void CompleteALoadingPhase() { + while (!IsLoading()) { + r.delay(200); + } + while (IsLoading()) { + r.delay(200); + } + } + + private static boolean IsLoading() { + return r.getPixelColor(NONBLACK_UI_PIXEL.x,NONBLACK_UI_PIXEL.y).equals(Color.BLACK); + } + + private static void PressKey(int keycode) { + r.keyPress(keycode); + r.keyRelease(keycode); + } + + private static void Walk(Direction dir,int ms) { + r.keyPress(dir.keycode); + r.delay(ms); + r.keyRelease(dir.keycode); + } + + private static BufferedImage CaptureScreen(GraphicsEnvironment env) throws IOException { + BufferedImage screenshot = r.createScreenCapture(env.getMaximumWindowBounds()); + ImageIO.write(screenshot,"png",new File("screenshot.png")); + return screenshot; + } +} \ No newline at end of file