Jump to content
UBot Underground

RUN Command In Dev. Edition


Recommended Posts

The new updates are cool in 4.1.7, I love that you can take out the standard run/pause/stop bar.... But can someone tell me how you code those? I assume it will be a button, but proper procedure for creating the run stop and pause buttons would be great.

Link to post
Share on other sites

I found this on another thread.

 

ui html panel("<button onclick=\"ubot.runScript(\'youtube()\')\">Youtube Go</button>", 300)
define youtube {
   navigate("http://www.youtube.com", "Wait")
}

 

Ok that solves how to run your script but how about stop and pause?

 

I tried making the UI Html code and dropping the stop script command but it doesn't let me use that.

 

What is the proper command for the pause and stop?

Link to post
Share on other sites

I found this on another thread.

 

ui html panel("<button onclick=\"ubot.runScript(\'youtube()\')\">Youtube Go</button>", 300)
define youtube {
   navigate("http://www.youtube.com", "Wait")
}

 

Ok that solves how to run your script but how about stop and pause?

 

I tried making the UI Html code and dropping the stop script command but it doesn't let me use that.

 

What is the proper command for the pause and stop?

 

 

Hi,

 

If you are running in a define from a button and want to stop it the best way i have found is to set a variable in the define, so if the stop button (you make) is pressed then it sets variable #stopbutton to "stop" or 1 or something, then in your define you check for that variable and if it = "stop" or 1 or whatever you used then do a STOP SCRIPT.

 

You could do the same with a pause also, use the button to set a variable and check for the variable in the define . if its set then use the pause command.

 

That's the best way i found out how to do it.

 

Hope this helps.

 

Jane

Link to post
Share on other sites

Here is how I figure out how to make the Run, Pause & Stop work from the UI HTML

 

ui html panel("<button onclick=\"ubot.runScript(\'youtube()\')\">Run</button>
<button onclick=\"ubot.runScript(\'stop()\')\">Stop</button>
<button onclick=\"ubot.runScript(\'pause()\')\">Pause</button>", 100)
define stop {
   set(#stopscript, 1, "Global")
}
define pause {
   set(#pause, 1, "Global")
}
define youtube {
   set(#pause, 0, "Global")
   set(#stopscript, 0, "Global")
   navigate("http://www.youtube.com", "Wait")
   if($comparison(#pause, "=", 1)) {
       then {
           pause script
       }
       else {
       }
   }
   if($comparison(#stopscript, "=", 1)) {
       then {
           stop script
       }
       else {
       }
   }
   type text(<name="search_query">, "fuck", "Standard")
   wait(3)
   if($comparison(#pause, "=", 1)) {
       then {
           pause script
       }
       else {
       }
   }
   if($comparison(#stopscript, "=", 1)) {
       then {
           stop script
       }
       else {
       }
   }
   type text(<name="search_query">, " maria", "Standard")
   wait(3)
   if($comparison(#pause, "=", 1)) {
       then {
           pause script
       }
       else {
       }
   }
   if($comparison(#stopscript, "=", 1)) {
       then {
           stop script
       }
       else {
       }
   }
   type text(<name="search_query">, " hard", "Standard")
}

 

There are a few things that I do not like about this solution.

 

To make the stop script work you have to place the

 

if($comparison(#stopscript, "=", 1)) {
       then {
           stop script
       }
       else {
       }

 

Several times across your bot making any simple bot a lager bot with many lines of code.

 

The other part that I do not like is that I can make it Pause no problem but I can't make it resume because if I hit run again instead of picking up from the pause it just makes a whole new run.

 

Does somebody else has a different solution for this?

 

I will love to hear them.

 

Thanks,

 

P0s3id0n

  • Like 1
Link to post
Share on other sites

That was the first thing I tried but it didn't worked.

 

See the code for that here

 

ui html panel("<button onclick=\"ubot.runScript(\'youtube()\')\">Run</button>
<button onclick=\"ubot.runScript(\'stop()\')\">Stop</button>
<button onclick=\"ubot.runScript(\'pause()\')\">Pause</button>", 100)
define youtube {
   navigate("http://www.youtube.com", "Wait")
   type text(<name="search_query">, "fuck", "Standard")
   wait(3)
   type text(<name="search_query">, " maria", "Standard")
   wait(3)
   type text(<name="search_query">, " hard", "Standard")
}
define stop {
   stop script
}
define pause {
   pause script
}

Link to post
Share on other sites

Here is an improved version of the code with the run and stop working perfectly from the UI HTML Panel. The Pause Button still has issues

 

ui html panel("<button onclick=\"ubot.runScript(\'youtube()\')\">Run</button>
<button onclick=\"ubot.runScript(\'stop()\')\">Stop</button>
<button onclick=\"ubot.runScript(\'pause()\')\">Pause</button>", 100)
define pausecheck {
   if($comparison(#pause, "=", 1)) {
       then {
           pause script
       }
       else {
       }
   }
}
define stopcheck {
   if($comparison(#stopscript, "=", 1)) {
       then {
           stop script
       }
       else {
       }
   }
}
define stop {
   set(#stopscript, 1, "Global")
}
define pause {
   set(#pause, 1, "Global")
}
define youtube {
   set(#pause, 0, "Global")
   set(#stopscript, 0, "Global")
   navigate("http://www.youtube.com", "Wait")
   stopcheck()
   pausecheck()
   type text(<name="search_query">, "Make", "Standard")
   wait(3)
   stopcheck()
   pausecheck()
   type text(<name="search_query">, " Money", "Standard")
   wait(3)
   stopcheck()
   pausecheck()
   type text(<name="search_query">, " Online", "Standard")
}

  • Like 1
Link to post
Share on other sites

<button onclick=\"ubot.runScript(\'pause()\')\">Pause</button>", 100)

 

This would only pause the operation but to start it from exactly where it was paused there needs to be a hook for the run command. Pretty much like if I remember correctly there was a command in V 3.x called "start script"

 

Ubot Devs. please answer this.

Link to post
Share on other sites
  • 3 weeks later...

We've got a bunch of things coming up for a future release, sorry it's taking a while - we just have a whole lot going on for next big update :)

 

Just hope its not a v.5 that will render all v.4 (and v.3.5) scripts obsolete... :P

Link to post
Share on other sites
  • 1 month later...

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