Jump to content

ending conditional sleep on message[solved]


GPSwap

Recommended Posts

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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