Hello everyone!
Ok, here is part of my code:
Color c = robot.getPixelColor(663, 60); Color red_Battle = new Color(231,50,42); if(c.getRGB() == red_Battle.getRGB()){ Color end2 = robot.getPixelColor(6, 538); Color zero = new Color(5,5,0); while(end2.getBlue() == zero.getBlue()){ Color spd = robot.getPixelColor(72, 572); Color nula = new Color(63,61,41); if(spd.getRGB() == nula.getRGB()){ r.delay(50); r.keyPress(KeyEvent.VK_F); r.delay(50); r.keyRelease(KeyEvent.VK_F); r.delay(50); r.keyPress(KeyEvent.VK_F); r.delay(50); r.keyRelease(KeyEvent.VK_F); r.delay(50); r.keyPress(KeyEvent.VK_F); r.delay(50); r.keyRelease(KeyEvent.VK_F); r.delay(800); r.keyPress(KeyEvent.VK_A); r.delay(1000); r.keyRelease(KeyEvent.VK_F); r.delay(50); r.keyRelease(KeyEvent.VK_A); r.delay(50); r.keyPress(KeyEvent.VK_R); r.delay(50); r.keyRelease(KeyEvent.VK_R); r.delay(50); r.keyPress(KeyEvent.VK_R); r.delay(50); r.keyRelease(KeyEvent.VK_R); r.delay(1000); System.out.println("Speed 0 km/h."); } end2 = robot.getPixelColor(6, 538); } }
First color returning in statement IF is working fine.
Second color returning in statement While is working properly too.
But third not - statement IF is not running when pixel on 72x752 has the same RGB value as variable 'nula' (63,61,41).
I really can't find where is the problem