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
  • Try asking for help in the chatbox
  • GetGroundItems


    Gorn
     Share

    Recommended Posts

    GroundItem[] loot = manager.getGroundItems().getGroundItems(lootTile);

    Can you rename this to something like 'getGroundItemsOnTile'?

    I was just banging my head on why getGroundItems doesn't take Tile type, but you can't rename it cause it would break old code right? It's pretty confusing for newcomers

     

    Link to comment
    Share on other sites

    That's what I was looking at and didn't realize you have to write it twice like

    getGroundItems().getGroundItems(lootTile)

    Basically there are 2 different functions both named getGroundItems and I didn't realize it right away. Especially confusing when you need to chain them like this.

    Edited by Gorn
    clarification
    Link to comment
    Share on other sites

    • 2 months later...
    On 3/3/2020 at 9:24 AM, Gorn said:

    That's what I was looking at and didn't realize you have to write it twice like

    getGroundItems().getGroundItems(lootTile)

    Basically there are 2 different functions both named getGroundItems and I didn't realize it right away. Especially confusing when you need to chain them like this.

    That's because we have the api class "GroundItems" and then you have the method to retrieve ground items.

    After looking at it though I do notice that the other api classes don't follow the same trend, since they use filters and such.
    I'm updating it to have the method getItemsOnTile(Tile t) and deprecating the getGroundItems(Tile t)
    Thank you for the report/suggestion!

    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
     Share

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