PDA

View Full Version : How to bank By rikjess.



Rikje
10-19-2007, 02:09 PM
Banking Tut

Intoductin:

Hi, welcome to my first tut :p.
Because of the new section. ‘’free for all scripts’’ I made this tut. There not that much banking scripts in there. In this tutorial ill try to learn you the basics of banking stuff. I hope that on the end of this tut you can make a banking procedure :) Enjoy.

Needed:
- Know the basic of scripting.
-Understand DTM’s (http://www.villavu.com/forum/showthread.php?t=564)
-Understand Bitmaps. (http://www.villavu.com/forum/showthread.php?t=9453)
- Have a char at the bank with some stuff in his invent to bank. Like ore’s. (to try you’re script)

1.1 : Get In a Bank

1.2 : Open the Bank

1.3 : Deposited Stuff


1.1 : Get In a Bank

I want my char to get into the Falador east bank. You can chose a other bank. If you want to.
if you have you’re owne script that needs a banking procedure then open that script. Otherwise copy this to your scar:


Program BankIt;
{.include SRL\SRL.scar}
var
X, y, BankDTM: Integer;
Procedure WalkTobank;
begin
// all the walking stuff etc..
end;

Procedure Bank;
begin
end;

begin
SetupSrl;
WalkToBank;
Bank;
end.


First of all we want that the char get in the bank. Otherwise we cant bank anything… the best way to do that is by using a dtm of the bankers. (That’s why you need to understand dtm’s).
The parent (you’re first point of the dtm, needs to be in front of the bankers. So the place where you want to click). Give it a Tolerance of 255. 255 means that it will find all the colors. So it doesn’t matter anymore when there’s a player on that spot etc… the sub points from you’re dtm are the bankers. You don’t need to take all the bankers just a few. When you’ve done that. Give the sub points a area size between 3 – 5. And a tolerance of 10 - 20
it will be like this:

http://img98.imageshack.us/img98/9056/dtmeastbankpf2.jpg
Make a dtm from it. (file --> dtm to tekst).

when you have a ‘’load’’ procedure in you’re script. Put the dtm in there. I don’t have a load procedure so I will declare my dtm in the walk back procedure it self. (never forgot to free you're bitmaps and dtm if you call them in the procedure itself!')


Program BankIt;
{.include SRL\SRL.scar}
Var
X, y: Integer;
Procedure WalkTobank;
Var
BankDTM: Integer;
begin
BankDTM := DTMFromString('78DA636C64626088604001FFFEFD6360600 42' +
'386FF40C0D805549300916385AAF9F387094C3342F98C2073 E209' +
'A82925424D2D6135001FB8135B');
//the walk etc..
begin
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
WriteLn('yeaj found the bank');
Flag;
end;
end;
FreeDTM(BankDTM);
end;

Procedure Bank;
begin
end;

Begin
SetupSrl;
WalkToBank;
Bank;
end.
Ive also added

begin
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
WriteLn('yeaj found the bank');
Flag;
end;


this will try to find the DTM while rotating him. If he found him he will click. If you like to test if you’re dtm is working run you’re script and look if it work ;).
mines did. :) so this will be the end of chapter one :p.



1.2 : Open the Bank

Well this Is not that hard. Because srl got some beautiful function for this :)
go to you’re include folder --> srl --> srl --> core --> Bank.scar.
in that file there is all the banking stuff :).
iam gone use OpenBankFast(‘feb’);

{************************************************* ******************************
function OpenBankFast(Location: String): Boolean;
By: Wizzup? and Nielsie95
Description: Opens the bank.
Valid arguments are:
'akb', 'al kharid', 'lb', 'lumbridge', 'veb', 'varrock east', 'vwb',
'varrock west', 'feb', 'falador east', 'fwb', 'falador west', 'db', 'draynor',
'eb', 'edgeville bank'
************************************************** *****************************}

look for the open bank function that you like.
My banking procedure is now like this:


