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
  • Loot tile for larger NPC


    SigmaDev
     Share

    Recommended Posts

    Any thoughts on getting the loot tile for a larger NPC (Something like a Cow)

    Just started playing with this API yesterday and wondered about getting your loot but logging the tile of the NPC you're killing but the loot isn't guaranteed to drop there.
    I'm imagining I need to take orientation into consideration and what tiles the NPC is occupying but wondered if anyone had done this before I threw some maths at the wall until it worked

    Link to comment
    Share on other sites

    12 minutes ago, camalCase said:

    loot always drops on the south west tile iirc, idk what tile getTile method gets

    I'll look into that, thanks

    Link to comment
    Share on other sites

    Posted (edited)

    Think you remember correctly about the south west and getTile seems to get a tile of the NPC but never the tile the loot will land on.
    Trying to see if there's a method in the docs for getting all tiles an NPC occupies to easily get the south west, but I think no such method exists and I'll have to do some maths based off of orientation.

    Edited by SigmaDev
    Link to comment
    Share on other sites

    5 hours ago, abuseedom3 said:

    Grounditems.closest???

    Wanted to ensure the loot was from my kill and not one from someone else that happened to be closer

    Link to comment
    Share on other sites

    On 4/26/2022 at 2:31 PM, SigmaDev said:

    Think you remember correctly about the south west and getTile seems to get a tile of the NPC but never the tile the loot will land on.
    Trying to see if there's a method in the docs for getting all tiles an NPC occupies to easily get the south west, but I think no such method exists and I'll have to do some maths based off of orientation.

    I thought the same too but it really is just

    Tile lootTile = new Tile(npcTile.getX() - 1, npcTile.getY() - 1);

     

    Link to comment
    Share on other sites

    17 hours ago, holic said:

    I thought the same too but it really is just

    Tile lootTile = new Tile(npcTile.getX() - 1, npcTile.getY() - 1);

     

    That's exactly what I ended up doing yesterday and it seems to be fine, think I was just over thinking it originally, but thanks!

    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.