ScreenCapture with Robot Class (code not working)

thank you for your help. sadly it doesnt work because on different distances it has a different colour value and wont recognise it. but thanks anyway