wtf bbq
Active Member
- Joined
- Aug 11, 2012
- Sythe Gold
- 40
- Messages
- 179
I literally have 0 coding experience.. would this skeleton work if I knew what to fill in to start automating clicks? This is actually kind of crazy and ground-breaking if true.
Program ClickOnColor;
// Function to find a color on the screen
function FindColor(color: Integer): Boolean;
var
x, y: Integer;
begin
Result := False;
// Capture the screen
CaptureScreen;
// Loop through each pixel of the captured screen
for x := 0 to ScreenWidth - 1 do
begin
for y := 0 to ScreenHeight - 1 do
begin
// Get the color of the current pixel
if GetPixel(x, y) = color then
begin
// Color found, set the result to True and exit the loop
Result := True;
Exit;
end;
end;
end;
end;
var
colorToFind: Integer;
x, y: Integer;
begin
// Example usage: find the color red (RGB value: 255, 0, 0)
colorToFind := $FF0000;
if FindColor(colorToFind) then
begin
// Get the screen coordinates of the color found
x := LastX;
y := LastY;
// Click on the screen coordinates
Click(x, y);
writeln('Clicked on color at coordinates (', x, ', ', y, ')');
end
else
writeln('Color not found');
end.
Program ClickOnColor;
// Function to find a color on the screen
function FindColor(color: Integer): Boolean;
var
x, y: Integer;
begin
Result := False;
// Capture the screen
CaptureScreen;
// Loop through each pixel of the captured screen
for x := 0 to ScreenWidth - 1 do
begin
for y := 0 to ScreenHeight - 1 do
begin
// Get the color of the current pixel
if GetPixel(x, y) = color then
begin
// Color found, set the result to True and exit the loop
Result := True;
Exit;
end;
end;
end;
end;
var
colorToFind: Integer;
x, y: Integer;
begin
// Example usage: find the color red (RGB value: 255, 0, 0)
colorToFind := $FF0000;
if FindColor(colorToFind) then
begin
// Get the screen coordinates of the color found
x := LastX;
y := LastY;
// Click on the screen coordinates
Click(x, y);
writeln('Clicked on color at coordinates (', x, ', ', y, ')');
end
else
writeln('Color not found');
end.






