Jump to content
UBot Underground

Why There Is No Function For "restart Script"?


Recommended Posts

Hello Guys and Girls,

 

short question like above: Why there is no "restart script" Option?

 

Now i have a really Long script cause on several Points there is an "if" function like "if thats going wrong, restart script".

 

To "restart" i have to copy the whole script into the "if" function.

 

Ubot is very slow now, cause i got a really large script.

 

is there any other Option i could use? why it is so difficult just to tell ubot "restart script" or "start script from beginning"?

Link to post
Share on other sites
Link to post
Share on other sites

yes ok thank you for the tip, i will do, but this is no answer to my question :-)

 

why isnt there just a "restart script" command? is hard to create such Thing?

 

It does answer your question :) This is the answer. You put the script into a define and you run the define when you need it to restart.

 

Edit: i'll give an example in a couple of minutes.

Link to post
Share on other sites

Here is an example where we restart 2 scripts over and over until in this case the number 91 or higher is reached:

navigate("https://www.random.org/","Wait")
wait(2)
set(#numberLimitReached,"false","Global")
loop while($comparison(#numberLimitReached,"=","false")) {
    GenerateRandomNumber()
    CheckRandomNumber()
}
define GenerateRandomNumber {
    click(<name="true-random-integer-generator-button">,"Left Click","No")
    wait for element(<id="true-random-integer-generator-result">,"","Appear")
    wait(2)
}
define CheckRandomNumber {
    set(#number,$scrape attribute(<id="true-random-integer-generator-result">,"innertext"),"Global")
    if($comparison(#number,">",90)) {
        then {
            alert("Number greater than 90! Stopping..")
            set(#numberLimitReached,"true","Global")
        }
        else {
        }
    }
}
  • Like 1
Link to post
Share on other sites

oh ok, i understand, thank you very much.

 

p.s. nerverless, a short "restart" command would be cooler ;-)

 

If you think people would benefit from it you can always make suggestions here: http://tracker.ubotstudio.com/projects/ubot-studio-stealth-5-9/issues?set_filter=1&tracker_id=2

Link to post
Share on other sites

yes ok thank you for the tip, i will do, but this is no answer to my question :-)

 

why isnt there just a "restart script" command? is hard to create such Thing?

 

I'd suggest to read the forum, this question pops up from a newbie about every month, the reason it has been requested so much, and has never been implemented is because far better solutions already exist

Link to post
Share on other sites

ok. as a newbie, i dont understand whats better then  "restart script" command. its ever better to Keep Things simple. i would say, let the customer decide if he wants to use this command or not.

 

for my script an simple "restart script" command is more usefull than the define command because i have a large script with many "if" commands in different positions of it. So i have to write a define command for several steps,

 

i think its more complicated to write several define command than just to put in one "restart script" command.

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