< import java.awt.*; import java.awt.event.*; import java.awt.Robot; import java.awt.AWTException; import java.awt.Rectangle; import java.awt.Color; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Forage { public static void main() throws Exception { int[] anArray; Robot robot = new Robot(); anArray = new int[5]; anArray[4] = (new Color(91, 147, 191)).getRGB(); anArray[3] = (new Color(215, 201, 79)).getRGB(); anArray[2] = (new Color(74, 93, 132)).getRGB(); anArray[1] = (new Color(74, 93, 132)).getRGB(); anArray[0] = (new Color(91, 147, 191)).getRGB(); Rectangle rectangle = new Rectangle(0, 0, 1365, 770); BufferedImage image = robot.createScreenCapture(rectangle); int[] pixels = image.getRGB(0, 0, image.getWidth(), image.getHeight(), null, 0, image.getWidth()); for(int x = 0; x < rectangle.getWidth(); x++) { for(int y = 0; y < rectangle.getHeight(); y++) { for (int i = 0; i < pixels.length; i++) { if (Array.equals(anArray, Array.copyOfRange(pixels, i, i + anArray.length))) { robot.mouseMove(x, y); robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK); robot.delay(10); robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK); System.out.println("opened"); } } } } } } >
i am getting 6 errors:
this error is the first 4 of the six, i thought image was defined by the buffered image line of code, line 29:
java:27
cannot find symbol
variable image
int[] pixels = image.getRGB(0, 0, image.getWidth()
error 2:
this error is the last 2 of the 6:
java:36 cannot find symbol
variable Array
if (Array.equals(anArray,
and i don't know how to solve this problem at all