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
  • How To Force Shift-Drop on Inventory Items


    justinwagoner

    Recommended Posts

    The problem I'm looking to solve is how to make sure that when dropping 27/28 items in an inventory is a fast manner, how to make sure all 27 items are dropped using shift-click instead of right-click. It appears very botlike when randomly 2 of the items are dropped using right-click, especially when shift is already held. I was originally trying to use Inventory#dropAll but it was a little slow and would occasionally do the right-click drop. Here is the code I've got now 

    public void dropItems(int[] dropOrder) {
    
        Keyboard.pressShift();
        for(int i : dropOrder) {
            Item item = Inventory.getItemInSlot(i);
            if(item != null && !shouldKeep(item.getName())) {
                item.interact("Drop");
            }
        }
        Keyboard.releaseShift();
    }
    

    Any ideas on how to force the drop to be a left click? I noticed that GameObjects have the option to Force Left Click but can't find anything like that for items.

    Link to comment
    Share on other sites

    21 hours ago, Presumptuous said:
    Mouse.getMouseSettings().setRightClick(false);

    You could always enable it after dropping all items if you need it for anything else.

    Thanks for this. Unfortunately looks like interact doesn't request from mouse settings before determining left or right click. Think I'm just going to have to write my own method from scratch to avoid using Item#interact to drop the item.

    Link to comment
    Share on other sites

    You could just `Mouse.click()` on every inventory slot? 

        public void dropItems(int[] dropOrder) {
            Keyboard.pressShift();
            for (int i : dropOrder) {
                Item item = Inventory.getItemInSlot(i);
                if (item != null && !shouldKeep(item.getName())) {
                    Mouse.click(Inventory.slotBounds(i));
                }
            }
            Keyboard.releaseShift();
        }

     

    Link to comment
    Share on other sites

    12 hours ago, hashbang said:

    You could just `Mouse.click()` on every inventory slot? 

        public void dropItems(int[] dropOrder) {
            Keyboard.pressShift();
            for (int i : dropOrder) {
                Item item = Inventory.getItemInSlot(i);
                if (item != null && !shouldKeep(item.getName())) {
                    Mouse.click(Inventory.slotBounds(i));
                }
            }
            Keyboard.releaseShift();
        }

     

    Thank you. This is what I needed. If anyone else needs it, this is the solution.

    Link to comment
    Share on other sites

    if(Inventory.isFull())
            {
                List<Item> inventory = methodsClass.getPlayerInventory();
                Keyboard.pressShift();
                for(int i = 0; i < inventory.size(); i++)
                {
                    if(inventory.get(i).getName().equals("Willow logs"))
                    {
                        inventory.get(i).interact("Drop");
                    }
                }
                Keyboard.releaseShift();
            }

    This seems to work for me for shift dropping items. I had to enable shift-click dropping in runescape settings. any way of enabling that setting with code?

    Link to comment
    Share on other sites

    1 hour ago, KeesOG said:

    This seems to work for me for shift dropping items. I had to enable shift-click dropping in runescape settings. any way of enabling that setting with code?

    Try this.

    You may not even need to check if it's already enabled, the Toggle function may check that already and just no-op if it's already enabled.

    if (!ClientSettings.isShiftClickDroppingEnabled()) {
        ClientSettings.toggleShiftClickDropping(true);
    }
    Link to comment
    Share on other sites

    Thanks bro really helped!

    5 hours ago, hashbang said:

    Try this.

    You may not even need to check if it's already enabled, the Toggle function may check that already and just no-op if it's already enabled.

    if (!ClientSettings.isShiftClickDroppingEnabled()) {
        ClientSettings.toggleShiftClickDropping(true);
    }
    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.