Jump to content

How to use Inventory To RS2Object?


lokaloka

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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