#Java.awt.robot skipping lines

9 messages · Page 1 of 1 (latest)

craggy lynx
#

I'm trying to make a bot that beats FNaF UCN and currently I'm trying to make a money farm, currently the sequence of events works just fine for a random amount of time, then it just fails and gets out of order. I am using multithreading and each thread has its own robot.

public static void moneyMaker(Robot robot, TimeTracking detect){
        int warningX = 187;
        int warningY = 125;
        int tolerance = 5;
        Color color = new Color(100,85,86);
        Color checkingColor = new Color(robot.getPixelColor(warningX, warningY).getRed(),robot.getPixelColor(warningX, warningY).getGreen(),robot.getPixelColor(warningX, warningY).getBlue());
        while(!(Math.abs(color.getGreen()-checkingColor.getGreen()) <= tolerance && Math.abs(color.getBlue()-checkingColor.getBlue()) <= tolerance)){
            cameraFlipS(robot);
            robot.delay(253);
            resetMouse(robot);
            robot.delay(255);

            cameraFlipS(robot);
            robot.delay(253);


            freddyMask(robot, 250);
            robot.delay(251);

            helpy(robot);
            robot.delay(253);
            rightVent(robot);
            resetMouse(robot);
            robot.delay(132);
            checkingColor = new Color(robot.getPixelColor(warningX, warningY).getRed(),robot.getPixelColor(warningX, warningY).getGreen(),robot.getPixelColor(warningX, warningY).getBlue());
            robot.waitForIdle();
        }
    }
public static void rightVent(Robot robot){
        robot.delay(25);
        robot.keyPress(70);
        robot.delay(25);
        robot.keyRelease(70);
        robot.delay(750);
        robot.keyPress(70);
        robot.delay(25);
        robot.keyRelease(70);
    }
public static void helpy(Robot robot){
        robot.mouseMove(1371, 661);
        robot.delay(100);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
    }
twilit valeBOT
# craggy lynx I'm trying to make a bot that beats FNaF UCN and currently I'm trying to make a ...

Detected code, here are some useful tools:

Formatted code
public static void moneyMaker(Robot robot, TimeTracking detect) {
  int warningX = 187;
  int warningY = 125;
  int tolerance = 5;
  Color color = new Color(100, 85, 86);
  Color checkingColor = new Color(robot.getPixelColor(warningX, warningY).getRed(), robot.getPixelColor(warningX, warningY).getGreen(), robot.getPixelColor(warningX, warningY).getBlue());
  while (!(Math.abs(color.getGreen() - checkingColor.getGreen()) <= tolerance && Math.abs(color.getBlue() - checkingColor.getBlue()) <= tolerance)) {
    cameraFlipS(robot);
    robot.delay(253);
    resetMouse(robot);
    robot.delay(255);
    cameraFlipS(robot);
    robot.delay(253);
    freddyMask(robot, 250);
    robot.delay(251);
    helpy(robot);
    robot.delay(253);
    rightVent(robot);
    resetMouse(robot);
    robot.delay(132);
    checkingColor = new Color(robot.getPixelColor(warningX, warningY).getRed(), robot.getPixelColor(warningX, warningY).getGreen(), robot.getPixelColor(warningX, warningY).getBlue());
    robot.waitForIdle();
  }
}
#

<@&987246717831381062> please have a look, thanks.

craggy lynx
#
public static void freddyMask(Robot robot, int delay){
        delay = delay + 23;
        //System.out.println("FreddyMask");
        maskOn = true;
        for(int i = 0; i<2; i ++){
            robot.delay(100);
            robot.mouseMove(855, 1356);
            robot.delay(53);
            robot.mouseMove(21,34);
            robot.delay(delay/2);
            robot.mouseMove(0,0);
        }
        robot.delay(100);
        resetMouse(robot);
        maskOn = false;
    }
twilit valeBOT
# craggy lynx ```java public static void freddyMask(Robot robot, int delay){ delay = d...

Detected code, here are some useful tools:

Formatted code
public static void freddyMask(Robot robot, int delay) {
  delay = delay + 23;
  //System.out.println("FreddyMask");
  maskOn = true;
  for (int i = 0; i < 2; i++) {
    robot.delay(100);
    robot.mouseMove(855, 1356);
    robot.delay(53);
    robot.mouseMove(21, 34);
    robot.delay(delay / 2);
    robot.mouseMove(0, 0);
  }
  robot.delay(100);
  resetMouse(robot);
  maskOn = false;
}
craggy lynx
#

also I would like to say, this is my first time using java.awt.robot so I'm sorry if my code looks horrible

runic flare
#

idk really much tho threads don't work in sync really

craggy lynx
#

it isnt the threads, I stopped all the other threads from starting and it still has the same issue

runic flare