Hey got inspired of a few other threads here and decided to start building a java wow bot that read info from the screen directly, by reading pixelcolor, however i have run into a little snag, i need to parse the a square of the game area for a strong yellow color rgb(>150, >150>, <10)
to do this i build a multilevel array with these two functions and then parse each item and checks if they fir the bill on the yellow color, thing is, this is a very slow way of doing it with a complexity(se code) at 30 it takes atleast 10 seckonds, which is alot thinking that this code is going to be run every
0.2 seckond when looking for a target, any help to optimize this would be of great help
Code:
public ArrayList<ArrayList<Color>> getColorGrid(int fx, int fy, int tx, int ty, int complexity) {
ArrayList<ArrayList<Color>> result = new ArrayList<ArrayList<Color>>();
while (fy < ty) {
result.add(getColorLine(fx, tx, fy, complexity));
fy = fy+10+complexity;
}
return result;
}
public ArrayList<Color> getColorLine(int fx, int tx, int y, int complexity) {
ArrayList<Color> colorList = new ArrayList<Color>();
while(fx < tx) {
colorList.add(robot.getPixelColor(fx, y));
fx = fx+10+complexity;
}
return colorList;
}