Jump to content
UBot Underground

Multithread bot question.


Recommended Posts

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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!

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

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.post-1758-0-06946300-1322787073_thumb.jpg

 

-Eric

Link to post
Share on other sites

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...

Link to post
Share on other sites

Hi John,

 

Please see attached screenshot.

 

post-1758-0-99210500-1322858279_thumb.jpg (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

Link to post
Share on other sites

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

Link to post
Share on other sites

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...