Jump to content

How to use Inventory To RS2Object?


Recommended Posts

Posted

Im using mirror mode, soo slow and i've another problem.

Btw im switching from poopbot, interaction in poopbot API so simple like Inventory.get("item in inventory").useOn("Target Object"). How to archive this using poopbot?

So here example my code

if (objectName != null){
                for(int i : inventorySlotList){
                    if (getInventory().getItemInSlot(i).getName().equals("Item Name")){
                        log("Item found");
                        mouse.click(new InventorySlotDestination(getBot(), i), false);
                        sleep(random(250,500));
                        objectName.interact();
                        sleep(random(250,500));
                    } else {
                        log("Item not found");
                        i++;
                    }

                    log("i: " + i + "Slot Position: " + inventorySlotList);
                }
} else {
	sleep(random(500,1000));

}

Problem :

1. Slow interaction between item in inventory to RS2Object. I've change setting to 50ms in mirror mode.

How to archive 2 tick click item in Inventory to RS2Object?

2. Sometimes when ObjectName become null in a second, mouse clicking item in inventory from slot x to slot 27 and than continues my task from previous position :s

 

thanks

Posted (edited)
11 minutes ago, Khaleesi said:

Without too much extra stuff it would be this
Don't use static sleeps, Use Conditional sleeps to speed it up :)
 

if (getInventory().isItemSelected()) {
            object.interact("Use");
        } else {
            getInventory().interact("Use", ITEM_NAME);
        }

 

uh tyty xD

im using Sleep.sleepUntil for conditional sleep (another post from explv) i think.

Another question bro, how to increase interaction speed?
I think its 1 or 2 second / interaction is tooooo slow

Edited by lokaloka

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...