Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question How can I stop Script from clicking an object again

Joined
Jul 16, 2016
Messages
21
Hi Guys,

You have been a big help,
I have a question.

I have tried a number of different things to try and stop my Script from clicking on a GameObject again.

I am smelting and in between smelts, my players animation ID is set to -1, which then clicks the object again.

The code I have for clicking is below

public static boolean clickOnObject(GameObject object) {
if(Players.getLocal().getAnimationId() == -1){
object.click();
return Execution.delayUntil(() -> (Players.getLocal().getAnimationId() != -1), 2000);
} else
return false;
}
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
Hi Guys,

You have been a big help,
I have a question.

I have tried a number of different things to try and stop my Script from clicking on a GameObject again.

I am smelting and in between smelts, my players animation ID is set to -1, which then clicks the object again.

The code I have for clicking is below

public static boolean clickOnObject(GameObject object) {
if(Players.getLocal().getAnimationId() == -1){
object.click();
return Execution.delayUntil(() -> (Players.getLocal().getAnimationId() != -1), 2000);
} else
return false;
}
Consider instead of delaying until the player isn't animating to be until the player doesn't not have the bars in their inventory :D
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
And it didnt work?
Execution.delayUntil(() -> !Inventory.contains("Whatever"), 30000);
 
Go check out new bots and give helpful feedback.
Joined
Jan 31, 2016
Messages
5,413
Well 10000 is only 10 seconds. Which seems too short ad a max delay
 
Top