Quote:
Originally Posted by
Male
I used to work with Simba a long time ago for botting. Now I am revisiting for non-rs use and automating a Microsoft Dynamics NAV task that would have to work on multiple different PC's (disregarding resolution, Windows Language, program version, etc).
I have decided to go with Colors instead of co-ordinates as some users may have moved the windows around.
My question is (after looking around and not finding a clear solution): How to use FindColor without any tolerances and use MoveMouse/ClickMouse to utilize that color.
I am assuming Define/Store specific color when declaring variables -> FindColor to get new X,Y coords of saved color -> MoveMouse(x,y)
If someone could point me in the right direction that would be appreciated. I have most definitely lost my knowledge of Simba since I used it years ago and it appears some of the functions have vastly changed.
Thank you!
The
Simba Code:
program new;
const
MOUSE_MOVE = 3;
procedure Mouse(const x, y, Button: Int32);
begin
MoveMouse(x, y);
if (Button = MOUSE_MOVE) then Exit;
Wait(Random(15, 25));
HoldMouse(x, y, Button);
Wait(Random(60, 100));
ReleaseMouse(x, y, Button);
end;
function ClickColor(const Color, Button: Int32): Boolean;
var
x, y, w, h: Int32;
begin
GetClientDimensions(w, h);
if FindColor(x, y, Color, 0, 0, w-1, h-1) then
begin
Mouse(x, y, Button);
Result := True;
end;
end;
begin
ClearDebug();
SetDesktopAsClient();
ClickColor($FFFFFF, MOUSE_MOVE);
end.