Simba Code:
function FindClickBox(HowManyBoxes, WhichBox: Integer): Boolean;
var
aFoundBox: TBoxArray;
begin
result := false;
if not inrange(HowManyBoxes, 1, 5) then
srl_warn('LogsChatBox', 'Too many boxes to choose!', warn_AllVersions);
SetLength(aFoundBox, HowManyBoxes);
case HowManyBoxes of
1: aFoundBox[0] := IntToBox(226, 449, 292, 506);
2:// 2 Boxes in the Chat Box screen.
begin
aFoundBox[0] := IntToBox(170, 449, 253, 506);
aFoundBox[1] := IntToBox(266, 449, 349, 506);
end;
3:// 3 Boxes in the chat box screen.
begin
aFoundBox[0] := IntToBox(119, 449, 204, 506);
aFoundBox[1] := IntToBox(217, 449, 302, 506);
aFoundBox[2] := IntToBox(315, 449, 400, 506);
end;
4:// 4 Boxes in the chat box screen.
begin
aFoundBox[0] := IntToBox(70, 449, 155, 506);
aFoundBox[1] := IntToBox(168, 449, 253, 506);
aFoundBox[2] := IntToBox(266, 449, 351, 506);
aFoundBox[3] := IntToBox(364, 449, 449, 506);
end;
5:// 5 Boxes in the chat box screen.
begin
aFoundBox[0] := IntToBox(75, 449, 136, 506);
aFoundBox[1] := IntToBox(152, 449, 213, 506);
aFoundBox[2] := IntToBox(229, 449, 290, 506);
aFoundBox[3] := IntToBox(306, 449, 367, 506);
aFoundBox[4] := IntToBox(383, 449, 444, 506);
end;
end;
if (CountColorTolerance(1710098, MCX1, MCY1, MCX2, MCY2, 1) > 5000) then
begin
MouseBox(aFoundBox[WhichBox - 1].x1,aFoundBox[WhichBox - 1].y1 - 50,
aFoundBox[WhichBox - 1].x2,aFoundBox[WhichBox - 1].y2 - 50, mouse_left);
result := WaitColorCount(9614019, MCX1, MCY1, MCX2, MCY2, 42, 10000, 56000, 5000);
end else
Writeln('Not enough colors found in chat box.');
end;
begin
SetupSRL;
ActivateClient;
if FindClickBox(4, 1) then
writeln('success');
end.