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.

Interacting with inventory items

Featured Replies

title says it all really, ive been searching the API for about an hour now but cant figure out how to put the code together... can anyone tell me what the code is for interacting with an inventory item?

 

i was hoping it would be as simple as this... but its not

 

 

if (inventory.contains("Bird's Nest")){
item.interact("Search");
}

 

title says it all really, ive been searching the API for about an hour now but cant figure out how to put the code together... can anyone tell me what the code is for interacting with an inventory item?

 

i was hoping it would be as simple as this... but its not

if (inventory.contains("Bird's Nest")){
item.interact("Search");
}
if(inventory.contains("Bird's Nest")){

 inventory.getItem("Bird's Nest").interact("Search");
  //sleep

}

Edited by Isolate

  • Author
if(inventory.contains("Bird's Nest")){

 inventory.getItem("Bird's Nest").interact("Search");
  //sleep

}

 

ah thanks so much, you dont know how long i was searching the api for just that little bit of code XD

  • Author
if(inventory.contains("Bird's Nest")){

 inventory.getItem("Bird's Nest").interact("Search");
  //sleep

}

 

this actually doesnt work... just figured out the nest after its been searched is still called Bird nest... how can i go about using IDs?

 

private int[] NEST_ID = {5070,5071,5072,5073,5074,5075};

 

i have the in but just dont know how to implement it

this actually doesnt work... just figured out the nest after its been searched is still called Bird nest... how can i go about using IDs?

 

private int[] NEST_ID = {5070,5071,5072,5073,5074,5075};

 

i have the in but just dont know how to implement it

 

same 


private int[] NEST_ID = {5070,5071,5072,5073,5074,5075};

if(inventory.contains(NEST_ID)){

 inventory.getItem(NEST_ID).interact("Search");
  //sleep

}

or

Item nest = script.inventory.getItem(new Filter<Item>() {
        @Override
        public boolean match(Item item) {
            return item.getName().equalsIgnoreCase("Bird's Nest")&& item.getActions()[0].equalsIgnoreCase("Search");
        }
    });
        
        if(nest != null){
            nest.interact("Search");
            //sleep
        }

there's lots of ways of doing this, but ID's should work well for what you want

Edited by Isolate

  • Author

same

private int[] NEST_ID = {5070,5071,5072,5073,5074,5075};if(inventory.contains(NEST_ID)){ inventory.getItem(NEST_ID).interact("Search");  //sleep}
or
Item nest = script.inventory.getItem(new Filter<Item>() {        @Override        public boolean match(Item item) {            return item.getName().equalsIgnoreCase("Bird's Nest")&& item.getActions()[0].equalsIgnoreCase("Search");        }    });                if(nest != null){            nest.interact("Search");            //sleep        }
there's lots of ways of doing this, but ID's should work well for what you want

Ah thanks a lot :)

Guest
This topic is now closed to further replies.

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.