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
  • Picking up items on floor


    FriedNuts
     Share

    Recommended Posts

    GroundItem item = GroundItems.closest(#);
            if (item !=null && !Inventory.isFull()){
                item.interact();
                sleep(Calculations.random(500,600));
            }

    I have the following code above, when I have a stack of one item dropped on the floor it will LEFT click the stack for a good amount then try to right click one of the items that is lower in the stack of items. How can i make it such that it does not do that? Thought process would be change the code to click on the tile but what if a random item shows up on the stack? 

    Link to comment
    Share on other sites

    6 minutes ago, FriedNuts said:
    GroundItem item = GroundItems.closest(#);
            if (item !=null && !Inventory.isFull()){
                item.interact();
                sleep(Calculations.random(500,600));
            }

    I have the following code above, when I have a stack of one item dropped on the floor it will LEFT click the stack for a good amount then try to right click one of the items that is lower in the stack of items. How can i make it such that it does not do that? Thought process would be change the code to click on the tile but what if a random item shows up on the stack? 

    Make sure you add the action string in the interact method that is shown on the menu when you right-click the item on the floor.

    Link to comment
    Share on other sites

    2 minutes ago, Neffarion said:

    Make sure you add the action string in the interact method that is shown on the menu when you right-click the item on the floor.

    Thing is i don't want to right click the item on the floor, i just want to click on it repeatedly. 

    My goal is to do as follows:


    Collect item

    Drop till 28 items on floor.

    Click on stack, wouldn't need to right click. 
     

    Link to comment
    Share on other sites

    Just gotta make your own interact method:

    public boolean interact(GroundItem item)
    {
        if(item != null && !Inventory.isFull())
        {
            sleepUntil(() -> Mouse.move(item), Calculations.random(888, 1666));
            return Mouse.click(item);
        }
        return false;
    }

    This is just the basics, I have a more advanced version I use but I'd rather not share it.
    You can add failsafes and other checks to ensure it does click the item by filtering: 

    Mouse.getEntitiesOnCursor()

    and ensuring it is the top object / the mouse is actually there

    Link to comment
    Share on other sites

    39 minutes ago, Axolotl said:

    Just gotta make your own interact method:

    public boolean interact(GroundItem item)
    {
        if(item != null && !Inventory.isFull())
        {
            sleepUntil(() -> Mouse.move(item), Calculations.random(888, 1666));
            return Mouse.click(item);
        }
        return false;
    }

    This is just the basics, I have a more advanced version I use but I'd rather not share it.
    You can add failsafes and other checks to ensure it does click the item by filtering: 

    Mouse.getEntitiesOnCursor()

    and ensuring it is the top object / the mouse is actually there

    Thank you, this works perfectly for what i need. 

    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.