Jump to content

Sleep is broken


September

Recommended Posts

So i am currently in the making of a script which interacts with an object. And it keeps on spam clicking the object. I have the code below after my interaction with the object.

sleep(random(4000, 7000)); 

Even after using the code above it will spam click every 1 seconds.

 

Are you sure its not the rest of your code? :xdoge:

  • Like 1
Link to comment
Share on other sites

Are you sure its not the rest of your code? 78ZISi3.png

 

 

show the rest of the code

 

 

It works just fine smile.png

 

Show us your code ^^

 

This is from my stealing state

Entity chest = objects.closest("Chest");
			if (!myPlayer().isAnimating() && chest != null) {
			chest.interact("Search for traps");
			sleep(random(4000, 7000));
			}

I'm very inexperienced when it comes to coding but i'm going to take a guess maybe the sleep line doesn't trigger because the interacting makes the if statement false? :s

Link to comment
Share on other sites

This is from my stealing state

Entity chest = objects.closest("Chest");
			if (!myPlayer().isAnimating() && chest != null) {
			chest.interact("Search for traps");
			sleep(random(4000, 7000));
			}

I'm very inexperienced when it comes to coding but i'm going to take a guess maybe the sleep line doesn't trigger because the interacting makes the if statement false? :s

 

The bot isn't checking for traps either right? It's because your if statement conditional isn't resolving to true, and you have code after this block that's actually doing the spam clicking. 

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...