SCAR Code:
{*******************************************************************************
function ClickMouseOption(x, y, rx, ry: Integer; Option: String; UpText, ChooseOpt: TStringArray): Boolean;
By: Coh3n
Description: Either clicks the specified option, or right clicks and chooses the
option, or random click/right click, and chooses the option.
i.e ClickMouseOption(x, y, 4, 4, 'Random', ['Gate'], ['Open']);
*******************************************************************************}
function ClickMouseOption(x, y, rx, ry: Integer; Option: String; UpText, ChooseOpt: TStringArray): Boolean;
begin
if not InStrArr(Option, ['random', 'right', 'left'], False) then SRL_Warn;
Result := WaitUpTextMulti(UpText, 100 + Random(400));
if not Result then SRL_Warn;
if Option = 'random' then
case Random(2) of
0: Option := 'left';
1: Option := 'right';
end;
Mouse(x, y, rx, ry, Option = 'left');
if Option = 'right' then
ChooseOptionMulti(ChooseOpt);
end;
//Reflection version, basically the same thing.
function R_ClickMouseOption(x, y, rx, ry: Integer; Option: String; UpText, ChooseOpt: TStringArray): Boolean;
begin
if not InStrArr(Option, ['random', 'right', 'left'], False) then SRL_Warn;
Result := WaitUpTextMulti(UpText, 100 + Random(400));
if not Result then SRL_Warn;
if Option = 'random' then
case Random(2) of
0: Option := 'left';
1: Option := 'right';
end;
Mouse(x, y, rx, ry, Option = 'left');
if Option = 'right' then
R_ChooseActionMulti(ChooseOpt);
end;