Well, I read someone posting about how they couldn't figure out how to bank by using ChooseOption because 'ank' is in all the names. So, as an alternative I editted the current procedure and added Line Picking!
Now, the function will work as it used to, but also will work with a line number should you choose to use it.
Without further adieu:
SCAR Code:
{*******************************************************************************
function ChooseOption1(Option: variant): Boolean;
By: Wizzup? and Nava2
Description: Finds Popup menu, then clicks on it. Allows looking for text or
choosing an option line, first line is 1.
*******************************************************************************}
function ChooseOption1(Option: variant): Boolean;
var
B: TBox;
P: TPointArray;
X, Y, Z: Integer;
begin
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(P, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(P) = 0 Then
Exit;
B := GetTPABounds(P);
case VarType(Option) of
3: begin
B := IntToBox(B.X1, B.Y1 + 19, B.X2, B.Y2)
Z := (B.Y2 - B.Y1) mod 15;
if InRange(Option, 0, Z) then
begin
Result := true;
Mouse(B.X1 + 5, B.Y1 + ((Option-1)*15) + 6, Random(B.X2 - B.X1), 6, True);
end else
SRL_Warn('ChooseOption1', 'Line chosen does not exist.', 1);
end;
256: If FindText(X, Y, option, upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
Mouse(B.X1 + 5, y + 1, Random(B.X2 - B.X1), random(13), True);
End
else
SRL_Warn('ChooseOption1', 'Invalid Variant Type Use only integers or strings!', 1);
end;
if not Result then
begin
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));
end;
end;
Please post comments.
Nava2