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 Dawg -> Awesome -> Regal

    Joined:
    Jan 31, 2016
    Messages:
    3,228
    Likes Received:
    832
    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 Dawg -> Awesome -> Regal

    Joined:
    Jan 31, 2016
    Messages:
    3,228
    Likes Received:
    832
    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 Dawg -> Awesome -> Regal

    Joined:
    Jan 31, 2016
    Messages:
    3,228
    Likes Received:
    832
    Well 10000 is only 10 seconds. Which seems too short ad a max delay
     

Share This Page

Loading...