Log in

View Full Version : Amazing bank finder and opener inside ;)



IronTeapot
11-11-2006, 06:34 AM
I wrote this because the SRL findbank's weren't always working for the script I'm writing. Even if you dont want to use it for anything, just check it out. :)

Try standing near a bank, but with the actual bank out of your view for best results. Oh and low quality of course, the roofs are evil in high quality....


program LocateBank;
{.include srl/srl.scar}

Procedure prepareClient;
begin
SetupSRL;
ClearDebug;
ActivateClient;
MakeCompass('N');
HighestAngle;
//SetRun(true);
Writeln('Setup Complete');
end;

Procedure OpenMyBank;
//Will rotate the screen and change the angle until the bank is found
var
i,WA,WC:Integer;
begin
WC:=1
WA:=1
repeat
if(FindObj(x,y,'ank',5066840,5))then
begin
mouse(x,y,1,1,false);
if (ChooseOption(x, y, 'quickly')) then
begin
Flag;
repeat
Wait(100);
i := i + 1
until (BankScreen) or (i >= 50);
end;
end;
if (not(BankScreen))then
begin
case WC of
1:MakeCompass('W');
2:MakeCompass('E');
3:MakeCompass('S');
4:MakeCompass('N');
else Writeln('Can not find the bank at Highest Angle.');
end;
end;
WC:=WC+1;
if (WC=5) and (WA=1)then
begin
Writeln('Trying Lowest Angle.');
LowestAngle;
WC:=1
WA:=2
end;
until(BankScreen)or (WC=5)and (WA=2);
if (not(BankScreen))then
Writeln('Can not find the bank at all.');
end;


begin
prepareClient;
OpenMyBank;
Writeln('The bank should be open now');

end.


Please comment. I just had to share this with someone.

YoHoJo
11-11-2006, 07:20 AM
pretty ok but its kinda specific with the making compass North and lowest angle and all of that.
Seems functional to me though.
Should put it in SRL snippets sections, its not really a question :p

Pentti
11-11-2006, 07:41 AM
This bank finding script looks very good and works good.



I wrote this because the SRL findbank's weren't always working for the script I'm writing.

SRL's OpenBank3; works good for me.

IronTeapot
11-11-2006, 04:47 PM
Well i put it here because of 'All SRL Related Questions/Bugs/Enhancements in here...' so it would be an enhancement i suppose. and srl snippet section? i dont see that forum, possibly members only? Ill explain why its so specific.

the banks in rs are all aligned along the n,s,e or w axis, thats why it only needs to be turned to those to get the best viewing results. Many scripts are run on highestangle mode, and if something messed up and the bank was out of view on any of the highest angle settings, then moving to lowestangle increases the horizon vanishing point quite a bit.

Pentti
11-11-2006, 04:54 PM
the banks in rs are all aligned along the n,s,e or w axis, thats why it only needs to be turned to those to get the best viewing results.

Yup, thats true. But compass can be made to right wiev by using example this:

...
MakeCompass('W') //or S or N or E
OpenBank3;
...

I'm not saying now that your bank finder isn't good.
Only wanted to show how this can be made other way. :)

IronTeapot
11-11-2006, 06:46 PM
I know, thats what this does


case WC of
1:MakeCompass('W');
2:MakeCompass('E');
3:MakeCompass('S');
4:MakeCompass('N');
else Writeln('Can not find the bank at Highest Angle.');
end;


if it doesent find the bank when facing north, then it changes the case and tries it from the other angle.

CamHart
11-12-2006, 02:33 AM
I was having the same problem, so i made a special dtm thing that works specifically for the banks i was useing... Knowing that all banks face n, s, e, w could make mine work for any bank i think. Yours is simpilar than mine, so ill give it a go :D

Sumilion
11-12-2006, 08:14 AM
Well you could use FindDtmRotated, then it wouldn't matter what position the bankbooth is in :) however the colors might differ too much in other banks :(

wasteland75
11-12-2006, 03:32 PM
thanks for this! ill be using it in my first script!:cool:

IronTeapot
11-12-2006, 05:57 PM
wasteland75 if you do use it, you just better give credit for it.

JuKKa
11-12-2006, 08:04 PM
im gonna use it for my yew chopper credits goes to u!

Line 49: [Error] (15547:1): Unknown identifier 'LowestAngle' in script

could u include that procedure?

Pentti
11-12-2006, 08:37 PM
procedure LowestAngle;
begin
KeyDown(VK_Down)
sleep(1000 + random(100) + random(200));
KeyUp(VK_Down)
wait(1000 + random(100));
end;