SRL Archive - Research & Development Lounge

HOpenBank


ShowerThoughts

2008-05-05 05:22:57

Hey, I made a New bank opener!(for the blind people this is the junior section)

Features:
- Handles Pin
- in 1 mouse move and fast!
- I am pretty sureIi am going to use this in the future because it works great and does what it haves to do!

Program Hermpie;
{.Include SRL/SRL.Scar}


Function IsBankOpen(MaxTime:Integer; CheckForPinScreen:Boolean):Boolean;
Var
Timer :Integer;
Begin
MarkTime(Timer);
Repeat
Wait(100);
If CheckForPinScreen Then Result:=PinScreen;
If Result Then Break;
Until (BankScreen or (TimeFromMark(Timer) > MaxTime));
Result:= TimeFromMark(Timer) < Maxtime;
If Not Result Then Writeln('Failed To Find The BankScreen.');
End;


//By Hermpie
Function HOpenBank(WhichBank :String; HPin:Integer):Boolean;
Var
TempTpa: TpointArray;
Temp: T2DPointArray;
H, CTS, I, MSpeed, TempX, TempY, HColor, M:Integer;
Begin
M:=GetSystemTime;
Case LowerCase(WhichBank) Of
'feb','falador east':HColor:= 2243147;//4481401
'fwb','falador west':HColor:= 3496051;//4481401
'veb','varrock east':HColor:= 2050647;//2838878
'vwb','varrock west':HColor:= 1653574;
'akb','alkharid':HColor:= 738138;
'dnb','draynor':HColor:= 5929095;
'evb','edgevillage':HColor:= 2636871;
'pcb','pestcontrol':HColor:=11647942;
End;
If HColor < 1 Then Writeln('Your Choice Is A Not Existing Bank.');
If (lowercase(WhichBank)='dnb') or (lowercase(WhichBank)='draynor') Then MakeCompass('W') else MakeCompass('N');
MSpeed:=MouseSpeed;
MouseSpeed:=20;
if not LoggedIn Then Exit;
CTS := GetColorToleranceSpeed;
If not CTS = 2 Then ColorToleranceSpeed(2);
FindColorsSpiralTolerance(TempX, TempY, TempTPA, HColor, MSX1+10, MSY1+10, MSX2-10, MSY2-10, 10);
Temp:= TPAtoATPAEx(TempTPA, 17, 18);
SortATPASize(Temp, True);
H:=High(Temp);
For I := 0 To H Do
Begin
MiddleTPAEx(Temp[i], TempX, TempY);
MMouse(TempX, TempY, 3, 3);
Wait(30+random(10));
Result:=IsUpText('ank');
If Result Then Break;
End;
If Result Then
Begin
Mouse(TempX, TempY, 0, 0, False);
Wait(40+random(10));
Result:=ChooseOption('uickly');
If Result Then Result:=IsBankOpen(5000,True);
If Pinscreen Then Result:= InPin(InttoStr(HPin));
If Result Then Result:=IsBankOpen(5000,False);
end;
If Result Then Writeln('HOpenBank Succesfully Openend The Bank. In '+IntToStr(GetSystemTime - M)+' MiliSecs.');
If Not result Then Writeln('HOpenBank Did Not Open The Bank. ');
ColorToleranceSpeed(CTS);
MouseSpeed:=MSpeed;
MakeCompass('N');
End;

Begin
SetUpSRL;
ActivateClient;
HOpenBank('Draynor',1000);
End.
I could also take the 'Useless' Debug out of it but it works great!

So What You Think Of It?

Hermpie
Yes, I should re pick all the colours.

Naum

2008-05-05 05:27:12

I like this Hermpie, Because Instead of Doing it seperately, It checks for The Pin Screen aswell ;).

I think SRL might need to take an idea based on this.
Good Work :)

ShowerThoughts

2008-05-05 05:30:53

