Code:
function ClickOption(s : String; i : Integer) : Boolean; //by RSN
var
x, y, tmpMask : Integer;
begin
tmpMask := CreateBitmapMaskFromText(s, UpChars);
case i of
1 :
begin
if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 0, 520, 340, 10, 50)) then
begin
Mouse(x + (Length(s) * 6 div 2), y + 5, 3, 3, True);
Result := True;
Wait(250);
end;
end;
2 :
begin
if (FindBitmapMaskTolerance(tmpMask, x, y, 550, 200, 750, 470, 10, 50)) then
begin
Mouse(x + (Length(s) * 6 div 2), y + 5, 3, 3, True);
Result := True;
Wait(250);
end;
end;
3 :
begin
if (FindBitmapMaskTolerance(tmpMask, x, y, 0, 340, 500, 460, 10, 50)) then
begin
Mouse(x + (Length(s) * 6 div 2), y + 5, 3, 3, True);
Result := True;
Wait(250);
end;
end;
end;
FreeBitmap(tmpMask);
end;