From: abu_jwka
You have to name where the Folder is located!!!
Go to your folder you just created, open it. Now look at the address bar, copy and paste that into the function.
And remember to put quotation marks '' around the folder when you paste it in the brackets.
EDIT: You clearly didn't follow the instructions I gave you in the above post :|
EDIT2: This is not a double-post, user deleted his comments
Alright, so, I basically did what you said… I have a folder located in C:\Simba\Screenshots. The script compiled and it found the color at that area, then it moved the mouse there, but I still don't see any screenshots in that folder… here is the script:
program ClientDimensionsAndFindColorToleranceMoveMouseExample;
var
w, h, x, y: Integer;
Red: Integer;
begin
SetDesktopAsClient;
GetClientDimensions(w, h);
WriteLn('The Current Clients Dimensions are: ' + ToStr(w) + ', ' + ToStr(h));
Red := 16771541; // Used Simba's color picker to get a red color, this will be used below
(* FindColorTolerance, what this does is finds the color specified in specified box area (xs, ys, xe, ye)
if found it will return where the color was found in the x and y variables. Tolerance is, should this be
the exact same color or can it be slightly differet. 0 tolerance means it has to be the same exact color
anything above 0 means the color can be slightly different (different shades will be searched for)
if found, returns True *)
// So this will search the entire desktop for that color with tolerance 30 starting from the Top left point of the desktop to the bottom right point
// Then it will Move your mouse to that color found
if FindColorTolerance(x, y, Red, 480, 507, 1234, 541, 30) then
begin
WriteLn('Found Red color at: ' + ToStr(x) + ', ' + ToStr(y));
MoveMouse(x, y);
SaveScreenshot('C:\Simba\Screenshots');
end
else
begin
// If The color isn't found it will not be stored in variables x, and y meaning they will be still set to 0
WriteLn('x any y are unset: ' + ToStr(x) + ', ' + ToStr(y));
MoveMouse(x, y);
end;
end.