SRL Archive - OSR Beginner Scripting Tutorials

In Depth Guides - Banking


Bad Boy JH

2010-06-03 07:40:42

After all my costant requests for help in various areas, I thought I better give back, so here comes a tutorial on Banking
Banking Basics to Advanced

Opening The Bank
This is obviously needed to withdraw or deposit anything.
Reflection
Reflection is probably simpler, but as seen recently, may be broken for a long time.

Function R_OpenBankBooth(Bank:String):Boolean;

Valid strings for Bank

'veb', 'varrock east':
'vwb', 'varrock west':
'falador west', 'fwb':
'falador east', 'feb':
'lumbridge', 'lb':
'draynor', 'db':
'al kharid', 'akb':
'seb', 'seers': -
'eb', 'edgeville': -
'cb', 'catherby': -
'fgb', 'fishing guild' -
'mc', 'moonclan' -
'yb', 'yanille': -
'da', 'duel arena' -
'asb', 'ardougne south' -
'pc', 'pest control' -

This will open the bank using a booth in the specified location. Will Return True if it opens successfully, and False if it doesn't.

Color
OpenBankQuiet(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
More accurate, but takes longer

OpenbankGlass(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
Simply opens the bank by finding the glass color

OpenBankFast(Location: String): Boolean;
Open the bank…fast

OpenbankNPC:Boolean;
Opens the bank by clicking on the NPC

Openbank(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
tries all of the above procedures


FindBank(TheBank: string): Boolean;
Checks if you are in "The Bank" and then uses OpenBank

OpenDepositBox:Boolean
Opens the bank deposit booth.

Valid WhichBank strings
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'akb' (Al-Kharid Bank)
'eb' (Edgeville Bank)
'ctb' (Catherby bank)
'clt' (Camelot bank)
'nab' (North Ardougne bank)
'sab' (South Ardougne bank)
'ynb' (Yanille bank)
'ngb' (North gnome bank)
'sgb' (South gnome bank)
'wgb' (Warrior guild bank)
'fgb' (Fishing guild bank)

Other variables
WhichBank - which bank needs to be opened
ChangeCompass - Change the angle of the the compass,
ChangeAngle - Change the Height of the camera

Bad Boy JH

2010-06-03 07:41:42

Depositing
Opening the bank is useless unless you deposit what you have in your inventory.
Reflection
R_DepositAll:(Fast:Boolean);
Deposits everything in your inventory,
Fast = True uses the "Deposit All" button, False deposits all items individually

Before I start talking about these Deposit functions, I think a brief intro to Item IDs is needed, as these functions that follow, require Item IDs. An ID is unique to every item, and is different when its noted, or unnoted. To find an ID of an item, Run the script at the bottom of this post, Titled "Item ID Finder".


R_DepositAllID(ID : Integer): Boolean;
Deposits All of one type of an item, specified by ID.

procedure R_DepositAllButID(ID : Integer);
Deposits all in your inventory, except those specified by ID.

R_DepositAllButIDEx(IDs : TIntegerArray);
Same as R_DepositAllButID, but allows multiple IDs, in a tolerance. An array can be declared as "[Item1, Item2, …..ItemX].

Colour
DepositAll : Boolean;
Clicks the deposit all button, Returns True if successfull

Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
Deposits all Items between SlotFrom to SlotTo. eg if SlotFrom is 2, and SlotTo is 8, then it will deposit all items in slots, 2, 3, 4, 5, 6, 7, 8.
vType is how many will be deposited
True : Right Clicks then selects Deposit-All.
False : Left Clicks on all the items.
5 or 10 : Right Clicks then selects Deposit-5 or Deposit-10
Other Integers : Right Clicks and uses Deposit-X, then enters the number.

Bad Boy JH

2010-06-03 07:42:45

Reserved - tutorial to be continued (2)

Bad Boy JH

2010-06-03 07:43:50

Reserved - tutorial to be continued (3)

Bad Boy JH

2010-06-03 07:46:23

Reserved - tutorial to be continued (4)

ShowerThoughts

2010-06-03 09:58:26

The first post is still very global, you should give examples of the parameters filled in, and then let people play with the parameters to learn it and get used to it. Because a normal person wouldn't know how to fill them in properly.

Rich

2010-06-03 10:36:44

How long can you make a tutorial about banking? LOL.

Frement

2010-06-03 11:30:05

From: R1ch
How long can you make a tutorial about banking? LOL.


Well there are multiple ways of opening the bank, withdrawing stuff from or if you want to deposit stuff. You can also just view the banks contents and check how much of what you got.

Gu3st...

2010-06-03 12:04:21

From: Frement
Well there are multiple ways of opening the bank, withdrawing stuff from or if you want to deposit stuff. You can also just view the banks contents and check how much of what you got.
Just to continue the list;
Analyze every bank function
How to make your own functions

The list can be pretty big :p

Narcle

2010-06-03 17:05:43

From: R1ch
How long can you make a tutorial about banking? LOL.


You should honestly give it some more thought before you make a post. Banking can be complex depending what you do. While its simple for a human to just simple open and search the bank. Its not the same creating a script for it that is flawless with fail-safes. Managing Tabs, scrolling down/up, searching for a DTM, bitmap, etc. Scrolling in itself could be quite complex.

weequ

2010-06-03 17:54:45

From: Narcle
You should honestly give it some more thought before you make a post. Banking can be complex depending what you do. While its simple for a human to just simple open and search the bank. Its not the same creating a script for it that is flawless with fail-safes. Managing Tabs, scrolling down/up, searching for a DTM, bitmap, etc. Scrolling in itself could be quite complex.
I made a suggestion to the simba forum about ScrollMouse and I think someone made it. With that it could be easier since it scrolls exatly 1 row at time :P

Narcle

2010-06-03 19:50:25

From: antti mies
I made a suggestion to the simba forum about ScrollMouse and I think someone made it. With that it could be easier since it scrolls exatly 1 row at time :P


Not always, what if that persons bank is full, or 2/3rds full, or they have all tabs used up. Each tab places a separator in the main tab adding to its length. As well as the number of items changes how large the main tab is. So the scroll bar is never 100% accurate until you consider all of those factors. It could be done, not too difficult if you get all the measurements of each of those factors and plug them in.

Bad Boy JH

2010-06-03 21:17:47

This is supposed to be an tutorial about all the functions in the bank
Post 1 (already posted) is Opening
Post 2 is Depositing
Post 3 is Withdrawing
Post 4 is Everything Else (Pin Screen, Bank Screen etc)
Post 5 is "putting it all together"

Gu3st...

2010-06-04 04:32:27

Please include the constants for the banks :)
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)

Bad Boy JH

2010-06-04 10:42:59

they were added, after I did this, or at least I only found out about them (didn't update) until after I had done that, I will tomorrow morning…im too tired *yawns* stupid umbilical brothers, they really made that show go for ages…

putonajonny

2011-11-08 18:45:57

sorry I am new to this but what have I done wrong:
procedure bank;
begin
Openbank(WhichBank: vwb; ChangeCompass, ChangeAngle: Boolean): Boolean;
Deposit(1, 27: Integer; vType: True);

end

It is probably something really stupid, it's getting late

Yago

2011-11-08 18:47:30

From: putonajonny
sorry I am new to this but what have I done wrong:
procedure bank;
begin
Openbank(WhichBank: vwb; ChangeCompass, ChangeAngle: Boolean): Boolean;
Deposit(1, 27: Integer; vType: True);

end

It is probably something really stupid, it's getting late


It should be something like this:

procedure bank;
begin
Openbank('vwb', True,True);
Deposit(1, True);
end;

surfboards2

2012-03-17 23:22:54

hey man what would be the string and location of the living rock caverns bank/pulley thing

smurg

2012-03-18 00:24:24

From: surfboards2
hey man what would be the string and location of the living rock caverns bank/pulley thing


Check the include, it may not be supported.

Try not to gravedig and just ask in the scripting help section.

surfboards2

2012-03-18 02:43:56

im a noob :P whats the include? im just starting scripting im trying to watch tutorials and stuff

smurg

2012-03-18 15:46:03

From: surfboards2
im a noob :P whats the include? im just starting scripting im trying to watch tutorials and stuff


Search in the function explorer on the left-hand side of Simba. Double click the function and it will open the include at the correct spot. There is normally documentation somewhere inside the include.

moring

2012-03-31 13:16:24

The player will go automatically to the bank that i will mention
in the function?

Abu

2012-03-31 13:18:43

From: moring
The player will go automatically to the bank that i will mention
in the function?


No, your player must already be in the bank

moring

2012-03-31 13:21:55

From: abu_jwka
No, your player must already be in the bank


There is any tut for walking to the bank?

Abu

2012-03-31 13:27:03

From: moring
There is any tut for walking to the bank?


You should REALLY try searching for things yourself (use the Search button) :blink:

But here you go anyway - because I'm so kind: http://villavu.com/forum/search.php?searchid=1886670

I Relix I

2012-04-05 12:38:59

Thank you so much, I am learning and it has been really difficult, but every person like you making a guide.. well it makes it that much easier.

Again, thank you for taking the time to do this. I use this all the time.

edit: I joined in 2007 and started programming a week ago. I have no idea when I even made this account lol. First post in 5 years wooo

GodGenesis

2012-11-17 07:01:13

procedure OpenBankAll;

begin;
Openbank('ynb', True,True);
Deposit(1 , 28: Integer; True: 28); [This is line 50]
end;

Anything wrong with this? Keep getting an error

comma (',') expected at line 50
Compiling failed.

KingKong

2012-11-17 08:29:33

it should be Deposit(1, 28,True); the : integer part is only required when declaring a variable