selling pin$
Member
- Joined
- Jun 16, 2007
- Sythe Gold
- 0
- Messages
- 59
in java how do u find color like scar so then i can click on it? or is there a program like scar because im on a mac
Robot (robot name here) = new Robot();
Robot myrobot = new Robot();
int a;
//imports go here
//class goes here {
int a;
Robot myrobot = new Robot();
public void search(){
myrobot.getPixelColor(20,20); // 20,20 is the location of the pixel on the screen.
return a;
}
}
umm i think this is how to do it.
first set up a new robot, so
so in exampleCode:Robot (robot name here) = new Robot();Code:Robot myrobot = new Robot();
then you specify to get the color in the specified demension, but you need an int or something to store it in so create a new int.
Code:int a;
then you do the rest so the whole code should look something like this
Code://imports go here //class goes here { int a; Robot myrobot = new Robot(); public void search(){ myrobot.getPixelColor(20,20); // 20,20 is the location of the pixel on the screen. return a; } }
There answer is here:
http://java.sun.com/j2se/1.3/docs/api/java/awt/Robot.html

