Tested all three of these, they all work well.
SCAR Code:
{*******************************************************************************
Function CurrentBankTab: Integer;
by: Narcle
Description: Returns Current Bank Tab selected
*******************************************************************************}
Function CurrentBankTab: Integer;
var
i: integer;
begin
if not BankScreen then
Exit;
for i := 0 to 8 do
if GetColor(40 + 48 * i, 83) = 2896954 then
begin
Result := i + 1;
Exit;
end;
end;
{*******************************************************************************
Function ExistsBankTab(T: Integer): Boolean;
by: Narcle
Description: Returns true if Bank Tab Exists
*******************************************************************************}
Function ExistsBankTab(T: Integer): Boolean;
var
x, y: integer;
begin
if not BankScreen then
Exit;
if T = 1 then
Result := true;
if FindColor(x, y, 65536, 27+(T-1)*48, 51, 75+(T-1)*48, 81) then
Result := true;
end;
{*******************************************************************************
Function BankTab(T: Integer): Boolean;
by: Narcle
Description: If Bank Tab is there will swith to it
*******************************************************************************}
Function BankTab(T: Integer): Boolean;
begin
if not BankScreen then
Exit;
if T = CurrentBankTab then
Begin
Result := true;
Exit;
end;
if not ExistsBankTab(T) then
srl_Warn('BankTab', 'Bank Tab '+inttostr(T) +' does not Exist.', warn_AllVersions)
else
Mouse(48 * T, 57, 10, 10, true);
Result := T = CurrentBankTab;
end;