Thanks,The good thing of this is it is fast, most of the time in 1 click and it handles click the bank + solving pin so kinda from clicking to the bank screen.
i maybe have to take that changing mouse speed out else it will go to the bank like hell and then the normal mousespeed again.

Hermpie

King of the Nites

2008-05-05 20:30:32

I may want to use this in my script… Can I? It looks really good and I want to use it. I may add it after I am done with my script if i notice my banking isnt working well. Good Job!

drizzt

2008-05-05 20:59:54

From: king of the nites
I may want to use this in my script… Can I? It looks really good and I want to use it. I may add it after I am done with my script if i notice my banking isnt working well. Good Job!


i'm not hermpie, but would he post it in the public test corner if he didn't want you to use it?

nice function hermpie

Cazax

2008-05-05 21:03:27

here is my universal bank finder:
function findbank(var x,y : integer): boolean;
var
tpa,tpa2,tpa3 : tpointarray;
atpa : t2dpointarray;
tcts,t : integer;
begin
tcts := getcolortolerancespeed;
t := getsystemtime;
colortolerancespeed(2);
setcolorspeed2modifiers(0.5, 1.0);
findcolorsspiraltolerance(mscx, mscy, tpa, 5002587, msx1, msy1, msx2, msy2, 4);
setcolorspeed2modifiers(0.2, 0.2);
colortolerancespeed(3);
setcolorspeed3modifiers(8);
findcolorsspiraltolerance(mscx, mscy, tpa2, 5199193, msx1, msy1, msx2, msy2, 2);
setcolorspeed3modifiers(4);
colortolerancespeed(tcts);
tpa3 := combinetpa(tpa, tpa2);
if length(tpa3) < 1 then exit;
atpa := splittpaex(tpa3, 3, 1);
if length(atpa) < 1 then exit;
for i := 0 to high(atpa) do
begin
middletpaex(atpa[i], x, y);
mmouse(x, y, 3, 3);
wait(50 + random(50));
if pos('ank', rs_getuptext) > 0 then
begin
writeln('finding a bank took: '+inttostr(getsystemtime - t));
result := true;
getmousepos(x, y);
exit;
end;
end;
end;
A bit slower than your becouse it use HSL + XYZ. Anyway, good job hermpie :)

ShowerThoughts

2008-05-09 05:31:25

From: Cazax
here is my universal bank finder:
function findbank(var x,y : integer): boolean;
var
tpa,tpa2,tpa3 : tpointarray;
atpa : t2dpointarray;
tcts,t : integer;
begin
tcts := getcolortolerancespeed;
t := getsystemtime;
colortolerancespeed(2);
setcolorspeed2modifiers(0.5, 1.0);
findcolorsspiraltolerance(mscx, mscy, tpa, 5002587, msx1, msy1, msx2, msy2, 4);
setcolorspeed2modifiers(0.2, 0.2);
colortolerancespeed(3);
setcolorspeed3modifiers(8);
findcolorsspiraltolerance(mscx, mscy, tpa2, 5199193, msx1, msy1, msx2, msy2, 2);
setcolorspeed3modifiers(4);
colortolerancespeed(tcts);
tpa3 := combinetpa(tpa, tpa2);
if length(tpa3) < 1 then exit;
atpa := splittpaex(tpa3, 3, 1);
if length(atpa) < 1 then exit;
for i := 0 to high(atpa) do
begin
middletpaex(atpa[i], x, y);
mmouse(x, y, 3, 3);
wait(50 + random(50));
if pos('ank', rs_getuptext) > 0 then
begin
writeln('finding a bank took: '+inttostr(getsystemtime - t));
result := true;
getmousepos(x, y);
exit;
end;
end;
end;
A bit slower than your becouse it use HSL + XYZ. Anyway, good job hermpie :)


Thanks good Job To!
And Yes Every One can use it!

BKNYKavkaz

2008-05-13 16:18:30

Wow, looks very nice. I will give this a try.

ShowerThoughts

2008-05-15 14:26:52

Thanks