SRL Archive - SRL Archives

Bank Tabbing


Narcle

2008-09-26 20:46:21

Tested all three of these, they all work well.

{*******************************************************************************
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;

NiCbaZ

2008-09-30 05:28:43

Nice i made some as well


{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Function IsBankTabOpen(WichTab:String) : Boolean
By: Nicbaz
Description: Returns True if your tab is open
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function IssBankTabOpen(WhichTab: Integer) : Boolean;

begin
Result := (GetColor(62 + (WhichTab - 1) * 49, 56) = 2896954 );
end;

{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function BankTab(NumberOfTab: Integer): Boolean;
By: Nicbaz
Description: Changes to the tab you select
Status: Good
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-}
function BankkTab(NumberOfTab: Integer): Boolean;
begin
if (NumberOfTab <1) or (NumberOfTab > 9) then
begin
srl_Warn('BankTab',inttostr(NumberOfTab)+' BankTab does not exist',warn_AllVersions);
Result := False;
Exit;
end;
if (IsBankTabOpen(NumberOfTab)) then
Exit;
MouseBox(34 + (NumberOfTab - 1) * 50, 54, 34 + (NumberOfTab - 1) * 50, 75, 1);
end;

yours look nicer tho…

ZephyrsFury

2008-10-07 06:07:23

Added. :)