Jump to content
UBot Underground

Stopwatch in UI panel


Recommended Posts

Anyone knows how to include a stopwatch in Ubot?

 

I want to show some kind of progress while the bot is running. It's not in a loop so I can't use a progress bar. I'm using a http post plugin, and it is waiting sometime up to 20 seconds until the result is returned to the bot.

 

The stopwatch has to start when the run button is clicked ans stop when process is over.

 

thx a bunch in advance

Link to post
Share on other sites

Not sure but this might help:

 

ui stat monitor("timer", #counter)
ui button("run") {
    run()
}
define run {
    thread {
        set(#stopwatch, "start", "Global")
        set(#counter, 0, "Global")
        loop while($comparison(#stopwatch, "=", "start")) {
            increment(#counter)
            wait(1)
        }
    }
    navigate("http://www.google.com", "Wait")
    type text(<name="q">, "house", "Standard")
    click(<name="btnK">, "Left Click", "No")
    wait(3)
    navigate("http://www.bing.com", "Wait")
    type text(<name="q">, "cars", "Standard")
    click(<name="go">, "Left Click", "No")
    set(#stopwatch, "stop", "Global")
}
  • Like 1
Link to post
Share on other sites

thx a lot darryl.

 

I just tested it briefly. Your code works nicely as it is, but I need some tweaking to adapt it to my bot.

 

I let you know!

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