Code Docta (Nick C.) 638 Posted May 22, 2013 Report Share Posted May 22, 2013 I have TJ's free mem and helps a lot. The browser is eating most of your mem. If you have HTTP plugin from Aymen and make your bots use sockets you can run 500 threads no sweat, if you have the internet. I was playing with my version of sockets public proxy checker and I was sooo amazed when I kept increasing the thread count. CPU and Mem did not change much at all. Didn't use free memory either. Quote Link to post Share on other sites
earthlingj 13 Posted May 29, 2013 Report Share Posted May 29, 2013 Hey i have been using it and i dont think memory is the issue. ive got 32 gigs of ram and 360 gigs ssd. even if im running low threads, lets say 10. threads are still dying and before an hour ill be at 0 threads working Quote Link to post Share on other sites
lewzer 1 Posted July 12, 2013 Report Share Posted July 12, 2013 I have TJ's free mem and helps a lot. The browser is eating most of your mem. If you have HTTP plugin from Aymen and make your bots use sockets you can run 500 threads no sweat, if you have the internet. I was playing with my version of sockets public proxy checker and I was sooo amazed when I kept increasing the thread count. CPU and Mem did not change much at all. Didn't use free memory either.I have a question with using the HTTP plugin and running multi threaded should I be using "in new browser" or is fine just run in new thread. I seem to keep having threads running and not closing off properly and just wondering if this is why. Quote Link to post Share on other sites
Marton 48 Posted July 23, 2013 Report Share Posted July 23, 2013 In the main post, I don't think we need this line:if($comparison(#num created, "<", #number accounts)) { Because the loop argument takes care of that: loop(#number accounts) { (it only runs the loop so many times) Let me know if I'm wrong. Thanks,Marton Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 23, 2013 Author Report Share Posted July 23, 2013 It's a double check tracker to make sure the threads font go past the point you need them to. Just like its checked again in the code here define usually. Don't want and random threads running wild so to validate information mine as well add a couple check points Quote Link to post Share on other sites
Marton 48 Posted July 23, 2013 Report Share Posted July 23, 2013 It's a double check tracker to make sure the threads font go past the point you need them to. Just like its checked again in the code here define usually. Don't want and random threads running wild so to validate information mine as well add a couple check points But it's not needed. It's impossible that it would go past it. Think about it. Example: we want 10 accounts. loop(#number accounts) So it will loop the whole thing 10 times. (not less, not more). = It's impossible that it will create more than 10 account regardless of how many threads it uses at a time. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 23, 2013 Author Report Share Posted July 23, 2013 Hot a bit new around here. When it comes to multi threading in ubot we've seen some strange things round here. So the check if not needed for you feel free to remove it. I have in some of my uses as well. But I normally have some sort if check for validation. Quote Link to post Share on other sites
Marton 48 Posted July 23, 2013 Report Share Posted July 23, 2013 Ok, thank you for the reply. More important question:Instead of: define loop process { increment(#used threads) increment(#num created) registration procedure() Shouldn't the order be: define loop process { increment(#used threads) registration procedure() wait(0.5) increment(#num created) Otherwise It won't create the very last account, because of:if($comparison(#num created, "<", #number accounts)) ?p.s.: I added the 0.5 second delay, to make sure it runs the comparison first (hopefully that's enough delay) Quote Link to post Share on other sites
Marton 48 Posted July 23, 2013 Report Share Posted July 23, 2013 As a general rule it's considered bad coding habit to add double checks where they are not needed (it might cause problems like the one I just showed). I think that comparison should rather be deleted, because that delay is not the best solution. I can't believe leaving out that comparison could ever cause any problems. (on the other hand I totally understand why you might add some sort of if check for validation, I just think in this case it cause more problems than it helps) Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 23, 2013 Author Report Share Posted July 23, 2013 then delete it if you don't want to use it. Its there as in the beginning threads were running wild on their own, and there wasn't to much in way of control. you might set it to X number times to loop, but it was going past that, or not completing properly. If it was more stable I would have removed it a while ago. but if you have no problems with it in there or out, feel free to adjust it as you need.. Quote Link to post Share on other sites
Marton 48 Posted July 23, 2013 Report Share Posted July 23, 2013 I understand, thank you!(in the main post, in the comparison you can simply change < to <= and it will create the last account too) All the best,Marton Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 23, 2013 Author Report Share Posted July 23, 2013 i'll adjust it for others. Quote Link to post Share on other sites
Sanjeev 46 Posted July 26, 2013 Report Share Posted July 26, 2013 Hi TJ! Could please explain something to me in the following code...? with reference to what @Dutch posted here - http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/page-2&do=findComment&comment=73972 ui drop down("Thread Count", "2,3,4,5,6,7,8,9,10", #num threads) ui text box("Number of accounts", #number accounts) set(#num created, 0, "Global") set(#used threads, 0, "Global") 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() decrement(#used threads) } } } define registration code here { if($comparison(#num created, "<", #number accounts)) { then { reset account("Any") set(#user, $account data("Username"), "Local") set(#pass, $account data("Password"), "Local") wordpress() myopera() } else { } } } define wordpress { navigate("https://signup.wordpress.com/signup/", "Wait") type text(<username field>, #user, "Standard") type text(<password field>, #pass, "Standard") wait(30) } define myopera { navigate("https://my.opera.com/community/signup/", "Wait") type text(<username field>, #user, "Standard") type text(<password field>, #pass, "Standard") wait(30) } In 'define registration code here' you are setting #user and #pass variables to local - so how can they be used by the 'wordpress' and 'myopera' commands ? As local variables cannot be passed outside the command / function using it? Sorry if this sounds stupid.. I am just trying to understand multithreading... --also - in define code procedure {if($comparison(#completed rows, "<", $list total(%List1))) {then { we are not setting '#completed rows' to anything initially , nor are we declaring it via the set command. is this ok to do? Thanks. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 26, 2013 Author Report Share Posted July 26, 2013 stead of dragging in the commands from bot bank for it, right click the item from bot bank and see source, and use that source as needed in your multi threading process instead so you have more control over how it operates. Quote Link to post Share on other sites
luis carlos 94 Posted October 29, 2013 Report Share Posted October 29, 2013 --also - in define code procedure {if($comparison(#completed rows, "<", $list total(%List1))) {then { we are not setting '#completed rows' to anything initially , nor are we declaring it via the set command. is this ok to do? Thanks. The same question here, is that variable necessary? Quote Link to post Share on other sites
Otts 4 Posted January 4, 2014 Report Share Posted January 4, 2014 How do you add proxies in to change every time? In multithreaded Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 4, 2014 Author Report Share Posted January 4, 2014 with change proxy node inside that in new browser. it will work locally when used inside a thread. add list to list, list from fileat the very beginning before threading then call change proxy, next list iteminside the in new browser Quote Link to post Share on other sites
Reinbo 2 Posted January 31, 2014 Report Share Posted January 31, 2014 Please help me, what if the #number accounts = total %success create accountThis is still an error, the bot can not stop ui drop down("Thread Count", "2,3,4,5,6,7,8,9,10", #num threads) ui text box("Number of accounts", #number accounts) navigate("http://ubotstudio.com/playground/simple-form", "Wait") wait for element(<about me textarea>, "", "Appear") set(#succes blog check, $false, "Global") set(#used threads, 0, "Global") set(#num created, 0, "Global") clear list(%success create account) loop while($comparison(#succes blog check, "=", $false)) { increment(#used threads) increment(#num created) reset account("Any") loop while($comparison(#used threads, ">=", #num threads)) { wait(1) } thread { in shared browser { if($comparison(#num created, "<=", #number accounts)) { then { account creation() } else { } } decrement(#used threads) } } } define account creation { navigate("http://ubotstudio.com/playground/simple-form", "Wait") wait for element(<about me textarea>, "", "Appear") reset account("Any") set(#user, $account data("Username"), "Global") type text(<username field>, #user, "Standard") set(#pass, $account data("Password"), "Global") type text(<password field>, #pass, "Standard") click(<value="Submit">, "Left Click", "No") wait for element(<id="global-footer">, 60, "Appear") if($exists(<innertext="Account Created">)) { then { add item to list(%success create account, "{#user}:{#pass}", "Delete", "Global") } else { } } if($comparison(#number accounts, "=", $list total(%success create account))) { then { set(#succes blog check, $true, "Global") } else { } } } sorry for my bad english, I hope you can understandthanks! Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 31, 2014 Author Report Share Posted January 31, 2014 it should be stopping based on your example code. you might have a hung thread or 2 that haven't fully cleared themselves from being used. Quote Link to post Share on other sites
denrich 4 Posted April 18, 2014 Report Share Posted April 18, 2014 Great Stuff TJ. Thanks! Quote Link to post Share on other sites
Chelsea 1 Posted May 8, 2014 Report Share Posted May 8, 2014 Here's a Multi Threading Example that TJ helped me with that processes a list with 3 elements per row. I originally tried to use TJ's Advanced example using Tables but found that the multi threading was either missing rows entirely or doubling up on rows. This was primarily due to the fact that the table row value was incremented at the end of each cycle and is a global setting not a local setting. This allowed multiple threads to attempt to increment the table row value at the same time and resulted in almost certain misses in the processing. Following is a complete example for Multi Threading using lists with multiple elements per row. Thanks again to TJ for his help! MultiThreading Using Lists sourcedata.csv A,26,z B,25,y C,24,x D,23,w E,22,v F,21,u G,20,t H,19,s I,18,r J,17,q K,16,p L,15,o M,14,n N,13,m O,12,l P,11,k Q,10,j R,9,i S,8,h T,7,g U,6,f V,5,e W,4,d X,3,c Y,2,b Z,1,a set user agent("Chrome") Create Lists() set(#num threads, 2, "Global") set(#used threads, 0, "Global") loop($list total(%List1)) { loop while($comparison(#used threads, ">=", #num threads)) { wait(1) } loop process() } define loop process { increment(#used threads) run procedure() } define run procedure { thread { in new browser { code procedure() decrement(#used threads) } } } define code procedure { if($comparison(#completed rows, "<", $list total(%List1))) { then { comment("NO NEED TO CLEAR IT THE THREAD EXITS IT CLEARS ON AUTO") add list to list(%local break down, $list from text($next list item(%List1), ","), "Don\'t Delete", "Local") set(#VariableA, $list item(%local break down, 0), "Local") set(#VariableB, $list item(%local break down, 1), "Local") set(#VariableC, $list item(%local break down, 2), "Local") comment("START REST OF YOUR CODE RIGHT IN HERE THE VARIABLES ABOVE WONT SHOW IN YOUR DEBUGGER< SAME WITH THE BREAK DOWN LIST -- THEY ARE LOCAL") add item to list(%recompile, "{#VariableB},{#VariableC},{#VariableA}", "Don\'t Delete", "Global") } else { } } increment(#completed rows) } define Create Lists { set(#Source, "{$special folder("Desktop")}\\Ubot\\UbotData\\", "Global") clear list(%List1) clear list(%recompile) add list to list(%List1, $list from file("{#Source}sourcedata.csv"), "Don\'t Delete", "Global") set list position(%List1, 0) } What did you set #completed rows to? And why do you have that if($comparison... bit at the end? What are variables A, B and C for? If you get rid of that bit of code, would the loop process still work correctly? Need help figuring out how to do this but with a table instead of a list, so I'm looking to set a #row variable and make it increment that after completing a loop, but it won't work. Help, please! 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.