erenjwz Posted June 7, 2020 Posted June 7, 2020 Does anyone know how to get the RealID of an object that has changed. in the API it says: getting the ObjectDefinition and than the method getRealID(). but it doesnt work for me. https://osbot.org/api/index.html?org/osbot/rs07/api/def/ObjectDefinition.html Anyone know about this?
erenjwz Posted June 7, 2020 Author Posted June 7, 2020 26 minutes ago, Token said: Why do you need this? I wanted to make a simple Blast Furnace script. The Bar Dispenser changes its Real ID if there is a bar ready to be taken out.
Lol_marcus Posted June 8, 2020 Posted June 8, 2020 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(); } 1
erenjwz Posted June 8, 2020 Author Posted June 8, 2020 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. 1
dc0qdguZU8R50JJu Posted December 3, 2020 Posted December 3, 2020 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. 1