Jump to content
UBot Underground

UbotStudio keeps running when Stopped


Recommended Posts

While making a script, when I click start in Ubot Studio, it just keeps running, even when I press the Stop button, it just keeps running.

 

I have to close Ubot Studio and reopen the script, but then when I open the script and press Start again, it will just keep running, and I have a loop in it, that visits like 50 URLs, when I press Stop it doesn't stop. It just continues....?

Link to post
Share on other sites

While making a script, when I click start in Ubot Studio, it just keeps running, even when I press the Stop button, it just keeps running.

 

I have to close Ubot Studio and reopen the script, but then when I open the script and press Start again, it will just keep running, and I have a loop in it, that visits like 50 URLs, when I press Stop it doesn't stop. It just continues....?

 

There is a way around this. You make a stop button in the UI, in that stop button you set a variable (in my example i called it #shallistop) and then throughout your loop you use the if statement to check if the variable is set to YES, then when you press the stop button the loop will stop! no need to wait for it to finish.

 

 

Here is a little example for you.

 

 

ui stat monitor("Loop", #loopnumber)
set(#shallistop, $nothing, "Global")
set(#shalistop, $nothing, "Global")
set(#loopnumber, 0, "Global")
ui button("STOP") {
   set(#shalistop, "YES", "Global")
}
loop(999999) {
   if(#shalistop = "YES") {
    then {
	    stop script
    }
   }
   wait(0.2)
   increment(#loopnumber)
}

 

 

 

So lets say my loop was huge (like yours is), I would put the following code everywhere i wanted it to stop if the button is pressed

 

 

 

if(#shalistop = "YES") {
    then {
	    stop script
    }
}

 

 

The above code is just an example, you can use what ever variable names you like... It's just to try to show you how i do it.

 

Hope this helps

 

 

 

Jane

  • Like 3
Link to post
Share on other sites
  • 6 months later...

There is a way around this. You make a stop button in the UI, in that stop button you set a variable (in my example i called it #shallistop) and then throughout your loop you use the if statement to check if the variable is set to YES, then when you press the stop button the loop will stop! no need to wait for it to finish.

 

 

Here is a little example for you.

 

 

ui stat monitor("Loop", #loopnumber)
set(#shallistop, $nothing, "Global")
set(#shalistop, $nothing, "Global")
set(#loopnumber, 0, "Global")
ui button("STOP") {
    set(#shalistop, "YES", "Global")
}
loop(999999) {
    if(#shalistop = "YES") {
	    then {
		    stop script
	    }
    }
    wait(0.2)
    increment(#loopnumber)
}

 

So lets say my loop was huge (like yours is), I would put the following code everywhere i wanted it to stop if the button is pressed

 

 

 

if(#shalistop = "YES") {
	    then {
		    stop script
	    }
}

The above code is just an example, you can use what ever variable names you like... It's just to try to show you how i do it.

 

Hope this helps

 

 

 

Jane

 

 

 

Thank you very much.

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