Jump to content

Requst use item on object snippet


Recommended Posts

Posted (edited)

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

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
  • Recently Browsing   0 members

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