PDA

View Full Version : Banking with SRL



Simtoon
10-20-2009, 04:13 AM
Banking with SRL

This tutorial will show you a simple way to bank with SRL using Bank.scar which is SRL....

SRL uses bank consts to help scripts make there scripts, i will be using them in the tutorial.



const
Bank_FE = 'feb'; // (Falador East Bank)
Bank_FW = 'fwb'; // (Falador West Bank)
Bank_VE = 'veb'; // (Varrock East Bank)
Bank_VW = 'vwb'; // (Varrock West Bank)
Bank_GE = 'geb'; // (Varrock GE Bank)
Bank_DR = 'db' ; // (Draynor Bank)
Bank_AK = 'akb'; // (Al-Kharid Bank)
Bank_EV = 'eb' ; // (Edgeville Bank)
Bank_CT = 'ctb'; // (Catherby bank)
Bank_CM = 'clt'; // (Camelot bank)
Bank_NA = 'nab'; // (North Ardougne bank)
Bank_SA = 'sab'; // (South Ardougne bank)
Bank_YN = 'ynb'; // (Yanille bank)
Bank_NG = 'ngb'; // (North gnome bank)
Bank_SG = 'sgb'; // (South gnome bank)
Bank_WG = 'wgb'; // (Warrior guild bank)
Bank_FG = 'fgb'; // (Fishing guild bank)


First off lets see what functions SRL has to open the bank.

// * Function OpenBankQuiet(WhichBank:string):Boolean; // * by WT-Fakawi
// * Function OpenBankGlass(WhichBank:String; ChangeCompass:Boolean): Boolean; // * By Wizzup? & N1ke!
// * function OpenBankFast(Location: String): Boolean; // * by Wizzup?, Nielsie95 & N1ke!
// * function OpenBankNPC: Boolean; // * by Home
// * function OpenBank(WhichBank:String; ChangeCompass:Boolean): Boolean; // * by SRL


In this tutorial i will be using OpenBankFast

Lets see which functions SRL has for Pins


// * function PinScreen: Boolean; // * by NaumanAkhlaq
// * function InPin(Pin: string): Boolean; // * by ZephyrsFury and Nava2


Lets see which functions SRL has for Depositing.


// * function DepositItemBox: TBox; // * by ZephyrsFury
// * Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant); // * by PPLSUQBAWLZ / Stupid3ooo
// * procedure DepositAll; // * by ZephyrsFury


Lets see which functions SRL has for Withdrawing.


// * procedure Withdraw(Col,Row,Amount:integer); // * by Odie3355/Stupid3ooo/Starblaster100 fixed by Town


Some other functions SRL has that we are going to use.


// * function BankScreen: Boolean; // * by SRL Dev Team
// * Procedure CloseBank; // * by Starblaster100



Now lets get started this is how we are going to open the bank.


Program Banking_With_SRL;
{.include SRL/SRL.scar}


Procedure Bank;
begin
OpenBankFast(Bank_VE);//in the () thats the bank const of Varrock East
end;

begin
SetupSRL; //Never forget that
Bank; //Do the procedure bank
end.


What this does it open the bank Varrock East but what is after that what happens if theres a pin screen.
We need to add PinScreen and InPin...


Program Banking_With_SRL;
{.include SRL/SRL.scar}


Procedure Bank;
begin
OpenBankFast(Bank_VE);//in the () thats the bank const of Varrock East
Wait(100 + Random(500); //Waits 100milseconds + a random 500 Milseconds
if PinScreen then
InPin('1234') // in the () theres the pin.
end;

begin
SetupSRL; //Never forget that
Bank; //Do the procedure bank
end.


To make sure to works let at a repeat so it will repeat opening the bank and checking if theres a pin screen until it sees the bank Screen.


Program Banking_With_SRL;
{.include SRL/SRL.scar}


Procedure Bank;
begin
repeat
OpenBankFast(Bank_VE);//in the () thats the bank const of Varrock East
Wait(100 + Random(500)); //Waits 100milseconds + a random 500 Milseconds
if PinScreen then
InPin('1234'); // in the () theres the pin.
Until(BankScreen);
end;

begin
SetupSRL; //Never forget that
Bank; //Do the procedure bank
end.


Yay cbf writting anymore.

tls
10-20-2009, 08:19 PM
InPin uses a string, not an integer... fix it in your examples.
Add some failsafes for opening the bank such as:

if not OpenBankFast(Bank_vwb) then
if not OpenBank(Bank_vwb) then
begin
WriteLn('Problem with opening bank');
WriteLn('Logging out and setting player false');
Logout;
NextPlayer(False);
Exit;
end else
WriteLn('OpenBank');
else
WriteLn('OpenBankFast');
DoStuff;

Simtoon
10-20-2009, 08:30 PM
i was writing this tutorial at work looking at bank.scar in a web browser.
ill fix up later
Thanks

m4r1us
10-30-2009, 12:45 PM
thanks for tutorial. i'll add it in my new script :P