Shuttleu
2009-05-25 13:48:27
it was being asked for and it still hadn't been added to srl
~shut
{*******************************************************************************
Function DepositBox(i :Integer): TBox;
by: Shuttleu
Description: Returns a TBox of the item i slots for the deposit box.
*******************************************************************************}
Function DepositBox(i :Integer): TBox;
var
row, col: Integer;
begin
If(not(LoggedIn)) then exit;
if (i < 1) or (i > 28) then exit;
row :=i mod 7;
if row = 0 then row := 7;
col := i / 7 ;
if i mod 7 <> 0 then Inc(col);
Result.x1 := 48 + (row * 48);
Result.y1 := 13 + (col * 50);
Result.x2 := 96 + (row * 48);
Result.y2 := 63 + (col * 50);
end;
{*******************************************************************************
function DepositItemExists(i: Integer): Boolean;
by: Shuttleu
Description: Returns true if a item at point i in the deposit box is Found.
*******************************************************************************}
function DepositItemExists(i: Integer): Boolean;
var
x, y:Integer;
TB: TBox;
begin
If(not(LoggedIn)) then exit;
TB := DepositBox(i);
Result := FindColor(x, y, 65536, TB.x1 + 5, TB.y1 + 5, TB.x2 - 5, TB.y2 - 5);
end;
{*******************************************************************************
Procedure BankDeposit(i:integer);
by: Shuttleu
Description: Deposits the item at i in the deposit box
*******************************************************************************}
Procedure BankDeposit(i:integer);
var
Item: TPointArray;
T: integer;
begin
If(not(LoggedIn)) then exit;
if (i < 1) or (i > 28) then exit;
SetLength(Item, 29);
for I := 1 to 28 do
Item[i] := Point(109 + (I - 1) mod 7 * 48, 78 + (I - 1) div 7 * 50);
if ItemExists(i) then
begin
Mouse(Item[i].x, Item[i].y, 20, 20, False);
Wait(400+random(400));
if ChooseOption('sit-All') then
begin
T:=0
repeat
Inc(T);
Wait(500+random(500));
until (not(ItemExists(i))) or (T>=30);
end;
end;
end;
{*******************************************************************************
function DepositScreen: Boolean;
by: Shuttleu
Description: Returns true if deposit screen is Found.
*******************************************************************************}
function DepositScreen: Boolean;
begin
If(not(LoggedIn)) then exit;
Result := FindText(x, y, 'ank', upchars, 92, 29, 396, 54);
end;
{*******************************************************************************
function OpenDeposit : Boolean;
by: Shuttleu
Description: Opens the deposit box.
*******************************************************************************}
function OpenDeposit : Boolean;
var
T:integer;
begin
If(not(LoggedIn)) then exit;
begin
FindNormalRandoms;
if FindObjTPA(x, y, 739167, 10, -1, 30, 30, 1, ['ank', 'epos', 'sit']) then
begin
Mouse(x, y, 5, 5, True);
Result:= True;
T:=0
repeat
Inc(T);
Wait(500+random(500));
until (DepositScreen) or (T>=30);
end else
Writeln('Coluld not find open the deposit box');
end;
end;~shut