< { Rectangle rectangle = new Rectangle(0, 0, 1365, 770); { while(true) { BufferedImage image = robot.createScreenCapture(rectangle); search: for(int x = 0; x < rectangle.getWidth(); x++) { for(int y = 0; y < rectangle.getHeight(); y++) { if(image.getRGB(x, y) == color1.getRGB()) { return true; } return false; } } } } } >
what im having a problem with is that the loop while(true) is not working and i need it to work
this method is supposed to search through a screenshot and find a pixel and if it dose not take another shot and look again but it is not doing that when i run the program