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);
}