procedure Bank;
var
time: Integer;
begin
MarkTime(time); //this will start a timer
repeat;
if (not(Loggedin)) then break; //if you're chat is not logged in it will break out of the loop
OpenBankQuiet('feb'); // ^^
until(BankScreen or (TimeFromMark(time) > 120000)); // if it took longer then 2 minutis then it will stop trying to open the bank.
end;


Bankscreen : if scar founds the bankscreen it will return to true.
Try you're script again to look if it works :).




1.3 : Deposited Stuff

I think this is where its all about? :p
Before we going to put stuff in our bank we count the stuff we have :p. because its a bit ugly to just put something like: mined := mined + 28;.
so i hope you understand bitmaps, otherwise,, go learn them! :p.
make a small bitmap from the item you want to bank. i want to bank 3 coal ores. after you made you're bitmap put him in you're load procedure. iam to lazy to type a load procedure so i declare him in my bank procedure. (never forgot to free you're bitmaps and dtm if you call them in the procedure itself!')

CoalMined := CoalMined + CountItemBmpTol(CoalOre, 10);

CoalMined : is the variable where it will store the amour of ores you've banked
CountItemBmpTol(coalOre, 10) will count how many times it find the bitmap from a coal ore in you inventory with a tolerance of 10.


Program BankIt;
{.include SRL\SRL.scar}
var
X, y, CoalMined: Integer; //added the var coalMined.

Procedure WalkTobank;
var
BankDTM: Integer;
begin
BankDTM := DTMFromString('78DA636C64626088604001FFFEFD6360600 42' +
'386FF40C0D805549300916385AAF9F387094C3342F98C2073 E209' +
'A82925424D2D6135001FB8135B');

//the walk etc..
begin
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
WriteLn('yeaj found the bank');
Flag;
end;
end;
FreeDTM(BankDTM);
end;

Procedure Bank;
var
CoalOre, time: Integer; //make sure to have a integer from all you're bitmaps and dtms.
begin
CoalOre := BitmapFromString2(False, 'a64B7178DA8D8D510A0421' + //this one is to big!!
'0C43AF5493D6EAA7237AFF236DEBECC7C0C0B2080F7926514 4647' +
'9404609708C602D089AAEE46A41B53495334DAB4134CDBB1D B3D3' +
'D48C883A836E3B8DE7A6E36498C6FBD9B92C17CE2FB29B5D3 A982' +
'D9142811C1DF732E31013B3AC2F3B7AE9CFA46D9DB4DF5D82 80DC' +
'7C2E54E8A6BFBB11643CBEBA741AECF6D50C6C7F754FEBC90 FFC2' +
'');

MarkTime(time);
repeat
if (not(Loggedin)) then break;
OpenBankQuiet('feb')
until(BankScreen or (TimeFromMark(time) > 120000));
if Bankscreen then //make sure it has open the bank
begin
WriteLn('in the bank');
CoalMined := CountItemBmpTol(CoalOre, 10); //it will count the ores.
Deposit(2, 28, 2);
CloseBank;
WriteLn('We have banked ' +IntToStr(CoalMined) + ' Coal Ores');
end;
FreeBitMap(CoalOre);
end;

Begin
SetupSrl;
WalkToBank;
Bank;
end.


ive also added:
Deposit(2, 28, 2) and CloseBank;

Closebank = it close the bank.

Deposit(2, 28, 2) = that will deposit inventory slot 2 until 28. (i have my pickaxe in invent slot 1). the second 2 means that it will use the ''all'' instand of clicking on each item.

WriteLn('We have banked' +IntToStr(CoalMined) + ' Coal Ores'); = this will Write in the the bugbox how many ores it have banked.
Run you're script to look if it works :). if it did then i hope you now know how to bank :).

Feel free to ask question in this topic :) this is my first tut. so don't flame me to much? and sorry from my English :(

ShowerThoughts
10-19-2007, 02:33 PM
nice, work!!

MasterKill
10-19-2007, 02:35 PM
whoo nice tut :D

you must be a smart one eh?

