Jump to content

ending conditional sleep on message[solved]


Recommended Posts

Posted
22 minutes ago, IDontEvenBot said:

listen to chatbox for a message and turn a variable true when that message is received and then have your conditional sleep until that boolean is true

Tried this when I first had the issue, and it wouldnt work it would wait till the end of the sleep

Taken a different approach to the whole action and made a work around, thanks for the imput

Posted
9 hours ago, GPSwap said:

Tried this when I first had the issue, and it wouldnt work it would wait till the end of the sleep

Taken a different approach to the whole action and made a work around, thanks for the imput

If it doesnt work its likely that the conditional sleep caches the value of the boolean and doesnt check if it's changed so make it a volatile Boolean and that should work, I think!

Posted
3 minutes ago, IDontEvenBot said:

If it doesnt work its likely that the conditional sleep caches the value of the boolean and doesnt check if it's changed so make it a volatile Boolean and that should work, I think!

well I found a work around for it but il keep that in mind for the future thanks bro

Posted (edited)
12 minutes ago, IDontEvenBot said:

If it doesnt work its likely that the conditional sleep caches the value of the boolean and doesnt check if it's changed so make it a volatile Boolean and that should work, I think!

I think it's because the conditional sleep blocks the thread, and so onMessage isn't called until it finishes.

Pretty sure ConditonalSleep doesn't cache anything because that would kind of defeat the point...

Edited by Explv
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...