Originally Posted by
Petrichorr
Instead of clicking the red it just clicks the mouse randomly inside the box I made.
The moust just clicks randomly within that area.
I honestly don't know what I am doing wrong and I tend not to ask for help, but I have come to realize that mentality wont get me very far with this.
Any help or tips would be greatly appreciated.
Hi there,
I tested a slightly modified version of your code on the picture you attached and it appeared to work fine. Are you selecting the game as a target properly? Are the dimensions of the search box correct? Does this private server have some kind of color related anticheat requiring higher tolerance?
As you can see the mouse is choosing random points to click correctly here. Without the modification it worked too, only it just clicked one point (top-left) as that’s all you coded. This was my modification for testing:
Simba Code:
procedure attackAgg;
var
foundPoints: tPointArray;
clickPoint: tPoint;
begin
if findColorsTolerance(foundPoints, 1451962, 210, 269, 512, 399, 5) then
begin
clickPoint := foundPoints[random(0, high(foundPoints))]; //Select random point of the found red demon points
moveMouse(clickPoint.x, clickPoint.y);
wait(250);
clickMouse(clickPoint.x, clickPoint.y, MOUSE_LEFT);
wait(500);
end;
end;
var
i: integer;
begin
for i := 0 to 9 do
attackAgg;
end.
That said, there are of course lots of things you can do to make a better, more accurate object finding function, but I wanted you to know that your original code (with the color and tolerance you used) appears to work (on the picture at least) so the problem may be something you overlooked like window target selection.