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  
ScriptsForMains

Proper Banking - add randomization and real success checks.

Recommended Posts

Every script I've seen (including the best scripts out there) withdraw from the bank in the same order every time.  My personal farm running script has pretty simple, yet effective randomization.  The variable "withdrawOrder" determines the order that you withdraw items. coinWithdraw, runesWithdraw, and pineappleWithdraw are integers that determine how many of each thing you'll take out.  When a human is banking, they won't always type the same number in. They'll normally withdraw all of something, spam a number that's greater than how many they need (like "333" if you needed 310 of something) or type some even thousand/hundred number ("like 200" if you needed 115).  I put some possible values in an integer array, then shuffle the possibilities.  Note that I use coinWithdraw[0], runesWithdraw[1], and pineappleWithdraw[2] ...  This makes sure you don't get the same combinations of numbers continuously popping up.  With 6 possible withdraw orders, 6 coinWithdraw numbers, 6 runesWithdraw numbers, and 4 pineappleWithdraw numbers, there are 864 possible banking combinations.  Much harder to have machine learning spot this type of withdraw method. My theory is that when you are reported for botting, they run machine learning algorithms on your account that have been built to detect bots.  I can't imagine a person is sitting there going through your play history.

That being said, I'm a PhD student studying Dynamical Systems and have taken classes on machine learning. Humans aren't always going to be completely random, and a machine would be able to detect bots just as easily if they are "too random".  That's why I withdraw the runes together and the spade/rake together. They're next to each other in my bank and it wouldn't make sense to withdraw some runes, scroll to somewhere else in my bank, withdraw something else, then scroll back.  I thought about always withdrawing my coins first since they're at the top of my bank, but sometimes I forget that I need coins to pay to have the trees chopped down.  I decided to randomize it as well, that's a personal choice though.  If you wanted to get really snazzy (which I plan on doing...) you could have your bot initially "forget" an item, start to run away from the bank, then run back and grab it.

I'm going to create a "proper banking" function that takes a list of everything you want to withdraw, randomizes it, "forgets" items, withdraws all by accident then puts stuff back, etc etc...  Maybe they'll include it in Tribot's Banking functions one day.  I don't want to publish it open source cuz I don't want Jagex moderators to be able to see the code and reverse engineer detection.  This is simple to do though and I think people should be including it in their scripts.  In theory, if the bots are human-like enough, Jagex won't be able to ban anyone even if they're reported for not responding to people.  

Also useful in here is how to withdraw teleport items...  digsitePendantCharge is a variable that allows us to check for any different charge. It easily allows freedom from having to use fully charged items (something a lot of scripts do...).  This is my own personal script so I just have it go in order from full charge to least. You could add randomization here if it was a script you are wanting to publish.  

Common c = new Common();
private boolean shouldRun=true;
private int[] withdrawOrder={0,1,2,3,4,5};
private int[] coinWithdraw={9999, 10000, 5000, 5555, 2000, 1400};
private int[] runesWithdraw={10, 100, 200, 111, 333, 50};
private int[] pineappleWithdraw={40, 50, 44, 100, 40, 50};
private int digsitePendantCharge=0;

...


public void bankWithdraw(){
    DaxWalker.walkToBank();
    shouldRun = c.openBankAndDepositAll(shouldRun);
    addRandomness();

    for(int i=0; i<6; i++) {
        switch (withdrawOrder[i]) {
            case 1:
                shouldRun = c.withdrawItem(coinWithdraw[0], "Coins", shouldRun);
                break;
            case 2:
                shouldRun = c.withdrawItem(3, "Mahogany sapling", shouldRun);
                shouldRun = c.withdrawItem(4, "Papaya sapling", shouldRun);
                break;
            case 3:
                    for (int j = 8; j > 0; j--) {
                        if (c.withdrawItem(1, "Digsite pendant (" + j + ")", shouldRun))
                            break;
                    }
                    break;
            case 4:
                shouldRun = c.withdrawItem(pineappleWithdraw[2], "Pineapple", shouldRun);
                break;
            case 5:
                shouldRun = c.withdrawItem(runesWithdraw[1], "Law rune", shouldRun);
                shouldRun = c.withdrawItem(runesWithdraw[1], "Astral rune", shouldRun);
                shouldRun = c.withdrawItem(runesWithdraw[1], "Water rune", shouldRun);
                break;
            case 6:
                shouldRun = c.withdrawItem(1, "Spade", shouldRun);
                shouldRun = c.withdrawItem(1, "Rake", shouldRun);
                break;
            default:
                println("Broken switch?");
                shouldRun=false;
                break;
        }
    }
    shouldRun=c.closeBank(shouldRun);
}
public void addRandomness(){
    for(int i=0; i < 15; i++){
        int temp = coinWithdraw[0];
        int mix = General.random(1,5);
        coinWithdraw[0] = coinWithdraw[mix];
        coinWithdraw[mix] = temp;
        temp = runesWithdraw[0];
        runesWithdraw[0] = runesWithdraw[mix];
        runesWithdraw[mix] = temp;
        temp = runesWithdraw[0];
        pineappleWithdraw[0] = runesWithdraw[mix];
        pineappleWithdraw[mix] = temp;
        temp = withdrawOrder[0];
        withdrawOrder[0] = withdrawOrder[mix];
        withdrawOrder[mix]=temp;
    }
}

My c.withdrawItem function adds a bit of randomness to the timing and checks if the item was actually withdrawn. Tribot's built in return for withdraw/depositing items doesn't check if your inventory/bank are full, it only checks if you were able to click "Withdraw/Deposit item"...  If you don't check yourself,  you can get stuck in an infinite loop withdrawing/depositing to a full bank/inven.  I have it loop five times because sometimes when the world is laggy, you can fail to click withdraw multiple times in a row. This makes it so my script won't move on until it withdraws the item.  

public boolean withdrawItem(int withdrawCount, String withdrawItem, boolean shouldRun){
    if(!shouldRun){return false;}

    int startInvent = Inventory.getCount(withdrawItem);
    int loopCount=0;
    while(!(Inventory.getCount(withdrawItem)>startInvent)){
        loopCount++;
        General.sleep(100,200);
        if(loopCount>5){
            General.println("Failed to withdraw "+withdrawItem+", ending script");
            return false;
        }
        Banking.withdraw(withdrawCount, withdrawItem);
        Timing.waitCondition(() ->{
            return Inventory.getCount(withdrawItem)>startInvent;
        }, 1000);
    }
    General.println("Successfully withdrew: "+withdrawItem);
    return true;
}

Let me know if there are any questions, happy botting :D

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  

  • 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...