Jump to content

Getting the RealID from an obejct


erenjwz

Recommended Posts

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

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

  • 5 months later...
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
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...