Simba Code:
{
========
FindBank
========
}
type
TBank = record
Name : string;
BankCol : TColEx;
CountMin, CountMax : integer;
end;
Var
GLOBALBANKS : Array [0..8] of TBank;
Const
BANK_VWEST = 0;
BANK_CHEST = 1;
BANK_VEAST = 2;
BANK_SEERS = 3;
BANK_FALADOREAST = 4;
BANK_LUMBRIDGE = 5;
BANK_ALKHARID = 6;
BANK_DRAYNOR = 7;
BANK_FALADORWEST = 8;
procedure defineOurBanks();
begin
with GLOBALBANKS[BANK_VWEST] do
begin
Name := 'Varrock West';
BankCol.Create(1850696, 10, 0.07, 0.84);
countMin := 350;
countMax := 1400;
end;
with GLOBALBANKS[BANK_CHEST] do
begin
Name := 'Chest';
BankCol.Create(6119012, 12, 0.20, 0.08);
countMin := 400;
countMax := 600;
end;
with GLOBALBANKS[BANK_VEAST] do
begin
Name := 'Varrock East';
BankCol.Create(2574677, 4, 0.12, 0.45);
countMin := 150;
countMax := 500;
end;
with GLOBALBANKS[BANK_SEERS] do
begin
Name := 'Seers Village';
BankCol.Create(3757412, 1, 0.25, 0.82);
countMin := 200;
countMax := 400;
end;
with GLOBALBANKS[BANK_FALADOREAST] do
begin
Name := 'Falador East';
BankCol.Create(4020076, 6, 0.07, 0.26);
countMin := 50;
countMax := 350;
end;
with GLOBALBANKS[BANK_LUMBRIDGE] do
begin
Name := 'Lumbridge';
BankCol.Create(607066, 1, 0.21, 1.86);
countMin := 40;
countMax := 300;
end;
with GLOBALBANKS[BANK_ALKHARID] do
begin
Name := 'Alkharid';
BankCol.Create(5660003, 6, 0.63, 0.79);
countMin := 150;
countMax := 300;
end;
with GLOBALBANKS[BANK_DRAYNOR] do
begin
Name := 'Draynor Village';
BankCol.Create(5660003, 6, 0.63, 0.79);
countMin := 150;
countMax := 300;
end;
with GLOBALBANKS[BANK_FALADORWEST] do
begin
Name := 'Falador West';
BankCol.Create(4151920, 6, 0.07, 0.22);
countMin := 150;
countMax := 300;
end;
end;
{
========================================
Function: TBank.Find(var p:TPoint): boolean
Description: Finds the bank specified bank.
Example: GLOBALBANKS[BANK_LUMBRIDGE].Find(pnt);
========================================
}
function TBank.Find(var p:TPoint): boolean;
var
i:integer;
TPA:TPointArray;
ATPA:T2DPointArray;
tmpCTS: integer;
begin
if IsBankOpen then
Exit(true);
if Self.BankCol.FindAllIn(AREA_MS, TPA) then
begin
ATPA := ClusterTPAEx(TPA, 1, 1);
SortATPaFromMidPoint(ATPA, MSCP);
FilterTPAsBetween(ATPA, 0, Self.CountMin);
FilterTPAsBetween(ATPA, Self.CountMax, 10000);
if Length(ATPA) < 1 then Exit;
for i := 0 to High(ATPA) do
begin
p := ATPA[i].MidPnt;
HumanMMouse(p, -5, 5);
if waitUpTextMulti(['Bank Ba','Bank bo','booth','eposit','t box','Use Bank chest','ank chest','k Chest', 'chest'], 500) then
Exit(true);
end;
end;
end;
{
========================================
Function: TBank.Interact(var p:TPoint; Click: boolean): boolean;
Description: Finds and interacts with the bank using the OpenBankPoint function (..Aerolib/core/bank.simba).
Example: GLOBALBANKS[BANK_LUMBRIDGE].Interact(pnt, true); [True = Left click. False = Right click]
========================================
}
function TBank.Interact(var p:TPoint; Click: boolean): boolean;
begin
if isBankOpen() then Exit(true);
if not Self.find(p) then Exit(false);
Result := openBankPoint(p, Click);
end;