Jump to content

Interacting faster with npc


Recommended Posts

Posted

So my question is there any way to interact npc faster.

   What my script does is simply  "Use" item in my inventory and clicks on npc and repeat till inventory is full, but it clicks every 1-2 seconds and thats slow code that i use.

if (getInventory().isItemSelected()) {

npc.interact("use");

} else {

getInventory().interact("Use", "item name");

}

Please answer understandable way cuz im newbie.

  • Developer
Posted

Maybe something like this?


if (!inventory.isItemSelected()) {
    inventory.interact("Use", "item name");
    if (!new ConditionalSleep(2000) {
        @Override
        public boolean condition() {
            return inventory.isItemSelected();
        }
    }.sleep()) {
        return 10 + gRandom(5, 5);
    }
}
npc.interact("use");
  • Like 1

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