Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Drop items?

Featured Replies

Hi, i have a question, i want to drop the items from the inventory avoiding the api path, so i try to make a snake drop path...

Any way, when i try to drop the item from the nº 7 slot, and execute interact, drops me the nº 4.

Is a joke that i'm too peasant to understand??

It's seems like fish (Item var) is linked with nº 7 item, but fish.interact() just jump to 4 and click it.

logs print -> 7 (wich is on a loop until item goes null)

** also i tried getting all the items of the invetory and passing directly nº of the item, but do the same path instead of grabbing item from the getInventory().getItemInSlot().

private void dropFishFromTheInventory(int slotNumberOfTheInventory) throws InterruptedException {
        log(slotNumberOfTheInventory);
        Item fish = getInventory().getItemInSlot(slotNumberOfTheInventory);

        if(fish == null) return;
        if(getSettings().isShiftDropActive()) getKeyboard().pressKey(16);

        for (String fishName :
                SUPPORTED_FISHES) {

            if(fish.getName().contains(fishName)){
                if (getSettings().isShiftDropActive()) {
                    fish.interact();
                } else{
                    fish.interact("drop");
                }

                while(getInventory().getItemInSlot(slotNumberOfTheInventory) != null){
                    waitReflex(1);
                }

                if(getSettings().isShiftDropActive()) getKeyboard().releaseKey(16);
                return;
            }

        }

    }


I'm not sure what i'm doing but i bypassed using:
 

InventorySlotDestination destination = new InventorySlotDestination(getBot(), slotNumberOfTheInventory);
getBot().getEventExecutor().execute(new InteractionEvent(destination, "drop")).hasFinished();

As i'm too noob, I'm not sure if is a bug with Item.Interact(); or is just me xD.

Edited by OsPlay

Hello Osplay.

I think your looking for   

 interact(int slot, java.lang.String... actions)

Its under https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html

private void dropFishFromTheInventory(int slotNumberOfTheInventory) throws InterruptedException {
        log(slotNumberOfTheInventory);
        Item fish = getInventory().getItemInSlot(slotNumberOfTheInventory);

        if(fish == null) return;
        if(getSettings().isShiftDropActive()) getKeyboard().pressKey(16);

        for (String fishName :
                SUPPORTED_FISHES) {

            if(fish.getName().contains(fishName)){
                if (getSettings().isShiftDropActive()) {
				getInventory().hover(slotNumberOfTheInventory);
                getMouse().click();
                } else{
 				getInventory().	interact(int slotNumberOfTheInventory, "drop")
                 
                }

                while(getInventory().getItemInSlot(slotNumberOfTheInventory) != null){
                    waitReflex(1);
                }

                if(getSettings().isShiftDropActive()) getKeyboard().releaseKey(16);
                return;
            }

        }

    }

 

Edited by Nbacon

  • Author

@Nbacon yes!!! using both do "snake" pattern with drop!
inventory-Nbacon.gif

Quote

getInventory().hover(slotNumberOfTheInventory);
getMouse().click(false);
or:
InventorySlotDestination destination = new InventorySlotDestination(getBot(), slotNumberOfTheInventory);
getBot().getEventExecutor().execute(new InteractionEvent(destination, "drop"));

 

this is using ItemCollection hover from:

Item fish = getInventory().getItemInSlot(slotNumberOfTheInventory);
Quote

fish.hover();
getMouse().click(false);

inventory-fish-hover.gif

 

or using:

Quote

fish.Interact();


inventory-fish-interact.gif

 

Edited by OsPlay

So the bug in those 2 images is fish.Interact()/fish.hover(); will go to the top left most that item [ the reson Item(object) in osbot does not have a slot indicator in it ]

Next thing after you under stand that you see this.

Its spam clicking and there is not wait for them to drop so it "does all the green fish" by clicking  10 times on the frist few fish and then moves on to the pinkish fish.

Edited by Nbacon

  • Author
2 hours ago, Nbacon said:

[ the reson Item(object) in osbot does not have a slot indicator in it ]

Yep, that was my question/supposition. Thx for anwser!
 

2 hours ago, Nbacon said:

Next thing after you under stand that you see this next thing.

Sry, my english is not strong enought to understand what do you want to say me... 😭
I'm not sure, i just tought that if it happens with interact, it will be all implemented that way, so i just jump to the decompiler, i saw how is executed interact() and try go arround with getEventExecutioner(), i didn't read the api (sry i know, i had to, shame on me), so probably it was a better way to handle, and it was, thx!

 

Quote

Its spam clicking and there is not wait for them to drop so it "does all the green fish" by clicking  9 times on the frist few fish and then moves on to the pinkish fish.

Yep, that is because i removed from the actual code: (human player will not wait until item is dropped for continue)
 

while(getInventory().getItemInSlot(slotNumberOfTheInventory) != null){
  waitReflex(1);
}

but if you add will go: [0][1][2][3][4] and break, instead of [0][1][2][3][7], the ItemContainer on [7], is not null because is in the inventory. (most of the time)
inventory-goes-4.gif

and if the fish in the row nº 7 is different:
inventory-goes-6.gif

this does 1 more because [7] == null, but [6] != null.
inventory-goes-brrrr.gif

Is picking the first Item of the inventory, is not a bug is implemented that way. ❤️

Edited by OsPlay

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.