SRL Archive - Test corner

New Bank Function...


WT-Fakawi

2006-02-28 06:34:12

Here is a little something I wrote, I would like to get some input from…

Function Bank(TheBank:string): Boolean;

It finds and opens any bank in the free world.

Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)

I would appreciate if members would give it a go and see if it is accurate enough. It uses FindDTMRotated, so theoretically it should be able to find it @ any angle, but I would advice you to keep the MM "northish"…

How to run this script:

0. Fill in @ which Bank you are standing.
1. Set BankColor Manual…
2. be sure the BankSymbol is not in the minimap upon running the script.
3. Run the script.
4. Walk to the bank, stop clicking when the BankColor comes into MM-display.
5. Observe if it opens.
6. Provide feedback.

TIA!

[FONT="Courier New"]program FindBanks;

{.include SRL/SRL.scar}

Procedure DeclarePlayers;
begin
NumberOfPlayers(1); // Sets the Players Array Length;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
end;


//*************************************************************************//

Procedure SetUp;
begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;

{*******************************************************************************
Function Bank(TheBank:string): Boolean;
By: WT-Fakawi
Description: Finds and open any bank in the free world.
Valid arguments are:
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'ak' (Al-Kharid Bank)
*******************************************************************************}

Function Bank(TheBank:string): Boolean;
var DB,FEB,FWB,VEB,VWB,AKB:integer;
var dbx,dby,TheDTM:Integer;
var WhichAngle: Extended;
var WhichBank:string;

begin

DB := DTMFromString('78DA636C67626008644001FFFFFD63F80FA41' +
'9416C2060AC01AAF182C8B140D5FCF9C304A619A17CB09A204C35' +
'22E86AC2F09B0300F8811153');
FEB := DTMFromString('78DA63AC67626088634001FFFFFD63F80FA41' +
'9416C2060AC01AA4987C83141D5FCF9C3C4C0055503028CAD44A8' +
'E924AC0600131E11B5');
FWB := DTMFromString('78DA636C676260086540038C0CFFC12403C37' +
'F206004A98986C8304155FCF9C3C4C0055503D6D14C849A6EC26A' +
'009F5A0EA1');
VEB := DTMFromString('78DA63EC61626008624001FFFFFD63F80FA41' +
'9416C2060EC00AA8982C83141D5FCF9C3C4C0055503028C138850' +
'D343580D00122211A9');
VWB := DTMFromString('78DA636C636260F064400133D7CC63F80FA41' +
'981F83F1030F603D57843E498A06AFEFC6162E082AA0101B01A67' +
'22D404E35703007970105E');
AKB:= DTMFromString('78DA636C606260F06140019D9D710CFF81342' +
'310FF0702C652A01A37881C1354CD9F3F4C0C5C5035200056E345' +
'841A3FFC6A002A3B0F97');

WhichBank := Lowercase(TheBank);
if WhichBank = 'feb' then TheDTM := FEB;
if WhichBank = 'fwb' then TheDTM := FWB;
if WhichBank = 'db' then TheDTM := DB;
if WhichBank = 'veb' then TheDTM := VEB;
if WhichBank = 'vwb' then TheDTM := VEB;
if WhichBank = 'akb' then TheDTM := AKB;

if FindColor(dbx, dby, BankColor, MMX1, MMY1, MMX2, MMY2) then
begin
if FindSymbol(dbx, dby, 'Bank') then
begin
MouseFindFlag(dbx, dby, 1, 1);
FFlag(5);
if FindDtmRotated(TheDTM, dbx, dby, MMX1, MMY1, MMX2, MMY2, -(PI/2), PI/2, 1, WhichAngle)then
begin
Mouse(dbx, dby, 0, 0, True);
FFlag(5);
OpenBank3;
FixBank;
Result:=True;
TerminateScript;
end
else
If FindObj3(dbx, dby, 'booth', 2111560, 20) then // look for bank using different method, not finished yet...
begin
OpenBank3;
FixBank;
Result:=True;
TerminateScript;
end
else
PerfectNorth; // may be commented out.......
end
end
FreeDTM(DB);
FreeDTM(VEB);
FreeDTM(VWB);
FreeDTM(FEB);
FreeDTM(FWB);
FreeDTM(AKB);


