Xanith
2011-01-19 18:23:01
OpenDepositBox was pretty slow so heres a faster one =]
function RevisedOpenDepositox(Location : String; Time : integer) : Boolean;
var
z, i, T : integer;
Info : Array of Variant;
TP : Tpoint;
TPA : TPointArray;
ATPA : T2DPointArray;
begin
result := false;
if (not LoggedIn) then
Exit;
if (BankScreen) or (PinScreen) then
begin
Result := True;
Exit;
end;
case LowerCase(Location) of { Hue Sat Col Tol Dist}
'ynb', 'yanille bank',
'feb', 'falador east',
'fwb', 'falador west',
'db', 'draynor bank': Info := [0.04, 0.26, 669259, 7, 10];
'eb', 'edgeville bank',
'ctb', 'catherby bank': Info := [0.04, 0.25, 602693, 9, 1];
'clt', 'camelot bank': Info := [0.04, 1.49, 2248036, 20, 1];
'nab', 'north ardougne bank',
'sab', 'south ardougne bank': Info := [0.08, 0.13, 3755606, 7, 3];
'lb', 'lumbridge bank': Info := [0.14, 0.20, 10396074, 36, 1];
'psb', 'port sarim': Info := [0.09, 0.10, 4937313, 8, 1];
else
begin
srl_Warn('OpenDepositBox', 'Unknown bank: '+Location, warn_AllVersions);
Exit;
end;
end;
T := GetSystemTime + Time;
repeat
z := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(Info[0], info[1]);
FindColorsTolerance(TPA, Info[2], MSX1, MSY1, MSX2, MSY2, Info[3]);
debugTPA(TPA, 'a');
SetColorToleranceSpeed(z);
SetColorspeed2Modifiers(0.2, 0.2);
ATPA := SplitTPA(TPA, Info[4]);
debugATPA(ATPA, 'b');
SortATPAFromSize(ATPA, 900, True);
for i := 0 to high(ATPA) do
begin
TP := MiddleTPA(ATPA[i]);
FilterPointsPie(ATPA[i], 0.0, 360.0, 9.5, 10.9, TP.x, TP.y);
if Length(ATPA[i]) < 10 then
Continue;
debugTPA(ATPA[i], 'c');
if high(ATPA[i]) > 60 then
begin
MMouse(TP.x - 5, TP.y - 5, 10, 10);
Wait(100);
if WaitUptext('epos', 800) then
begin
ClickMouse2(true);
Result := (BankScreen) or (PinScreen); ;
Break;
end;
end;
end;
SetColorspeed2Modifiers(0.20, 0.20);
until(T >= GetSystemTime)
end;