terranstrat 0 Posted November 4, 2013 Report Share Posted November 4, 2013 Hi! im trying to understand multithreading in ubot. but im having problems getting it to work.if someone would help me, i would be really happy!i want 10 threads, and i want those 10 threads to loop as long as i want.heres what i have done : ui text box("threads", #threads)ui text box("cycles", #cycles)loop(#cycles) { thread { in new browser { navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") reset account("Any") type text(<username field>, $account data("First Name"), "Standard") type text(<password field>, $account data("Password"), "Standard") wait for browser event("Everything Loaded", "") click(<value="Submit">, "Left Click", "No") } }}maybe this is simple for you guys, but im such a newbie!Thanks! Quote Link to post Share on other sites
LazyBotter 188 Posted November 4, 2013 Report Share Posted November 4, 2013 You need "Thread Control", check this thread out: http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/ Carl 1 Quote Link to post Share on other sites
terranstrat 0 Posted November 4, 2013 Author Report Share Posted November 4, 2013 You need "Thread Control", check this thread out: http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/ CarlThanks carl, but i still cant get it to work. Can u take a look at this? ui text box("Number of accounts", #number accounts)ui drop down("Thread Count", "2,3,4,5,6,7,8,9,10", #num threads)set(#num created, 0, "Local")set(#used threads, 0, "Local")loop(#number accounts) { loop while($comparison(#used threads, ">=", #num threads)) { wait(1) } loop process()define loop process { increment(#used threads) increment(#num created) registration procedure()define registration procedure { thread { in new browser { registration code here()define registration code here { if($comparison(#num created, "<=", #number accounts)) { then { navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") reset account("Any") type text(<username field>, $account data("First Name"), "Standard") wait(10) click(<value="Submit">, "Left Click", "No") } else { } } } decrement(#used threads) } } } }} maybe im on the right track atleast? Thanks for getting back to me by the way! Quote Link to post Share on other sites
k1lv9h 76 Posted November 4, 2013 Report Share Posted November 4, 2013 Hi, You have some variables set to local. Sample:sample-thread-007.ubot Kevin 1 Quote Link to post Share on other sites
terranstrat 0 Posted November 4, 2013 Author Report Share Posted November 4, 2013 Kevin, thank you so much! that helped alot, it works now!hope your doing well!Tobbe 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.