zdot 14 Posted April 16, 2013 Report Share Posted April 16, 2013 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 Quote Link to post Share on other sites
darryl561 177 Posted April 17, 2013 Report Share Posted April 17, 2013 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") } 1 Quote Link to post Share on other sites
zdot 14 Posted April 17, 2013 Author Report Share Posted April 17, 2013 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! Quote Link to post Share on other sites
zdot 14 Posted April 19, 2013 Author Report Share Posted April 19, 2013 it's working great. thx again Quote Link to post Share on other sites
UBotDev 276 Posted April 27, 2013 Report Share Posted April 27, 2013 Thought I had a better way to solve but it won't work for this case. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.