Rikje
2007-10-19 10:09:29
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
-Understand Bitmaps.
- 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
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
-Understand Bitmaps.
- 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:
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('78DA636C64626088604001FFFEFD636060042' +
'386FF40C0D805549300916385AAF9F387094C3342F98C2073E209' +
'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('78DA636C64626088604001FFFEFD636060042' +
'386FF40C0D805549300916385AAF9F387094C3342F98C2073E209' +
'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!!
'0C43AF5493D6EAA7237AFF236DEBECC7C0C0B2080F79265144647' +
'9404609708C602D089AAEE46A41B53495334DAB4134CDBB1DB3D3' +
'D48C883A836E3B8DE7A6E36498C6FBD9B92C17CE2FB29B5D3A982' +
'D9142811C1DF732E31013B3AC2F3B7AE9CFA46D9DB4DF5D8280DC' +
'7C2E54E8A6BFBB11643CBEBA741AECF6D50C6C7F754FEBC90FFC2' +
'');
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 :(