Jump to content
UBot Underground

Going crazy trying to create buttons for threads


Recommended Posts

Im trying to have four buttons each controlling the pausing and unpausing of a particular open thread. Here's what I've got so far:

 

Using 4 threads

 

Each ui button has a different variable for pause: #pause1, #pause2, #pause3, #pause4

 

There is a thread counter that assigns each thread a number ( 1 - 4 and then resets back to one ) which is then set locally within the thread, with that I set that thread to work with its corresponding #pause number and button.

 

if($comparison(#thread number"=", 1)) {
                then {
                    loop while($comparison(#pause1"=""Pause")) {
                        wait(1)
                    }
                }
            }

 

 

Problem: say I let all 4 threads open completely and now I want to unpause thread #4, well I better not, because at that point the counter is on 4 and if I close 4, the next thread will receive a number value of 1 from the counter thus replacing the thread corresponding with button #1 before I had the chance to complete the first #1 thread in the first place. It only works if I go in order 1,2,3,4,1,2,3... but that's just lame...

 

I'm pretty sure I'm going about this the wrong way and would LOVE if anyone could shed some light on it.

 

Thanks 

Edited by daveconor
Link to post
Share on other sites

i would write instead something in that would have each of the threads set to active = true or false. Then a set of if else's to say

 

if thread one is running (true) then thread 2, 3, 4 false. 

 

Each time they change, the rules would reset,

 

would that be any help to you?

Link to post
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.

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.

Loading...
×
×
  • Create New...