LoWrIdErTJ - BotGuru 904 Posted December 24, 2012 Author Report Share Posted December 24, 2012 the code i ahve here could work as your needing with modification to make sure that it functions properly and cycles through the sites properly. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted December 24, 2012 Author Report Share Posted December 24, 2012 what issues are you having? Quote Link to post Share on other sites
SaHiN 14 Posted December 25, 2012 Report Share Posted December 25, 2012 what issues are you having? My code; 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 { wordpress() myopera() } else { } } } define wordpress { navigate("https://signup.wordpress.com/signup/", "Wait") type text(<username field>, $account data("First Name"), "Standard") type text(<password field>, $account data("Password"), "Standard") wait(30) } define myopera { navigate("https://my.opera.com/community/signup/", "Wait") type text(<username field>, $account data("First Name"), "Standard") type text(<password field>, $account data("Password"), "Standard") wait(30) } Theard count 2Number of accounts 1Don't working. Only 1 account created. Quote Link to post Share on other sites
AutomationNinja 194 Posted December 25, 2012 Report Share Posted December 25, 2012 well your first loop just goes one endlessly Quote Link to post Share on other sites
AutomationNinja 194 Posted December 25, 2012 Report Share Posted December 25, 2012 I'll have to take a closer look in the morning as I don't understand what your trying to do. But it is way let and I should sleep. then be fresh tomorrow Quote Link to post Share on other sites
Twitter Dominator 125 Posted January 3, 2013 Report Share Posted January 3, 2013 Her eis example code you can use for multi threading that is very simple to setup and use with "most" applications. 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 { comment("PLACE YOUR CODE TO ME MULTI THREADED HERE") } else { } } } More advanced multi threading Video: http://screencast.com/t/yq7RuppSDMu Example code attached This uses a login script from the bot bank, and hope you like it.. maybe you could attach the hotmail login code from the video to make it more clear TJ if you have time Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 3, 2013 Author Report Share Posted January 3, 2013 the hotmail code is for account verification processing. nothing really to do with threading or processing account creation like your wanting. Taking a look at your code. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 3, 2013 Author Report Share Posted January 3, 2013 This code sets the user pass, to be the same for both sites in the creation process the way you had it without setting them to local variables to that defined command would mean it changes on each time the $account data is calledand would even change if you placed that to a add item to list would be different then it entered as well. (i think this is a bug) but this is a sure bet wway to use the proper data on both 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) } Quote Link to post Share on other sites
Twitter Dominator 125 Posted January 3, 2013 Report Share Posted January 3, 2013 This code sets the user pass, to be the same for both sites in the creation process the way you had it without setting them to local variables to that defined command would mean it changes on each time the $account data is calledand would even change if you placed that to a add item to list would be different then it entered as well. (i think this is a bug) but this is a sure bet wway to use the proper data on both 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) } Thanks Tj ya i more wanted the actual thread controls in the loops more then the hotmail part i didnt need that only the thread control increment threaddecrease thread type setup you had in the video explanation thanks tho Quote Link to post Share on other sites
Twitter Dominator 125 Posted January 3, 2013 Report Share Posted January 3, 2013 actually your explanation answered another question i had about global and local assignments to variables and or username passwords etc , to be local to the thread one follow up question tho to that when using local as container for variables and un/pass do we need to create extra #variable containers for each of the thread local assignments or does it store it somewhere else? and how can they be retrieved from each thread? ie must we create #username_thread1#username_thread2#username_thread3#username_thread4 etc... for each browser thread? or is that even needed but if we want to save them lets say or use them again how do we retrieve them if not stored in a local #variable container sorry if its a advanced question but its been on my brain all day LOL thanks Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 4, 2013 Author Report Share Posted January 4, 2013 they are used only local in that defined command per threadif you want to save them for later use you need to add them to a global list from within that defined command and thread so that you can use them later. Quote Link to post Share on other sites
Dutch 4 Posted March 19, 2013 Report Share Posted March 19, 2013 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) } 2 Quote Link to post Share on other sites
Security 17 Posted March 21, 2013 Report Share Posted March 21, 2013 I have read this post over and over. Watched the Video over and over.. I just dnt get how it works. Why does it pause ? what does making it wait the one second do ? Maybe im missing something or just dont understand that logic. I have made A LOT of scripts by now using Ubot..Almost all of them mulit threading but not one of them have i done like this. If there is anyone who thinks they could explain this a little more for me.. Like how it actually works. Not just how to do it. Sorry if this is a dumb question. Thanks in advance to everyone.. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted March 21, 2013 Author Report Share Posted March 21, 2013 the loop while wait 1 secondis a monitor on number of threads open and to wait while maximum threads are running. pause isnt needed Quote Link to post Share on other sites
Security 17 Posted March 21, 2013 Report Share Posted March 21, 2013 IC IC. I get it now... So each time used threads is equal to or greater than number of threads, the "Loop while" will continue to wait a second. When used threads falls behind number of threads. Then it will allow the "loop process" to initiate. I see.. very cool. Thanks. Quote Link to post Share on other sites
giganut 109 Posted April 25, 2013 Report Share Posted April 25, 2013 Thanks Tj Just got the pro version. I will be needing this. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 20, 2013 Report Share Posted May 20, 2013 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) } Using the above example how would I loop thru multiple list?I have a list of post I would like to run thru that are specific for each login.So user A logs in and post from user A list (schedule), then post from user A list2 (tweets)Both A list and A list2 have list like thisList Aa,b,cd,f,gList A2tweet1,link1tweet2, link2 So I will need to use "list items" & "next list item" some how I guess. Once I start trying to post stuff that's where everything starts to fail and I get lost in not being able to see it happen cuz it's all local. I'm tired of switching variable to see if they are working. They seem to work globally, I mean I have a non threaded version and it works. But when I try it threaded I start getting all kinds of error messages and throws me off. Can someone throw up a example using this with additional list please? Actually it only needs to be one additional list to loop through, I can add those two together. 1 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted May 20, 2013 Author Report Share Posted May 20, 2013 Do you have it built already single threaded? Build the process single threaded first will make it easier to localize them in threading Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 20, 2013 Report Share Posted May 20, 2013 Yes, as stated above this bot along with many others I have waiting for multi threading, I get a exceeds list error. I guess I need a list position but where? Or I need to not have a clear list or it needs to be some where else. Where? I have tried at beginning of the loop, right before the loop, at the end of the loop, and right after the loop. Different places cause different errors sometimes none at all from Ubot. But then the bot does funny things. May post to one thread but not the other. Or I need to "set" a list position. Or some other things.... Or I need to make something not local and the rest local. Typically I would try to have the next list item global. The rest local. Maybe I should do next list item differently, like do a "set" list position -1 or 0 depending if I use headers. What should be the standard? Is it possible to make a plugin for this? There must be some sort of standard that works for most occasions or at least to get it in our busy little heads. Maybe there should be a set of nodes specific to threading? Or at least have a "local debugger" along with the "Global debugger" so we can see what the heck we are doing wrong. I usually have commands in a define command. Which work fine in non threaded bot. I would think just change those to local and bingo! but no first thing usually is the exceeds list which is do from clearing the list which is a global deal. A side note: to those that don't know if you start changing stuff even after saving Ubot tends to NOT overwrite the changes after a bit and you will have to completely exit program and restart for your "saved" changes to actually work. So you sit there and try different nodes hit save but Ubot will act like it was never any different until you restart it. I have many of time fell into this trap. Made code change didn't work restarted and then it worked fine. So when in doubt exit out!! Ok, so I step away to figure this out once and for all!! I was including the clear list,list position and first add list to list in the same define as where I have the threaded commands...this is BAD. Here is the example I asked for in my previous post. 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 ITTHE 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") set(#VariableD, $list item(%local break down, 3), "Local") set(#VariableE, $list item(%local break down, 4), "Local") comment("START REST OF YOUR CODE RIGHT IN HERETHE VARIABLES ABOVE WONT SHOWIN YOUR DEBUGGER< SAME WITH THE BREAK DOWN LIST -- THEY ARE LOCAL") navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") wait for element(<innertext="Fake account creation form:">, "", "Appear") type text(<username field>, #VariableA, "Standard") type text(<password field>, #VariableB, "Standard") type text(<first name field>, #VariableC, "Standard") type text(<last name field>, #VariableD, "Standard") type text(<about me textarea>, #VariableE, "Standard") wait(1) pause script list2 commands() pause script } else { } } increment(#completed rows)}define Create Lists { clear list(%List1) clear list(%List2) add list to list(%List1, $list from file("{$special folder("Desktop")}\\list1.csv"), "Don\'t Delete", "Global") add list to list(%List2, $list from file("{$special folder("Desktop")}\\list2.csv"), "Don\'t Delete", "Global") set list position(%List1, 0) set list position(%List2, 0)}define list2 commands { add list to list(%local break down list2, $list from text($next list item(%List2), ","), "Don\'t Delete", "Local") set(#post, $list item(%local break down list2, 0), "Local") set(#link, $list item(%local break down list2, 1), "Local") navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") wait for element(<innertext="Fake account creation form:">, "", "Appear") type text(<about me textarea>, $spin("\{{#link} {#post}|{#post} {#link}\}"), "Standard") wait(1)} The key was the define command "Create List" I imagine you can just repeat this as often as needed. Hmm is this where I would put my proxy list?The pause script is there for you to see it happen just hit run to see list2 in action. The list I used: The path for both is on the desktop. CSV filesThe contents you can make your own or use what I used. list1.csvTraffik Cop,123abc,Nick,Not Telling,I am frustrated with threading and determined to figure this out!!Anti Guru,abc696,Jack,Jackson,I know nothing about everything, But something about nothing. list2.csvpost 1,link1.compost 2,link2.net Now I know the where, can someone explain the why? Thanks Dutch & TJ!! for providing original code. So the next challenge would be how to multi thread the "post" themselves. Say I have 1000 post. Would I just do this Whole setup in a define where my list 2 define command is? What is a good way to do this? In shared browser insread of in new browser would be a start...How would you do it? Hope this helps the rest of you!! it sure as @%&^%!! made my day when I got this... TC Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 20, 2013 Report Share Posted May 20, 2013 Ok, thats all fine and dandy if list 2 equals list 1. Back to the drawing board. In the list2 define I want to loop thru list total of list 2...I'm exceeding the list again and it is just posting the first item it that list. So, now where do I put the set list position and clear list? list2.csvpost 1,link1.compost 2,link2.netpost 3,link3.orgpost 4,link4.mobipost 5,link5.info it just continues posting "post 1,link1.com" errrghhh!! Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 21, 2013 Report Share Posted May 21, 2013 Ok well, I think I did it. Not sure how it works but it works for the moment. I might have extra something in there that may not need to be, but seems to be working. define list2 commands { set(#list2 pos, 0, "Local") loop($list total(%List2)) { set list position(%List2, #list2 pos) set(#list2 next item, $next list item(%List2), "Local") add list to list(%local break down list2, $list from text(#list2 next item, ","), "Don\'t Delete", "Local") set(#post, $list item(%local break down list2, 0), "Local") set(#link, $list item(%local break down list2, 1), "Local") navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") wait for element(<innertext="Fake account creation form:">, "", "Appear") type text(<about me textarea>, "{#post} {#link}", "Standard") wait(1) increment(#list2 pos) clear list(%local break down list2) }} Any thoughts? TC 1 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted May 21, 2013 Author Report Share Posted May 21, 2013 thats the correct way.. i also when using tables i dont create a table from file, i do a list and then break it down local with a comma delimiter so that i can use the data easier local then having to deal with a variable for my row Quote Link to post Share on other sites
earthlingj 13 Posted May 22, 2013 Report Share Posted May 22, 2013 anyone having an issue with this where threads arent opening back up? for example.. im starting with 50 threads.. and after an hour if i check.. only like 10 threads will be running Quote Link to post Share on other sites
malefic 48 Posted May 22, 2013 Report Share Posted May 22, 2013 LOL, wish I had a machine capable of running 50 threads!I haven't had any problems with 15 threads running for a long time - saying that I am using TJs free memory plugin that may help I guess. Quote Link to post Share on other sites
earthlingj 13 Posted May 22, 2013 Report Share Posted May 22, 2013 ughh this is driving me crazyyyy. yeah my machine can handle that, but its not using that many. or it does at first... but then they die down until im down to only a few threads.. 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.