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
  • help with looting?


    Taytot

    Recommended Posts

    Why isnt my script looking at items that are on the ground?

     

    List<GroundItem> lootableItems = GroundItems.all(item -> item != null && goblinArea.contains(item) && item.exists() && item.distance(Players.getLocal()) < 5);
    if (!lootableItems.isEmpty()) {
        for (GroundItem item : lootableItems) {
            // Check if the item is either coins or bones
            if (item.getName().equals("Coins") || item.getName().equals("Bones")) {
                // Attempt to loot coins or bones
                if (item.interact("Take")) {
                    log("Looting " + item.getName() + "...");
                    sleep(Calculations.random(2000, 4000));
                    return Calculations.random(2000, 3000);
                } else {
                    log("Failed to loot " + item.getName() + "!");
                }
            }
        }
    }
    Link to comment
    Share on other sites

    Posted (edited)

    Interesting. I had it after something else in my onloop order and it was not executing.

    I am looting now. I am learning so much

    Edited by Taytot
    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.