Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • getbank.widthdraw


    veeniqqa

    Recommended Posts

    Im using the following code to withdraw tunas. 

    if(getBank().contains(food) && !getInventory().contains(food)){
                    getBank().withdraw("Tuna", 15);
                    sleepUntil(() -> getInventory().count(foodString) == 15 Calculations.random(42000,523000));
                    counter = 0;
                }
    

    And it just stops the script, not sure what im doing wrong?

     

    Edit: fixed turns out my variables weren't setting correctly.

    Link to comment
    Share on other sites

    Is that sleepUntil correct? cuz that wouldn't even compile

    Yeah should do?  gonna test with different sleep then

     

    Edit: Not the sleep

    Link to comment
    Share on other sites

    You seem to be missing a comma in your sleep. The correct sleepUntil() syntax is:

    sleepUntil(() condition, sleepLength);
    

    You forgot the comma between the condition and the length in your example

    Link to comment
    Share on other sites

    Okay thats just a copy and paste error.

    Another thing I noticed is that you check if the bank contains whatever is in the "food" variable, you withdraw "Tuna" and you sleepUntil inventory contains "foodstring" - does all those variables match up to "Tuna"?

     

    I'd suggest using the same variable throughout the entire process, to avoid situations where a variable is set wrong.

    Link to comment
    Share on other sites

    Another thing I noticed is that you check if the bank contains whatever is in the "food" variable, you withdraw "Tuna" and you sleepUntil inventory contains "foodstring" - does all those variables match up to "Tuna"?

     

    I'd suggest using the same variable throughout the entire process, to avoid situations where a variable is set wrong.

    That was my first thought, the condition was false so it was sleeping that enormous timeout period

    Link to comment
    Share on other sites

    If you still can't figure it out try running dreambot through cmd to see if it can tell you where the error is.

     

    Start > Run > cmd

     

    java -jar C:/Users/%username%/DreamBot/BotData/client.jar

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.