Famous Scripts
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Scripts for RSBot made by Famous
 
HomePortalLatest imagesRegisterLog in
New scripts being created everyday! Go to GameKiller.net!

 

 Tutorial 4: Banking

Go down 
4 posters
AuthorMessage
Famous
Administrator
Administrator
Famous


Posts : 50
Join date : 2009-10-23
Age : 29
Location : Chicago

Tutorial 4: Banking Empty
PostSubject: Tutorial 4: Banking   Tutorial 4: Banking EmptySun Jan 24, 2010 4:07 pm

I'll try and make this as quick and easy as possible.

The first thing you need to do is to get the variables of what you want to deposit or withdraw. I already taught you how to get variables in tutorial 1, so look back there if you need more help.

Once you have the item you need to withdraw or deposit, you need to get the bank booth ID. You can get this by viewing the object ID's in RSBot.

Here's an example that I made to show you how this works.

~~~~Example of banking~~~~

Let's break this down a bit.
Code:

RSObject booth = getNearestObjectByID(11402);

This is telling RSBot that the variable "booth" is an RSObject. The 11402 is the object ID of the bank booth.
Code:

if (booth != null) {
atObject(booth, "Use-Quickly");
wait(random(400, 600));
}
This is saying that if the booth ID(11402) is not null [null means that it doesn't exist or isn't there]
then click on the bank booth and "Use-Quickly". wait(random(400, 600)); just tells it to wait for a random of 400-600 MS.
Code:

if (RSInterface.getInterface(Constants.INTERFACE_BANK).isValid()){
bank.withdraw(money, 0);
}
if(bank.getItemByID(money) == null) {
               log("No more Money. Stopping Script.");
               stopScript(true);
}
The top line and second line of this code basically says that if the bank is open, then withdraw all your money in the bank. (money, 0) <----[The 0 means withdraw-all.]
The third line says that if there is no money in the bank, stop the script, and logout.
Code:


if(inventoryContains(money)){
bank.close();
}
This says that if your inventory contains money, and the bank is open, then close the bank.

Some of you may be saying, I don't need to withdraw anything though, so how do I make it just deposit things? Here's the method again, only without the withdraws:
~~~~Deposit Code~~~~

For the list of methods you can use to bank, view Bank.java in your RSBot Folder.


That's about it for now. Hopefully this is simple enough, but if you need some extra help, PM me.


Last edited by Famous on Sat Jun 19, 2010 4:13 pm; edited 3 times in total (Reason for editing : Updated)
Back to top Go down
https://famousscripts.forumotion.com
Eons




Posts : 6
Join date : 2009-12-12

Tutorial 4: Banking Empty
PostSubject: Re: Tutorial 4: Banking   Tutorial 4: Banking EmptyTue Jan 26, 2010 6:52 am

Very nice sir. Keep it going (:

! = Not, for some who don't know.
Back to top Go down
Ryu

Ryu


Posts : 1
Join date : 2010-02-05
Age : 31
Location : United State (FL)

Tutorial 4: Banking Empty
PostSubject: Re: Tutorial 4: Banking   Tutorial 4: Banking EmptyFri Feb 05, 2010 2:20 am

Nice work! really help alot. Tutorial 4: Banking Icon_biggrin
Back to top Go down
hawk 1sr




Posts : 1
Join date : 2010-03-17

Tutorial 4: Banking Empty
PostSubject: Re: Tutorial 4: Banking   Tutorial 4: Banking EmptyWed Mar 17, 2010 11:23 pm

good job, cant w8t till the next tutorial comes out! when is it going to be.
Back to top Go down
Sponsored content





Tutorial 4: Banking Empty
PostSubject: Re: Tutorial 4: Banking   Tutorial 4: Banking Empty

Back to top Go down
 
Tutorial 4: Banking
Back to top 
Page 1 of 1
 Similar topics
-
» Tutorial 2: Writing your first script
» Pre Tutorial Methods
» Tutorial 3: Walking
» Fixing JDK Not found error.
» Tutorial 1: Beginning Scripting

Permissions in this forum:You cannot reply to topics in this forum
Famous Scripts :: Tutorials :: Tutorials :: Famous' Scripting Tutorials-
Jump to: