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
  • Couple questions


    kokololo911

    Recommended Posts

    Very nice API i must admit :)

    I was just wondering how one would go about handling item with charges on them like ring of wealth and amulet of glory for example.

     

    Lets say i want to retrieve an amulet of glory with atleast one charge from the bank. Do i really have to look if theirs one with 6 then retrieve it, if its not the case look for one with 5 charges and then retrieve it ? Thats how am going about it atm and seems highly ineffective. Can you check the charges on a item  or something along those lines ?

    Also can someone point me to a good guide about moving. Can i just Walk from the GE to Edgeville with one command walk(edgevilleTile) for example ? I dont mean good programming patterns about navigating i just mean how to properly use the API i havent seen guides on that mainly looking at the javadoc and guessing.

    Thanks !

     

    Link to comment
    Share on other sites

    On 2/22/2023 at 8:40 AM, kokololo911 said:

    Lets say i want to retrieve an amulet of glory with atleast one charge from the bank. Do i really have to look if theirs one with 6 then retrieve it, if its not the case look for one with 5 charges and then retrieve it ? Thats how am going about it atm and seems highly ineffective. Can you check the charges on a item  or something along those lines ?

     

    That is basically the way, however you let dreambot handle the heavy lifting like this:

    // Order the list by priority, so if you prefer to withdraw an amulet with 6 charges, put that at the top of the list.
    List<String> amulets = new ArrayList<>() {{
        add("Amulet of glory(6)");
        add("Amulet of glory(5)");
        add("Amulet of glory(4)");
        add("Amulet of glory(3)");
        add("Amulet of glory(2)");
        add("Amulet of glory(1)");
    }};
    Bank.withdraw(i -> amulets.contains(i.getName()), 1);

     

     

    On 2/22/2023 at 8:40 AM, kokololo911 said:

    Can i just Walk from the GE to Edgeville with one command walk(edgevilleTile)

    Not quite `Walking.walk` will take one step towards the destination target, so you have to call it in a loop sleeping appropriately in between.

    This gives you the chance to perform other "human-like" actions while walking, such as moving the camera, checking the map etc.

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.