SRL Archive - SRL Suggestions

OpenDepositBox


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;

Gu3st...

2011-01-19 18:29:38

Looks nice so far! :)

You probably would want to reset the CTS at the end of the function though.. It's better practice.
And if Simba doesn't find any colors then TPA would be empty, resulting in an error somewhere in the script which could terminate the script

Xanith

2011-01-19 18:36:42

I'm still working on it =]. Right now I'm editing it for all the banks using a TVariantArray, like OpenBankFast uses.

BraK

2011-01-19 20:17:10

This is also Posted in the Wrong section. You posted in the Bugs Sectoin might have been better in the Suggestions section.

~BraK

Xanith

2011-01-19 23:57:55

From: BraK
This is also Posted in the Wrong section. You posted in the Bugs Sectoin might have been better in the Suggestions section.

~BraK



Good point, Can a Mod please move this thread to Suggestions. Thank you. =]

Xanith

2011-01-26 17:37:22

Is anyone interested in this?

**BANNED The Man

2011-01-26 17:38:48

Are you not going to finish?
If not I will try tomorrow seeing as I have a day off.

Xanith

2011-01-26 17:45:43

Well it pretty much works, but I'm not sure if i have all the deposit boxes. I know for a fact that I'm missing the on in port sarim that I'll do right now. Other than that I think it is pretty much done, I also need to add the timer too.