gerauchert
10-19-2007, 02:59 PM
this was definately needed...

i nvr knew how to do this when i was starting out

good work ;)

Rikje
10-19-2007, 04:59 PM
this was definately needed...

i nvr knew how to do this when i was starting out

good work ;)


i also never knew how to do this. mostly i was like ''wtf,, how can i walk into a bank??'' :p

@hermpie; ty
@masterkill; you say so :)

oliver1205
11-10-2007, 05:31 PM
nice tut helped me alot

Da Der Der
11-11-2007, 05:52 PM
Helped me, thanks! :)

Sir R. M8gic1an
01-15-2008, 10:57 AM
i know it's a bit of a gravedig, but

thank you very useful :) btw how about mentioning this function:

function FindBank(TheBank: string): Boolean; // by Fawki

and how to withdraw things from the bank ? :)

~RM

Rikje
01-15-2008, 07:31 PM
Thx for the tip :)
i like the Withdrawing. will be added within a few days. very busy right now.

insanomano
05-18-2008, 07:50 PM
yes needs to tell how to withdraw but nice job!!!! I never knew how to do this Im always like wtf. thx dude.

2pacfan
05-31-2008, 01:25 PM
Omg rikjess tyvm it worked for me:) Rep++++++++

Dracody
05-31-2008, 08:54 PM
hmmm (Thinking)....And why not use a coal ore DTM also? instead of a Bitmap, and Also Yoho said that never put an area size higher than 1 on a D/DTM, :confused: please explain to meee:confused:

Cazax
05-31-2008, 08:56 PM
hmmm (Thinking)....And why not use a coal ore DTM also? instead of a Bitmap, and Also Yoho said that never put an area size higher than 1 on a D/DTM, :confused: please explain to meee:confused:

It was area shape not area size :)

Dracody
06-01-2008, 04:19 AM
It was area shape not area size :)

OH :p hehe thanks !:D that solves one of my questions:D

PvH
06-01-2008, 04:22 AM
great tut!
but now depositing is changed..
it should now be:
Deposit(2,28,true);

bobbyabreu
08-06-2008, 09:41 PM
hmm i dont seem to get it to work. i get this error

Line 129: [Error] (12772:14): Unknown identifier 'CountItemBmpTol' in script

YoHoJo
08-13-2008, 01:48 AM
hmmm (Thinking)....And why not use a coal ore DTM also? instead of a Bitmap, and Also Yoho said that never put an area size higher than 1 on a D/DTM, :confused: please explain to meee:confused:

Thats only for the parent point, points other than the parent can have areas of one or larger. And when making a DTM for an item, there is never a need for area size because all items look the same.

xgrimangel
08-13-2008, 07:12 PM
nice tut this helped me to learn banking

shaman
12-19-2008, 03:14 AM
nice script but i have one problem. an error comes up saying type mismatch in script for the 'until (BankScreen or TimeFromMark(time) > 120000))' line. I'm not sure whether its because i've forgotten a variable or something. Otherwise great script and it will definately help me with my yew cut and bank. thanks

Sandstorm
12-19-2008, 04:06 AM
nice script but i have one problem. an error comes up saying type mismatch in script for the 'until (BankScreen or TimeFromMark(time) > 120000))' line. I'm not sure whether its because i've forgotten a variable or something. Otherwise great script and it will definately help me with my yew cut and bank. thanks

It's nothing to do with you, it's the way scar checks stuff.

until(BankScreen) or (TimeFromMark(time) > 120000)

will work. It's because of the way you had the parentheses set up.

@Op - I'll look through it, one small thing I noticed is that you spelt Introduction wrong at the top :P.

Besides spelling/grammar errors (hey, not needed if you can understand it, right? I'm just a little obsessive *whistles*), I only noticed one thing in a quick skim. In the first scar codes, you have an unneeded begin/end. It can be shortened to this:

if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
WriteLn('yeaj found the bank');
Flag;
end;

Also, I realize this is a very old tutorial xD.