Jump to content

dropAll implementation?


PshYouLost

Recommended Posts

Hey guys! I'm trying to find the code that implements 

getInventory().dropAll(String itemName);

I looked over the forums and I found

private Filter < Item > nameFilter = new NameFilter < Item > ("Iron ore");
for (int slot = 0; slot < 28; slot++) {
    Item itemInSlot = getInventory().getItemInSlot(slot);
    if (itemInSlot != null && nameFilter.match(itemInSlot)) {
        getInventory().interact(slot, "Drop");
        sleep(random(25, 100));
    }
}

Except this doesn't activate the shiftdrop which is what I'm looking for.

Any ideas? I just want to code it so that something happens before a single drop.

Link to comment
Share on other sites

I figured it out. Mine just assumes shiftdrop is enabled

 

                   case DROP:
                        getKeyboard().pressKey(VK_SHIFT);
                        for (int slot = 0; slot < 28; slot++) {
                            Item itemInSlot = getInventory().getItemInSlot(slot);

                            if (itemInSlot != null && nameFilter.match(itemInSlot)) {
                                getInventory().interact(slot);
                                sleep(random(25, 100));
                            }
                        }
                        getKeyboard().releaseKey(VK_SHIFT);

 

Link to comment
Share on other sites

36 minutes ago, PshYouLost said:

Hey guys! I'm trying to find the code that implements 


getInventory().dropAll(String itemName);

I looked over the forums and I found


private Filter < Item > nameFilter = new NameFilter < Item > ("Iron ore");
for (int slot = 0; slot < 28; slot++) {
    Item itemInSlot = getInventory().getItemInSlot(slot);
    if (itemInSlot != null && nameFilter.match(itemInSlot)) {
        getInventory().interact(slot, "Drop");
        sleep(random(25, 100));
    }
}

Except this doesn't activate the shiftdrop which is what I'm looking for.

Any ideas? I just want to code it so that something happens before a single drop.

 

If shift dropping is enabled in the osrs settings, the OSBot dropAll method will use shift dropping afaik.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...