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
  • Looting only items that belong to me [Ironman]


    redrum

    Recommended Posts

    Hmm I found a solution. It seems like its only 1 tile off. Just check to see if the loot is within the distance of 1 tile of the tile that was set. Should work.

    But once again I run into the problem of the what if the loot that is 1 tile off could be some 1 elses - to the east/west/north/south of me. 

     

    I guess I'll just find monsters that don't move around. Building combat bots for ironman are going to be a bit more difficult than what I am used to from the glory days of botting.

     

    I'll tackle looting all together at some point by keeping track of all items that are on screen and then flagging ones that are ones dropped by monsters i killed and then looting from the greenlit drops but that'll be a different day. Thank you for your input at this ungodly hour. 

    Link to comment
    Share on other sites

    But once again I run into the problem of the what if the loot that is 1 tile off could be some 1 elses - to the east/west/north/south of me. 

     

    I guess I'll just find monsters that don't move around. Building combat bots for ironman are going to be a bit more difficult than what I am used to from the glory days of botting.

     

    I'll tackle looting all together at some point by keeping track of all items that are on screen and then flagging ones that are ones dropped by monsters i killed and then looting from the greenlit drops but that'll be a different day. Thank you for your input at this ungodly hour. 

     

    Not a problem anytime. Can't sleep tonight so I'm up just messing around.

    Link to comment
    Share on other sites

    Not a problem anytime. Can't sleep tonight so I'm up just messing around.

    Word.

    I don't normally sleep for some reason - can get away with 2-3(Or sometimes lately - 0 :/ ) hours of sleep and still be productive. I don't like it but it is what it is right now. I'm going to play by hand and quest for a bit lol. Take care.

    Link to comment
    Share on other sites

    I have to say that looting only your loot is quite a challenging problem to solve.

     

    There is no real way for you to check if a GroundItem is "lootable". The only way I can think off besides the one already mentioned is to write a thread that keeps track of all monsters that you fight and kill.

     

    When an NPC is killed, you should add the killed NPC's Tile location to a collection, which in turn is checked by your main thread. 

    If the collection is not empty, pop the Tile and call GroundItems#getGroundItems(Tile t). The GroundItem array that is returned contains the items that are your loot.

     

    That's how I would approach it at least :)

    Link to comment
    Share on other sites

    Hmm I found a solution. It seems like its only 1 tile off. Just check to see if the loot is within the distance of 1 tile of the tile that was set. Should work.

    Stop giving advice that isnt good, this clearly is a problem for OP. He is an ironman and does not want this Bot to get stuck which can and will happen with your solution. If you have no clue stop posting. Simple.

     

    Im not sure if I can help you either here OP since there could be an Item on the Tile your Monster died and your Script could not differentiate that probably.

    For multi-tiled NPC drop Tiles take a look at this Thread: https://dreambot.org/forums/index.php/topic/11026-getting-drop-tile-of-multi-tiled-npc/

     

    Other than that maybe stop using a while loop and change your Setup, make your NPC a field, set it to the one you attack and when its not existant anymore ( NPC#exists ) get the Tile of it, which is the one it died on (if the NPC is multi tiled you have to go through the Code of the above Thread)

     

    I dont really see a good solution for this either. Maybe a low populated World? PK World with 3 items? IronBot life seems to suck

    Link to comment
    Share on other sites

     

    Stop giving advice that isnt good

     

    ...

     

     Maybe a low populated World? PK World with 3 items? 

     

     

     

     

     

    I dont really see a good solution for this either

     

    Atleast my suggestion made sense, if theres no risk and nobody else then you dont have to check all of that, plus I said that I dont see a good solution either (source: quote above)

    Link to comment
    Share on other sites

    Atleast my suggestion made sense, if theres no risk and nobody else then you dont have to check all of that, plus I said that I dont see a good solution either (source: quote above)

     

    my apologies dinh H

    Link to comment
    Share on other sites

    Thanks for your input, I believe I have the starting code for iron bot coming out. I'm keeping track of loot already on screen before I kill and it's compared to what's there after npc.exists() == false. The items nearest me are clearly my loot, it's a starting point but it's not exactly what I want.

     

    I'm glad others have noticed the bad logic of "oh it's just 1 block off, just grab the item" I tried to explain it a few times and it just wasn't clicking.

     

    Combat bots might be a bit complex for ironman to code but it'll be done. I'm looking to create an AIO fighter for ironman, but looting is the most essential part of it, I can mindlessly attack chickens for exp but I want to collect only the feathers that belong to me. This is probably the hardest situation because of how much stuff piles up in the same tile for that location but I believe each ground item has it's own unique identifier that I can tag.

     

     

     

    Just curious: Is there an universal death animation number?


    I'm going to be putting this on the back burner. Keep an eye out for an update - or I'll keep it for solo use but I do believe iron bots could have a market, gathering resources is easy. Combat is not.

    Link to comment
    Share on other sites

    • 1 month later...

    Here's your solution:

    Create a separate looting bot that will follow your ironman at all times and loot everything around you.

     

    Just joking.

     

    Here's your real solution:

    I've read through all posts in this thread. The only way to achieve this with current API is by following a series of steps.

    1) You keep track of the tile of your current interacting NPC.

    2) While you are still in combat with this NPC, you search for loot in a box area around your current NPC's tiles, and you store that existing loot in an array. That loot does not belong to you. You could also store all the loot that's visible on your screen, but that would be uneccessary as you don't have to store loot that's 5 tiles away from your NPC, you know for certain that loot is not yours. This way, even if your NPC moves or your loot suddenly displays one tile away from your apparent NPC's tile, you will be able to loot it because you've now successfully separated loot that's not yours and yours with the lootArray. Most of the time there won't be any new loots occuring exactly at the same time as you kill your npc. If for some reason there would be a rare kill which would occur at the same time as you do yours, and your bot is now trying to loot somebody else's loot, then make sure that only happens once by implementing the messagelistener and making sure that the message "This loot does not belong to you!" only occurs once, and your bot does not try to spam-loot someone else's loot, as this will be suspicious. An extra addition if you want to make this even more failsafe, then create a method that checks if your NPC was moving right before it died. Compare its tiles right before it died, with the tile it just died on. If they're different (NPC has moved), loot the way I described. If they're not, then you can safely assume that your loot will always be on the exact same tile your NPC was on. Thereby only checking for loot on the exact tile NPC was previously located on.

    3) Immediately as your NPC is dead, stop saving to the loot Array.
    4) Loot the new dropped items around your NPC's tiles only if they don't exist in array.
    5) Finish looting

    6) Clean array.

     

    Let me know how you manage :)

    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.