Jump to content
UBot Underground

Multi Threading Help


Recommended Posts

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 {
        }
    }
}

 

 

Link to post
Share on other sites

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.

Link to post
Share on other sites

Both of you should go back multi threaded example study and understand it before implementing it.
Or better still find the one posted by Eddie
Unless you understand it and how to control it your bots will have no end of problems

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