Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Buy OSRS Gold

Sell OSRS Gold
Sign in to follow this  
druss016

Find nearest bank, Check if bank is open, & Enter Pin formula

Recommended Posts

Basically all you have to do is paste these 3 functions in your script, before the player banks do something like this:

if(bankIsOpen(){	//Do something} 

Calling "bankIsOpen()" will find the nearest bank and update "BANK" as that closest bank. Then it will go through the process of find and clicking on the bank booth or bank chest. Then enters pin if necessary. Its a pretty clean snippet you can just insert into you script without having to write the logic yourself. Hope it help.

 

Copy the code below:

 

/** Find & set nearest Bank booth, Bank chest **/	private final int[] BANK_BOOTHS = { 			2213, //Varrock (bank booth)			16642, //Port Phasmatys (bank booth)			24101, //Falador (bank booth)			4483 //Castle Wars (bank chest)	};	private String BANK_OPTION = "";	private RSObject BANK = null;	private RSObject[] BANKS = null;	private int FIND_BANK_TRIES = 0;		private void nearestBank(){				int x2 = 0,y2 = 0;		int x = Player.getPosition().getX();		int y = Player.getPosition().getY();		double d,distance = 999999;		int maxTries = 7;		BANK = null;		BANKS = null;				//Bank booth		RSObject[] bankBooth = Objects.findNearest(70, BANK_BOOTHS);		if(bankBooth.length > 0){			x2 = bankBooth[0].getPosition().getX();			y2 = bankBooth[0].getPosition().getY();			distance = Math.abs(Math.sqrt(Math.pow(x2-x, 2) - Math.pow(y2-y, 2)));			BANK = bankBooth[0];			BANKS = bankBooth;			BANK_OPTION = "Bank Bank booth";		}		//Bank chest		RSObject[] bankChest = Objects.findNearest(70, BANK_CHESTS);		if(bankChest.length > 0){			x2 = bankChest[0].getPosition().getX();			y2 = bankChest[0].getPosition().getY();                        //compute the nearest bank			d = Math.abs(Math.sqrt(Math.pow(x2-x, 2) - Math.pow(y2-y, 2)));			if(d < distance){				distance = d;				BANK = bankChest[0];				BANKS = bankChest;				BANK_OPTION = "Use Bank chest";			}		}				if(FIND_BANK_TRIES >= maxTries)			notify("We cannot find a bank close enough to you.", true);				if(BANK == null){			FIND_BANK_TRIES++;			notify("Cannot find a nearby bank. Ending after "+(maxTries-FIND_BANK_TRIES)+" more "+((maxTries-FIND_BANK_TRIES==1)?"try":"tries")+".", false);			sleep(1500);			nearestBank();		}		else FIND_BANK_TRIES = 0;	}		/** Open bank **/		private boolean bankIsOpen(){				nearestBank();				if(!Banking.isBankScreenOpen() && !Banking.isPinScreenOpen()){						if(BANKS.length > 0){				if(!BANK.isOnScreen())					Camera.turnToTile(BANK.getPosition());				if(!BANK.isOnScreen())					Walking.blindWalkTo(BANK.getPosition());								while(!Banking.isBankScreenOpen() && !Banking.isPinScreenOpen()){					DynamicClicking.clickRSTile(BANK.getPosition(), BANK_OPTION);					for(int i=0; i<20; i++){						if(Banking.isBankScreenOpen() || Banking.isPinScreenOpen())							break;						sleep(100);					}				}			}			else 				notify("We cannot find a bank close enough to you.", true);		}				if(Banking.isBankScreenOpen())			return true;		else if(Banking.isPinScreenOpen()){			int cnt=0;			while(!pinEntry(PIN_NUMBER)){				notify("We encountered an error while entering your pin number.", true);				cnt++;				if(cnt == 3)					break;			}						cnt = 0;			while(!Banking.isBankScreenOpen()){				if(cnt >= 5){					return bankIsOpen();				}				cnt++;				sleep(1000);			}						return true;		}				return false;	}	
	/* Pin Entry */	private boolean pinEntry(String pin) {				if(pin.equals(""))			notify("You did not enter a pin number.", true);				char[] pinNums = pin.toCharArray();		String[] next = { "First click the FIRST digit.",				"Now click the SECOND digit.", "Time for the THIRD digit.",				"Finally, the FOURTH digit." };				while (!Banking.isBankScreenOpen() && Banking.isPinScreenOpen() && Interfaces.get(13, 151) != null) {			for (int x = 0; x < 4; x++) {				if (Interfaces.get(13, 151).getText().equals(next[x])) {					for (int i = 110; i <= 119; i++) {						if (Interfaces.get(13, i).getText()								.equals("" + pinNums[x])								&& Interfaces.get(13, 151).getText()										.equals(next[x])) {							if (x < 3) {								while (!Interfaces.get(13, 151).getText().equals(next[x + 1])) {									Interfaces.get(13, i - 10).click(											"Enter digit");									for(int j=0; j<20; j++){										if(Banking.isBankScreenOpen() || !Banking.isPinScreenOpen())											return false;										else if(Interfaces.get(13, 151).getText().equals(next[x + 1]))											break;										sleep(100);									}								}							} else {								while (!Banking.isBankScreenOpen()) {									Interfaces.get(13, i - 10).click("Enter digit");									for(int j=0; j<20; j++){										if(Banking.isBankScreenOpen())											return true;										sleep(100);									}								}							}						}					}				}			}		}		return false;	}
Edited by druss016

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By fstyle
      Fstyle's RuneScape Membership Pin Shop

      Prices:

      40 days membership = $9 out of stock | vs $10.99 for 30 days on RuneScape official website
      140 days membership = $28 | vs $29.99 for 90 days on RuneScape official website
      290 days membership = $39 | vs $99.99 for 360 days on RuneScape official website


      Payment options:
        Bitcoin (BTC) Tether (USDT) and a few other stablecoins
      How to redeem membership: https://support.runescape.com/hc/en-gb/articles/206863535-How-to-redeem-a-Prepaid-Card
        Feel free to PM me for any questions and inquiries
    • Guest
      By Guest
      LEGACYCM'S CHEAPEST MAX MAIN STAKER RENTALS
      I dare you to find a cheaper service. 
        Rates

      30 mins = 1.5m 07 or 10.5m RS3
      1 hour = 2m 07 or 14m RS3
      2 hours = 3.5m 07 or 24.5m RS3
      2 hours + = negotiable

      Deposit amount = 3m 07 or 21m RS3 (this will be refunded after the rental period)

      You will have access to an Abyssal Tentacle, Dragon Dagger (p++) and a Ring of Dueling.

      Contact details 

      Discord Name: Justin Langer#0425
      Unique ID: 140737208469422080

      If ever in doubt, always request a PM! I will never refuse.

      Terms of Service
      The Price Beater term are based on the price of a one (1) hour rental. I am at my absolute discretion entitled to determine the amount charged per hour and am allowed to refuse for whatever reason I so feel like. You will pay a 3M 07 Deposit which will be refunded to you at the end of the rental period if the account has been left as it was before the rental period. You are not allowed to leave the duel arena W302 Timer starts when you receive the login details. I will provide you the expiry time of your rental. You are not allowed to break the Runescape in-game rules (i.e. botting, scamming) You are not allowed to real world trade or share account details with ANYONE You are not allowed to live stream You are not allowed to ask for a refund You are not allowed to commission stake You are not allowed to take any items from the account or break the whip You are not allowed to try and change the password or email You are not allowed to private message anyone on the account You can only trade with your own account I am not responsible for any bans on the account while renting. If it gets banned it is because YOU broke a rule. As this is my main and has never broken any rules, you will be held liable for the ban and I will be entitled to reasonable compensation I am not responsible for any valuables on the account while renting After your time is up, you have 5 minutes to transfer your wealth. Any items left on the account after this period will be deemed to have been forfeited to me. No exceptions. If you breach any of the rules above, you will be kicked off the account and any and all items on the account at the time will be forfeit to me in my absolute discretion based on the severity of the infraction. If you choose to end the rental early, you will not be refunded any part of the monies paid for the Rental Period. Upon inspection after the rental period, if the whip is found to be broken, the Deposit Amount will be forfeit to me as reasonable compensation costs. By using my services, you agree to the terms and conditions as set out above.
    • By Rij
      Need help i purchased credits from my bank account but didn't get any credits, heres prof, need refund or explanation or credits, need mod asap!

    • Guest
      By Guest
      Been using the shear sheep, craft into wool and bank script for a couple of days on suicide bots. Its worked well enough to build a little bit of money up.

      I'm wondering if any one has an anti ban script of just shearing and banking, I feel this will save a lot of time and wool alone has a similar sale price (if not higher) than a crafted ball of wool.

      Thanks for any replies, 
    • By tannerguy
      what have you guys experienced the lowest ban rates with for anything that makes decent gp (100k+/hr)
      i haven't had luck with hunter or fishing
      i've also heard runecrafting is very high ban rate. 
      what do you use to make your gp?
    • Guest
      By Guest
      I was wondering if there is any free osrs scripts that support fishing sharks in catherby with banking? anyone with experience know or can help?
    • Guest
    • By wappe
      Anti-ID change? This bot works even if IDs are changed by an update. 
       
      Crafts fire runes. Simple bot to get your Runecrafting started!

       
      General Instructions:
      - Have a fire tiara equipped.
      - Put Rune/Pure Essence, Fire runes (and duel rings, if used) to first slots of your bank.
      - Have essence pouches in inventory if you wish to use them.
      - Run in lite mode and have max brightness in RuneScape settings
      - Try setting slower mouse speed if encountering problems.
      - Don't touch rune essence, pure essence and ring of dueling ID unless they are changed.
       
       
       
      Castle Wars Instructions:
      - Start at Castle Wars 
      - Have Ring of Dueling (8) equipped. Fully charged, or 6,4,2. IMPORTANT!
       
       
      AL-Kharid Instructions:
      - Start at Al-Kharid bank
       
       
      Features:
      - Withdraws Rune and/or pure essence according to your choice on GUI.
      - Banks crafted fire runes.
      - Fills and empties essence pouches.
      - Opens duel arena gate if closed.
      - Teleports using rings of duelling, withdraws another ring when one is destroyed.
      - Walks the path between Al-Kharid and Fire Ruins if chosen to craft without rings.
      - Custom mouse speed according to your choice on GUI.
      - Running snippet by [nathan]
      - Reverse path snippet by Mat
      - Supports pouches and degraded pouches, but does not repair them when degraded.
      - Will not be broken if Jagex changes ids!
       
      Problems?
      - Please post in this topic and I will fix them.
       
       
       
      SOURCE (v1.20,  15th June 2013): http://sparta.rs/wFireRunes.java
      Feel free to modify.
       
       
       
      download both files!
      wFireRunes.class
      wFireRunes$wFireRunesGUI.class
  • Our picks

    • Hi everyone,

      I'd like to thank everyone for their patience in this transition period. Since last week, we've worked out the remaining bugs with this integration.

      Some users have still been having issues with connecting their forums account to their Auth0 account. To resolve this, we've imported all forums accounts into Auth0.

      Unfortunately, the accounts which were imported today were using an unsupported password hashing algorithm. Hence, random passwords were set during the import.

      What does this mean for me?

      If you've previously linked your forums account to your Auth0 account, you don't have to do anything. Nothing changes for you.


      If you haven't logged in via our new login yet,

      Try logging in with your forums email address and the last password you used


      If you are unable to login, please use the "Forgot password" tool on the login page:
      Follow the instructions to reset your password
       
        • Like
      • 1 reply
    • Hello everyone,

      Last week we tried to roll out Auth0 Login, but we lost that battle. Now it's time to win the war!

      Important changes

      When logging into the client, you'll now have to enter your Auth0 account credentials instead of your forums credentials

      Note: 2FA is still handled through your forums account (for the time being)



      Changes for existing users

      You'll have to link your Auth0 account to your forums account here: https://tribot.org/forums/settings/login/?service=11


      Auth0 accounts have been created for most existing users. Please use your forums email address and password to login.



      Important notes

      Make sure to verify your email address upon creating a new Auth0 account


      When we mention your Auth0 account, we mean your account used for auth.tribot.org as displayed below
      • 71 replies
    • To better support the upcoming changes (TRiBot X, new repository), we're switching our login handler to Auth0. Instead of logging in with the standard form, you'll now be required to login through our Auth0 application.

      All existing accounts which have been used within approximately the past year have been imported into Auth0 using the same email and password combination which has been stored on the forums.

      What does this mean for users?

      Your account credentials are now even more securely stored


      You'll be able to login via Facebook, Google, and others in the future


      Is there anything users have to do differently now?

      Existing users: You'll have to login with the standard login, open your Account Settings, then link your Auth0 account


      New users: You'll be redirected to our Auth0 app (auth.tribot.org) where you'll be able to create an account


      Why was this change made?

      The new apps we are creating (such as the new repository) aren't able to use the forums to handle user logins


      To centralize all user accounts in one area


      To ensure that the client login doesn't go down when the forums are having problems


      To speed up our development


      Other considerations

      There's no documentation or official support for using Invision Community combined with Auth0, so there are still a few kinks we're working out


      We're in the works of creating an account management panel specifically for Auth0 accounts (ETA August)


      It's not possible to change email addresses for the time being (this will be resolved this August)


      Changing passwords is a weird process for the time being. To change your password, you'll have to use the "Don't remember your password" tool on the Auth0 login page
        • Like
      • 11 replies
    • Over the past month, we've been working hard on TRiBot's new repository - a much needed update. This change has been deemed necessary for TRiBot X, and will allow us to really speed up development of all aspects of TRiBot.

      Today we are going to share what we've been working on!


      Now you must be wondering what kind of features the new repository will have.... well, you'll have to be patient for a little while longer. We're still figuring out various technical aspects so we can't provide answers to all possible questions. We're also focusing on development rather than writing about it so that everyone can get access to our latest developments at lightning speed. I will however answer a few users' questions.

      We're planning on a release of this early to mid August, giving users some goodies before TRiBot X's release.

      Thank you all for being patient. I hope everyone is excited as much as I am!
        • Like
      • 17 replies
    • Over the past few months, I’ve been working diligently on a new project - TRiBot X. Everything has been written from the ground up, with all of the best practices of software engineering. Every aspect of TRiBot has been re-imagined to support three main goals: flexibility, useability, and reliability.
        • Like
      • 50 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...