Ant 1 Posted April 30, 2013 Report Share Posted April 30, 2013 Hey, I am trying to expand a simple bot I was making (just a whois site pinger) to be multi threaded. I used LoWrIdErTJ's example found here and tried to include my code but I can't get it to work properly. Basically I am not sure how to get it so that each thread takes the next url from my table. At the moment the same URL opens in each browser, and then it moves onto the next url and opens that in all the threads/browsers. I think It has to do with my var set(#currentURL, $replace($table cell(&sites, #tablerow, 0), "[YOURDOMAIN.COM]", "mywebsite.com"), "Local") I am not sure I am putting it in the right place. Anyone any ideas? ui drop down("Thread Count", "2,3,4,5,6,7,8,9,10", #num threads) ui stat monitor("Number Created", #num created) ui stat monitor("URL", #currentURL) allow images("No") allow flash("No") allow javascript("No") allow popups("No") allow css("No") ui stat monitor("Site Number", #tablerow) create table from file("C:\\Users\\Ant\\Desktop\\Ubot\\seopinger\\sites.txt", &sites) set(#tablerow, 0, "Global") set(#num created, 0, "Global") set(#used threads, 0, "Global") loop($table total rows(&sites)) { loop while($comparison(#used threads, ">=", #num threads)) { wait(1) } set(#currentURL, $replace($table cell(&sites, #tablerow, 0), "[YOURDOMAIN.COM]", "mywebsite.com.com"), "Local") increment(#tablerow) 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) wait(5) } } } define registration code here { if($comparison(#num created, "<", $table total rows(&sites))) { then { navigate(#currentURL, "Wait") } else { } } } Quote Link to post Share on other sites
kev123 132 Posted April 30, 2013 Report Share Posted April 30, 2013 hi ant not had chance to have a proper look at your code(not at my desk) but the first thing that jumps out is your setting #currentURL in a loop which isn't in a define thus it will never be local and work in multithread. I would suggest moving into the define you have called "registration code here" try that and when i'm back at my desk if it doesn't work i'll take a proper look. something worth noting is local variable need to be in a define and they will only be visible within that define. Quote Link to post Share on other sites
nuc63 27 Posted April 30, 2013 Report Share Posted April 30, 2013 I have programmed a sample for you. You will have to edit the location of urls.txt and results.txt urls.txt is 5 sample urlsmultithread.uboturls.txt Quote Link to post Share on other sites
Pete 121 Posted May 1, 2013 Report Share Posted May 1, 2013 Both of you should go back multi threaded example study and understand it before implementing it.Or better still find the one posted by EddieUnless you understand it and how to control it your bots will have no end of problems 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.