v_ladimir 2 Posted January 20, 2017 Report Share Posted January 20, 2017 I have some code: set(#pagesCount,10,"Global")clear list(%linksPars)set(#linkCount,0,"Global")loop(#pagesCount) { increment(#linkCount) set(#links,"http://site.com/agents_{#linkCount}.html","Global") add item to list(%linksPars,#links,"Don\'t Delete","Global")} Can I do this with threads or with Smart Thread Plugin?Regards. Quote Link to post Share on other sites
Macster (UBotter Labs) 112 Posted January 20, 2017 Report Share Posted January 20, 2017 Yes you can yet using threads to add incremental variables to a list may not very practical unless you have a huge amount of data. i.e millions/billions Quote Link to post Share on other sites
v_ladimir 2 Posted January 20, 2017 Author Report Share Posted January 20, 2017 (edited) Can somebody add some code with above logics with threads? Edited January 20, 2017 by v_ladimir Quote Link to post Share on other sites
Macster (UBotter Labs) 112 Posted January 20, 2017 Report Share Posted January 20, 2017 set(#totalthreads,10,"Global") set(#pagesCount,1000,"Global") clear list(%linksPars) set(#threads,0,"Global") set(#linkCount,0,"Global") loop while($comparison(#linkCount,"<",#pagesCount)) { loop while($comparison(#threads,">=",#totalthreads)) { wait(1) } thread { increment(#threads) increment(#linkCount) set(#links,"http://site.com/agents_{#linkCount}.html","Local") add item to list(%linksPars,#links,"Don\'t Delete","Global") } decrement(#threads) } This is the simplest example to the same loop you had but it using threads. edit: check the updated code 1 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.