Jump to content

Getting the RealID from an obejct


Recommended Posts

Posted

You could just check if it has the action to retrieve the bars, rather than get a change in ID. Just a suggestion.

Even something as simple as:

 public void takeBars() throws InterruptedException {
    	
		RS2Object dispencer = getObjects().closestThatContains("Bar dispenser");

        if  (dispencer != null); {
            if (dispencer.hasAction("Take bars")){ //don't remember the actual action name, let's pretend it's Take bars lol.
                dispencer.interact("Take bars");
                sleep(random(50, 500));      
            }
            new ConditionalSleep(5000, 20) {
                @Override
                public boolean condition() throws InterruptedException {
                    return (dispencer.hasAction("Take bars"));
                }
            }.sleep();
      }

 

  • Like 1
Posted
14 hours ago, Lol_marcus said:

You could just check if it has the action to retrieve the bars, rather than get a change in ID. Just a suggestion.

Even something as simple as:


 public void takeBars() throws InterruptedException {
    	
		RS2Object dispencer = getObjects().closestThatContains("Bar dispenser");

        if  (dispencer != null); {
            if (dispencer.hasAction("Take bars")){ //don't remember the actual action name, let's pretend it's Take bars lol.
                dispencer.interact("Take bars");
                sleep(random(50, 500));      
            }
            new ConditionalSleep(5000, 20) {
                @Override
                public boolean condition() throws InterruptedException {
                    return (dispencer.hasAction("Take bars"));
                }
            }.sleep();
      }

 

I was soo focused on the RealID changing and trying to detect it, i didn't even see the interact changing.

Thanks you very much.

  • Like 1
  • 5 months later...
Posted
On 6/8/2020 at 3:22 AM, Lol_marcus said:

You could just check if it has the action to retrieve the bars, rather than get a change in ID. Just a suggestion.

Even something as simple as:


 public void takeBars() throws InterruptedException {
    	
		RS2Object dispencer = getObjects().closestThatContains("Bar dispenser");

        if  (dispencer != null); {
            if (dispencer.hasAction("Take bars")){ //don't remember the actual action name, let's pretend it's Take bars lol.
                dispencer.interact("Take bars");
                sleep(random(50, 500));      
            }
            new ConditionalSleep(5000, 20) {
                @Override
                public boolean condition() throws InterruptedException {
                    return (dispencer.hasAction("Take bars"));
                }
            }.sleep();
      }

 

Still helpful in 2020 :) thanks.

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