Jump to content
UBot Underground

Yet another newb having trouble multi threading


Recommended Posts

I'm trying to create a simple piece of code (at least that's what I thought) that will navigate to a url and view the page 100 plus times in something like 10 threads to make it fast.

 

I've read TJ's thread listed here: http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/ 50 times and watched the video but I can't figure it out. Ugh...

Link to post
Share on other sites

Hi,

 

This is a simple UBot thread example. Simple in that it just navigates to the sites in the list.

 

Sample code:

clear list(%urls)
add list to list(%urls, $list from text("www.bonitrust.de
www.bookfav.de
www.bookler.de
www.bookmark.raubfische.de
www.bookmark.sitepro.cc
www.bookmark-artikel.net
www.bookmark-clever.de
www.lookday.de
www.markbook.de
www.meine-bookmarks.info
www.membre.de
www.minota.de
www.mybookmarks24.com", $new line), "Delete", "Global")
ui stat monitor("total list", $list total(%urls))
ui stat monitor("urls processed", #urls processed)
ui stat monitor("current thread", #used threads)
set(#threads to run, 3, "Global")
set(#used threads, 0, "Global")
set(#urls processed, 0, "Global")
loop while($comparison($list total(%urls), ">", #urls processed)) {
   loop while($comparison(#used threads, ">=", #threads to run)) {
       wait(1)
   }
   increment(#used threads)
   thread {
       in new browser {
           if($comparison($list position(%urls), "<", $list total(%urls))) {
               then {
                   navigate($next list item(%urls), "Wait")
                   wait for browser event("Everything Loaded", 30)
                   increment(#urls processed)
               }
               else {
               }
           }
           decrement(#used threads)
       }
   }
}

sample-thread-control-001.ubot

 

Kevin

  • Like 1
Link to post
Share on other sites
  • 1 month later...

set to 1 thread it will only open 1 thread in new browser and keep processing so should work without issue..

 

if 1 thread, i would reccomend if your going to multi thread a bot its use is for more then 1 otherwise use the main browser

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