end;

//*************************************************************************//
//
// Main EventLoop
//*************************************************************************//

begin

Setup;

// SET MANUAL BANK COLOR!!!!!, or use GetSymbolColor(x,y,'Bank') once !
//BankColor:=GetSymbolColor(x,y,'Bank');
BankColor := 4972259;

repeat
if Bank('FEB') then
writeln('Found ')
else
writeln('missed');
until(False);

end.[/FONT]

The Un-Named

2006-02-28 09:28:37

Looks useful.

Dankness

2006-02-28 17:49:16

how bout a edgeville banker dtm also, Theres alot of useful stuff at edge so itd be nice :) Looks wonderful thou and i'm sure its as perfect as your other scripts.

WT-Fakawi

2006-02-28 18:11:34

I knew there was one I forgot.

Haha, never been to Edgeville ;)

Your the Edgeville Man, I am the Draynor Guy.

cause

2006-03-01 12:10:46

looks good, ill try it out hopefully today after school! boring :)
EDIT: when u say:
// SET MANUAL BANK COLOR!!!!!, or use GetSymbolColor(x,y,'Bank') once !
//BankColor:=GetSymbolColor(x,y,'Bank');

do u mean mini map color? or banker?

WT-Fakawi

2006-03-01 13:12:51

I mean the MiniMap BankSymbol Color. You can set that manually, or if you are unsure which color it is ,stand @ the Bank and use these lines once:

BankColor:=GetSymbolColor(x,y,'Bank');
writeln('BankColor:='+IntToStr(BankColor)+';');



Now, grab the BankColor:=…….; line and replace it in your script.


GetSymbolColor grabs the BankSymbol Color on the MiniMap.
FindSymbol finds the specified symbol on the MiniMap.

Dankness

2006-03-01 16:30:41

From: WT-Fakawi
I knew there was one I forgot.

Haha, never been to Edgeville ;)

Your the Edgeville Man, I am the Draynor Guy.


I already have a Edgeville DTM made :cool: , if i have time this weekend ill add it to your procedure :)

cause

2006-03-02 11:17:38

sweet, didnt work for me, but now i see what i was doing wrong, will try out again after school (im homeschooled, im doing my math rite now :))

Pwnd

2006-03-02 12:39:45

Bah, whores :P

Good job guys.

huh26010

2006-03-04 18:45:37

'feb' (Falador East Bank)
mm facing north = some times mm bank symbol farther from boths and it cannot find the

booth; not a big enough search area. If bank is crowed doesnt work


'fwb' (Falador West Bank)
mm facing north = ok has a little trouble finding the booth

'veb' (Varrock East Bank)
mm facing north =good

'vwb' (Varrock West Bank)
mm facing north = cannot find bank symbol if crowded

'db' (Draynor Bank)
mm facing north =good

'akb' (Al-Kharid Bank)
mm facing north =didnt test

The Prince of Randomness?

2006-03-04 19:24:19

You just surprised me Huh!
I thought you just wanted free scripts..
But your a good tester.

weaselforce

2006-03-12 06:32:16

Map Facing east and followed road

veb = great, no problems

vwb = "missed" although it was insight. got closer and it worked.

feb = clicked on map symbol, went inside bank, then clickout ouside the bank on the south side. facing north = made it inside but couldnt find booth and got confused with the box next to it

fwb = failed completely. worked once for some reason, same result as east bank. north couldnt find booth

akb = got to bank in 2 clicks, had a little trouble locating booth but worked fine. North = got to bank in 2 clicks also, found bank booth instantly

db = got inside east side of bank and couldnt locate booth, clicked outside bank. North = couldnt locate booth till i titled the map a little, probably just my unperfect north.

overall = good script, worked good facing east and usually all problems when facing east were corrected when facing north. booth was a little sketchy but doubt it will be a problem

torrent

2006-03-30 09:54:40

edgy wud be useful expecialy for the yews :)