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.

Requst use item on object snippet

Featured Replies

I'm pretty new to scripting, made a few that I have gotten to work, but they were just learning tutorials and i edit them a bit, Was trying to see if someone can tell me about how to use an item from my inventory on an object.

New to scripting on here, but ran into this problem whilst working on script for Black Dragons to use.

This worked for my scenario, but sure there is a better way:
 

// access inventory in your way here
 if(getInventory().interact("Use", "Raw chicken")) {
         for(RS2Object o : getObjects().getAll()) {
         if(o.getName().equalsIgnoreCase("Chicken Shrine")) {
                chicken_altar = o;
                break;
            }
         }
         
         if(chicken_altar != null) {
             chicken_altar.hover();
             sleep(random(500, 800));
             mouse.click(false);
...... (cutting code off here)

Edited by bob10

InteractionEvent handles a lot of the guesswork.

 

getInventory().getItem("item").interact("Use");

getObjects().getClosest("object").interact("Use");

 

If you want to be fancy you can make each interaction in a boolean, check the result, and then handle any steps from there.

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.