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


    FriedNuts

    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

    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.