1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question How can I stop Script from clicking an object again

Discussion in 'Developer Support' started by Matty20, Aug 2, 2016.

  1. Matty20

    Joined:
    Jul 16, 2016
    Messages:
    21
    Likes Received:
    5
    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 bot 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;
    }
     
  2. awesome123man

    awesome123man Go check out new bots and give helpful feedback.

    Joined:
    Jan 31, 2016
    Messages:
    5,413
    Likes Received:
    1,662
    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
     
  3. Matty20

    Joined:
    Jul 16, 2016
    Messages:
    21
    Likes Received:
    5
    Thanks for the reply, I have tried that.
     
  4. awesome123man

    awesome123man Go check out new bots and give helpful feedback.

    Joined:
    Jan 31, 2016
    Messages:
    5,413
    Likes Received:
    1,662
    And it didnt work?
    Execution.delayUntil(() -> !Inventory.contains("Whatever"), 30000);
     
  5. Matty20

    Joined:
    Jul 16, 2016
    Messages:
    21
    Likes Received:
    5
    yup thats the exact code i had except my delay was shorter. I had 10000
     
  6. awesome123man

    awesome123man Go check out new bots and give helpful feedback.

    Joined:
    Jan 31, 2016
    Messages:
    5,413
    Likes Received:
    1,662
    Well 10000 is only 10 seconds. Which seems too short ad a max delay
     

Share This Page

Loading...