dsc76 6 Posted November 30, 2011 Report Share Posted November 30, 2011 Hello, I am trying to make a multithreaded bot that will also cycle through a list multiple times. For example I have a list of 10 accounts in a .txt file and would like to use 5 threads to login to each account a total of 3 times…in other words cycling through the list total 3 times. When I run the bot attached it seems to open windows totaling the number of threads multiplied by the number of cycles all at one time which is not what I intended. multi thread test.ubot Any feedback is appreciated. Thanks. Quote Link to post Share on other sites
Praney Behl 314 Posted November 30, 2011 Report Share Posted November 30, 2011 I have some multithreading examples in the past you can use the forum search for it, the sample code for it was built around V 3.x but the logic is still the same. Hope it helps. Praney Quote Link to post Share on other sites
dsc76 6 Posted November 30, 2011 Author Report Share Posted November 30, 2011 Hi, I found http://ubotstudio.com/forum/index.php?/topic/5995-multi-tasking-in-ubotstudio-take-it-and-bake-it/ before posting a new thread, but still confused making the logic work in my bot. I could use some additional feedback but thanks for the response and the helpful post. Quote Link to post Share on other sites
JohnB 255 Posted November 30, 2011 Report Share Posted November 30, 2011 This is a basic structure for multithreading in UBot...it can be tweaked to fit your needs. You may want to create the commands in a custom command node and just execute the command in the "in new browser node: http://screencast.com/t/LxRPc86YI4EL John Quote Link to post Share on other sites
dsc76 6 Posted November 30, 2011 Author Report Share Posted November 30, 2011 That should set me in the right direction. Thanks! Quote Link to post Share on other sites
dsc76 6 Posted December 1, 2011 Author Report Share Posted December 1, 2011 Hi, I am still having trouble making this work and keep crashing ubot as a result. I would like to loop through the list usernames.txt with multiple threads and multiple times with each $nextlistitem in a new thread / window. Can someone please take a look and set me in the right direction I am totally stumped! multi thread test.ubot TYVM! Quote Link to post Share on other sites
Praney Behl 314 Posted December 1, 2011 Report Share Posted December 1, 2011 Multithreading is more than just a bot script. Have a look here http://en.m.wikipedia.org/wiki/Thread_(computer_science)#Multithreading Quote Link to post Share on other sites
dsc76 6 Posted December 1, 2011 Author Report Share Posted December 1, 2011 Hi, Thank you for the response Praney. This is an interesting Wiki, but I'm far from a computer scientist and lack the knowledge base to fully understand the concept entirely. I was just hoping for some help getting my script working and perhaps further my understanding how to use the thread feature as it pertains to ubot specifically. Can you or others offer feedback that is more directly related to my issue? Thanks again. Quote Link to post Share on other sites
JohnB 255 Posted December 1, 2011 Report Share Posted December 1, 2011 I get this: http://screencast.com/t/Reh5DnXsa1K John Quote Link to post Share on other sites
dsc76 6 Posted December 1, 2011 Author Report Share Posted December 1, 2011 The Wiki link is broken, you have to tack "#Multithreading" to the end of the url. Quote Link to post Share on other sites
JohnB 255 Posted December 1, 2011 Report Share Posted December 1, 2011 Yeah, I see...I'm not really sure of the relevance here because you can create a multithreaded process in UBot. Have you watched this? http://ubotstudio.com/blog/2011/11/22/multithreading-and-sockets-to-dominate-any-site/ John Quote Link to post Share on other sites
dsc76 6 Posted December 1, 2011 Author Report Share Posted December 1, 2011 John, Yes, I watched that tutorial video and attached what I produced a few posts up. I am not sure where the Wiki came in to play other then a reference. Here is what I have so far. multi thread test.ubot Thanks. Quote Link to post Share on other sites
JohnB 255 Posted December 1, 2011 Report Share Posted December 1, 2011 Ok, first, you have to define the command before running it, so you can just switch those two things. Second, I need to understand your loop while condition a little better...can you explain what condition you are setting up there? Thanks. John Quote Link to post Share on other sites
JohnB 255 Posted December 2, 2011 Report Share Posted December 2, 2011 Disregard that, try this:multi thread test dsc76.ubot Quote Link to post Share on other sites
dsc76 6 Posted December 2, 2011 Author Report Share Posted December 2, 2011 Hi John, “Ok, first, you have to define the command before running it, so you can just switch those two things. “I switched the order of the loop and loopwhile command is that what you are referring to? I want to keep looping though the list username.txt the amount of times set by the #cycle variable. My logic as it pertains to the loopwhile statement is to continue looping while the #counter variable is less than (or less than / equal to) the listtotal of usernames.txt multiplied by the amount of cycles. For example if my username.txt file had 10 usernames and I wanted to fill out the ubot playground form with each name 3 times (once each cycle) that would total 30 form posts. So, when the #counter variable that increments each time a form is submitted reaches 30 it will equal the listtotal of usernames.text multiplied by the number of cycles. And, of course, I want to be able to do this over multiple threads to speed up the process. I think this logic is where the majority of my problem lies but not for certain. Here is the latest bot with the “switch†I believe you were referring to. multi thread test.ubot Thanks for the help I really appreciate it! -Eric Quote Link to post Share on other sites
dsc76 6 Posted December 2, 2011 Author Report Share Posted December 2, 2011 Hi John, Sorry, but I push Play on that script and nothing happens. I waited a fair amount of time for the small browser windows to pop up but they never did. Also, the changes to the script you made do not allow me to specify via UI how many times (cycles) I would like to loop through the username list. Did I miss something? Thanks a bunch!-Eric Quote Link to post Share on other sites
JohnB 255 Posted December 2, 2011 Report Share Posted December 2, 2011 No I set it to three. The switch I was referring was the define command. You had the command to run the custom command before the define container. You need to define it first, and then run it. is the path to your file still correct? It should not be doing nothing... John Quote Link to post Share on other sites
dsc76 6 Posted December 2, 2011 Author Report Share Posted December 2, 2011 John, I now see the cycle loop set to 3 that's a great place to start and I can add a variable no problem thanks. I have been calling the command to run the custom command before the define container with all my bots so thanks for the correction. I double checked all the file paths (Im using special folder) and everything seems in place but the script is setting idol when I push play. See screen shot. -Eric Quote Link to post Share on other sites
JohnB 255 Posted December 2, 2011 Report Share Posted December 2, 2011 Ok, here is the first working version...lol But it only runs through once right now... Oh, I changed it to desktop, so you'll have to change it back if you want.multi thread test dsc76.ubot Quote Link to post Share on other sites
Legend 181 Posted December 2, 2011 Report Share Posted December 2, 2011 Interesting thread... I haven't used any threading before as there still seem to be some bugs with it, but its something I definitely want to use in the future (great video idea there... http://ubotstudio.com/forum/public/style_emoticons/default/cool.gif). I can now see how it all fits into the big picture though... Thanks!! BTW... I get a "You have exceeded the range of the list." Script Error on that last one... Quote Link to post Share on other sites
JohnB 255 Posted December 2, 2011 Report Share Posted December 2, 2011 It seems to run through for me: http://screencast.com/t/j8CGBIXfw But I am no multithreading expert either. John Quote Link to post Share on other sites
Legend 181 Posted December 2, 2011 Report Share Posted December 2, 2011 Weird... http://screencast.com/t/2yteYlXmzo8E http://ubotstudio.com/forum/public/style_emoticons/default/blink.gif Quote Link to post Share on other sites
dsc76 6 Posted December 2, 2011 Author Report Share Posted December 2, 2011 Hi John, Please see attached screenshot. (same issue as screencast by DuaneF in post #22) I downloaded the fresh version you fixed from post #19 and set the thread count at 3 but more than 3 windows opened. Then I got a exceeded the range of the list error. Not sure what is going on... Thanks for all the support-Eric Quote Link to post Share on other sites
JohnB 255 Posted December 2, 2011 Report Share Posted December 2, 2011 If you are still using stat monitors they load first. When loaded, lists and variable are not yet set which is likely causing the erro. Turn off the error option in options, and the bot will run. The number of windows you see is based on the number of threads not the number of cycles. John Quote Link to post Share on other sites
dsc76 6 Posted December 2, 2011 Author Report Share Posted December 2, 2011 Yes, I understand that the number of threads = number of little windows. I turned off the error option as you instructed and the bot ran (not compiled), but the number of windows far exceeded the number of threads imputed to the ui. The number of windows looked more like the listtotal of the usernames.txt which I have populated with ten list items not the 3 threads I specified. Please let me know if more clarification on what I am trying to accomplish would help with the fix. Perhaps there is a simple way to do this that I am missing. I really appreciate all your help. -Eric 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.