Gogetta 263 Posted February 8, 2011 Report Share Posted February 8, 2011 I really would like to understand how everyone is coding their multi-threaded bots. So the best way seems to be to create a sub and loop it using the thread --> in sub window --> run sub But how on earth do you guys keep your variables and lists from overwriting the data that is being used by another thread? I have tried setting a while loop and waiting for the variable to be cleared before another thread can use it. But all this does is slow the bot down. So please someone explain exactly how this is done. Thanks! Quote Link to post Share on other sites
JohnB 255 Posted February 8, 2011 Report Share Posted February 8, 2011 You should be able to use $next list item as it can't pull the same item twice. John Quote Link to post Share on other sites
UBotBuddy 331 Posted February 8, 2011 Report Share Posted February 8, 2011 I tend to localize my variables to each thread that I am dealing with and I let my Lists be my global variables. I do not do any kind of heavy duty threading so my use is more simplistic. Quote Link to post Share on other sites
panoz 1 Posted March 11, 2011 Report Share Posted March 11, 2011 so the variables will still get mixed up? any solution to this, oppose to having to create some complicated variable name system? The list should stay global since it's more convenient for using the next list item. But is it possible to keep the variables within in thread from interfering with one another? Quote Link to post Share on other sites
JohnB 255 Posted March 11, 2011 Report Share Posted March 11, 2011 Ok, the answer to this question (OP) truly depends on what exactly you are trying to do. If you are navigating through a list of urls and the process on each site is exactly the same thing the solution is a simple one using a loop and a while condition...but again it truly depends on the end goal. John Quote Link to post Share on other sites
Pete 121 Posted March 11, 2011 Report Share Posted March 11, 2011 You should be able to use $next list item as it can't pull the same item twice. I tested this before the last update using a global list of 1000 urlsWith a simple page scrap and if function (if found add current url to list A, Else add the current url to list B.The results where incorrect as the two list did not total 1000 urls at the end (if I remember correct it returned 700 or 800 url in total) The only solution I have found to date is to split the master list and write a unique sub for each thread. With the current commands available it seems we can not keep the variables unique inside a thread/sub/socket when multi threading On a side note I have found using sockets faster but if you don’t have the bandwidth to handle the number of threads you are running after about 2500 urls you start to crash as the while loop and if function fails and the thread count becomes incorrect some times high other times low, to date the best solution I found for this is only use 50% of your bandwidth Quote Link to post Share on other sites
JohnB 255 Posted March 11, 2011 Report Share Posted March 11, 2011 Zap, can you update your profile so we can see your system specs please. What license are you using? What you are describing works perfectly in either sub windows (standard license) and sockets (pro license). But I can't really help until I know what system you're on. John Quote Link to post Share on other sites
Abs* 12 Posted March 12, 2011 Report Share Posted March 12, 2011 I really would like to understand how everyone is coding their multi-threaded bots. So the best way seems to be to create a sub and loop it using the thread --> in sub window --> run sub But how on earth do you guys keep your variables and lists from overwriting the data that is being used by another thread? I have tried setting a while loop and waiting for the variable to be cleared before another thread can use it. But all this does is slow the bot down. So please someone explain exactly how this is done. Thanks! Hi Gogetta - Unfortunatly this is also a issue that I face - Variables are not sticking with the threads and instead getting over written - I have a bot that posts comments to blogs - when it fills out the url and name section of the comment it works from 2 files - one which holds the urls and the other the keywords(names) - its vital that both these match - if not then you will have a mismatch in the url and keyword - So what my bot does is set a variable(RandomPosition) for a random list position out of one of the files - It then uses this variable to select the url and keyword - As the (RandomPosition) gets set at at the start of each loop when a new thread is launched then it changes this position which causes the mismatch - So I then started to pass down the variables as parametors which has helped somewhat - However I still get many mismatches - just to note that the keywords for the url file are placed in a keyword file with the keywords matching the same line - Quote Link to post Share on other sites
JohnB 255 Posted March 12, 2011 Report Share Posted March 12, 2011 Ok...here is a fundamental setup for multithreading using sub windows... This particular script navigates through a list of url's, looks for a keyword, and if it finds it adds the url to another list and ultimately saves the new list to a file. The key to multithreading using subwindows is applying the appropriate delay so the work can process in the sub window (without delays you can watch your subwindows rip off like a machine gun without processing the code correctly). Multithread_in _sub_windows.ubot John Quote Link to post Share on other sites
Enigma 78 Posted March 12, 2011 Report Share Posted March 12, 2011 So is there a problem passing and solving captchas in multithreading (via sockets)? Quote Link to post Share on other sites
JohnB 255 Posted March 12, 2011 Report Share Posted March 12, 2011 Yes, there is...you won't be able to solve captchas in the socket compartment right now. John Quote Link to post Share on other sites
Pete 121 Posted March 12, 2011 Report Share Posted March 12, 2011 Just downloaded your bot john the logic behind the thread control looks much better then how I was doing it as you only rely on the one component to keep track of the threads. Looking forward to testing it Quote Link to post Share on other sites
Enigma 78 Posted March 12, 2011 Report Share Posted March 12, 2011 Yes, there is...you won't be able to solve captchas in the socket compartment right now. John Hmm... that's a nasty handicap.I was thinking that we could finally build real multithreaded account creators, but no. It even doesn't allow to handle JS. So what's the purpose of the socket stuff currently?Only search a few keywords at the same time in SE's? No offense to you personally John Quote Link to post Share on other sites
JohnB 255 Posted March 12, 2011 Report Share Posted March 12, 2011 I'll have to get better details for you, but the way I currently understand it is that technically it can be done but it's very complex. I'll report back as soon as I have better information for you. John Quote Link to post Share on other sites
Enigma 78 Posted March 12, 2011 Report Share Posted March 12, 2011 I'll have to get better details for you, but the way I currently understand it is that technically it can be done but it's very complex. I'll report back as soon as I have better information for you. John Thanks John.Well it must be possible as there are a lot bots coded in .NET language able to do that. Quote Link to post Share on other sites
JohnB 255 Posted March 12, 2011 Report Share Posted March 12, 2011 Yeah. Seth had told me it's possible, but complicated...so I will find out everything I can. Quote Link to post Share on other sites
wizard 0 Posted March 18, 2011 Report Share Posted March 18, 2011 Yeah. Seth had told me it's possible, but complicated...so I will find out everything I can. I'd love to know as well, when you get the chance to update us with information. I just created my first hotmail e-mail creator bot with proxy support and I'm going to try to multi-thread it, so that seems like a let-down if using sockets is the only way to effectively multi-thread. Thanks John. Quote Link to post Share on other sites
JohnB 255 Posted March 18, 2011 Report Share Posted March 18, 2011 You don't have to use sockets to multi-thread your bots wizard. You can use sub windows as well. John Quote Link to post Share on other sites
Enigma 78 Posted March 18, 2011 Report Share Posted March 18, 2011 You don't have to use sockets to multi-thread your bots wizard. You can use sub windows as well. John I won't recommend that John.It will kill system resources as it will popup the total number of threads specified and specially on his PC with < 1GB RAM. Sockets is the best thing, as you can set cookies and IP's for each threat. So in theory if you have 100 proxies you should be able to create 100 accounts on a site at the same time.But that is just a dream with uBot.It does not work as we're not able to use Javascript and pass Captcha's trough the sockets in uBot. So to me the current sockets feature in uBot is still useless, as i don't need to multithread Google searches. Quote Link to post Share on other sites
JohnB 255 Posted March 18, 2011 Report Share Posted March 18, 2011 That is true. I was just saying that sockets is not the only option for multithreading. Quote Link to post Share on other sites
Abs* 12 Posted March 18, 2011 Report Share Posted March 18, 2011 Yup - I dont use the sockets either as it limits us to what we can do - As you noted captchas do not work - also choosing from drop down menus do not work Quote Link to post Share on other sites
Enigma 78 Posted March 18, 2011 Report Share Posted March 18, 2011 Yup - I dont use the sockets either as it limits us to what we can do - As you noted captchas do not work - also choosing from drop down menus do not work So the current sockets and multithread feature is complete useless for people (like me) who want to mass create accounts. Quote Link to post Share on other sites
Abs* 12 Posted March 18, 2011 Report Share Posted March 18, 2011 Yup - Im actually waiting to see what John comes back with - He noted that he will be speaking to Seth about the captcha issues Also I had bene playing with google - and it just wouldnt work for me in the sockets command - so then I started to write to browser to ensure all coding was correct - To my surprise - the link codes that need scraping are different to when not using the socket command not sure if you have noticed this or not - I have only noticed this on Google thanks 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.