BazzBarrett
2008-09-25 17:54:34
hey i noticed there were no deposit box functions so i made a few of my own i think u will find them quite interesting and all locations work =)
PS: if u like please vote yes for my members apliacation (Thats isent against any rules is it?) http://www.villavu.com/forum/showthread.php?t=35592?p=468153
PS: if u like please vote yes for my members apliacation (Thats isent against any rules is it?) http://www.villavu.com/forum/showthread.php?t=35592?p=468153
program New;
{.Include SRL/SRL.Scar}
Function OpenDepositBox(Location :string):boolean;
var
CTS, II, x, y, Info : Integer;
TPA : TPointArray;
ATPA: Array of TPointArray;
begin
If Not(loggedin) then exit;
case LowerCase(Location) of
'lb', 'lumbridge': Info := 3161932;//done - checked
'feb', 'falador east': Info := 406857;//done - checked
'fwb', 'falador west': Info := 406857;//done - checked
'db', 'draynor': Info := 406857;//done - checked
'eb', 'edgeville bank': Info := 4809843;//done - checked
else
begin
srl_Warn('OpenBankFast', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
End;
if GetColor(149, 38) = 2070783 Then
begin
Result := True;
Exit;
end;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 338491, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For II := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[II], X, Y)
MMouse(X, Y, 2, 2);
Wait(50+Random(10));
If(IsUpText('eposit'))then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
Mouse(x, y, 1, 1, True);
Wait(100+random(200));
For II := 0 to 10 do
begin
if GetColor(149, 38) = 2070783 Then
begin
Result := True;
Exit;
end;
if II = 10 then
begin
Result := False;
Writeln('Deposit Box Never opened!');
Exit;
end;
Wait(500+random(500));
end;
end;
Function DepositItemDepositBox(Col, Row :integer; DepositAll :boolean):Boolean;
var
Cx, Cy :integer;
begin
If Not(loggedin) then exit;
if Not(GetColor(149, 38) = 2070783) Then
begin
Result := False;
Exit;
end;
If (Row > 5) or (Col > 7) then
begin
Result := False;
Writeln('Invalid Row or col number!');
Exit;
end;
Cx := (Col*50)+70;
Cy := (Row*50)+85;
if DepositAll then
begin
mouse(Cx, Cy, 3, 3, False);
wait(200+random(200));
ChooseOption('All');
Result := true;
Exit;
end else
begin
Mouse(Cx, Cy, 3, 3, true);
wait(200+random(200));
Result := True;
end;
end;
//To deposit all just use 28 as ammount!
Function DepositBoxFast(InvSlot, Ammount :Integer; Location:string):Boolean;
var
InvPos : TPoint;
Row, Col, Info :integer;
DepAll :Boolean;
CTS, II, Cx, Cy : Integer;
TPA : TPointArray;
ATPA: Array of TPointArray;
begin
If Not(loggedin) then exit;
if (InvSlot > 28) or (InvSlot < 1) then
begin
Writeln('Invalid InvSlot!');
Exit;
end;
case LowerCase(Location) of
'lb', 'lumbridge': Info := 3161932;//done - checked
'feb', 'falador east': Info := 406857;//done - checked
'fwb', 'falador west': Info := 406857;//done - checked
'db', 'draynor': Info := 406857;//done - checked
'eb', 'edgeville bank': Info := 4809843;//done - checked
else
begin
srl_Warn('DepositBoxFast', 'Unknown Deposit Box: '+Location, warn_AllVersions);
Exit;
end;
end;
if GetColor(149, 38) = 2070783 Then
begin
Row := (InvSlot/7)+1;
if Row = 5 then Row := 4;
Col := (InvSlot/4)+1
if Col = 8 then Col := 7;
if ammount = 28 then DepAll := True;
DepositItemDepositBox(Col, Row, DepAll);
Exit;
end;
InvPos := ItemCoords(InvSlot);
mmouse(InvPos.x, InvPos.y, 3, 3);
Wait(50+random(50));
If GetUpText = '' then Exit;
Mouse(InvPos.x, InvPos.y, 3, 3, False);
if Not ChooseOption('Use') then Exit;
Wait(100+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Info, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For II := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[II], CX, CY)
MMouse(CX, CY, 2, 2);
Wait(50+Random(10));
If(IsUpText('eposit'))then
begin
Result := True;
GetMousePos(Cx, Cy);
Break;
end;
end;
Mouse(Cx, Cy, 1, 1, True);
For II := 0 to 10 do
begin
if FindColor(Cx, Cy, 9343516, 13, 350, 93, 388) Then Break;
if II = 10 then
begin
Result := False;
Writeln('Deposit Box Never Found!');
Exit;
end;
Wait(500+random(500));
end;
If Ammount = 28 then
begin
Mouse(259, 447, 5, 0, true);
Result := True;
Exit;
end else
begin
Mouse(259, 425, 5, 0, true);
Wait(200+random(200));
TypeSend(inttostr(Ammount));
Result := True;
Exit;
end;
end;
begin
SetUpSRL;
writeln(booltostr(DepositBoxFast(20, 1, 'lb')));
end.