Ok so you got a few things you want to learn, cool. Let's start with getting what floor you're on.
int a = myPlayer().getPosition().getZ();
switch (a){
case 0:
//do stuff on ground floor
break;
case 1:
//do stuff on second floor
break;
case 2:
//do stuff on top floor
break;
}
Obviously, you don't need to use a switch, but i've done it like so, so you know what the levels are.
Next, we have the inventory issue. You can find out if you have a full inventory by:
if(inventory.isFull()){
//do stuff after inventory is full
}
Here's where you tell your program to start climbing the stairs to go to the bank i guess.
If you're on the second floor, you'll need another check to see if you want to go up or down the stairs, you can make the same inventory.isFull() call to find your answer.
Banks are easy to interact with thanks to the API, all you gotta do is:
bank.Open();
if(bank.isOpen()){
bank.deposit("Knife", 28);
}
API for ref:
Bank: http://osbot.org/api/org/osbot/rs07/api/Bank.html
Player: http://osbot.org/api/org/osbot/rs07/api/model/Player.html
Inventory: http://osbot.org/api/org/osbot/rs07/api/Inventory.html