Image img = Image.load("lol"); startScreenCapture(2); sleep(5); while(!EXIT){ Point p = findImg(img); if(p.x > -1){ click(p.x + 10, p.y + 10); break; } sleep(0.5); }