Jump to content
UBot Underground

Multi-Threading With Ubot Studio Open


Recommended Posts

Hi guys I completed my first bot :D

now I have this need:
 
I have to run the code directly in ubot on 3 different pages (I want to select this page manually):
 
site/page1
site/page2
site/page3
 
i have try whit this code
loop(3) {
    thread {
        in new browser {
            navigate("http://www.site.com/", "Wait")
            navigate("http://www.site.com/1", "Wait")
            navigate("http://www.site.com/3", "Wait")
        }
    }
}

 

Once loaded though these pages disappear......
 
Basically I want these pages remain active
so when run the bot, can work in multi-threading on all 3 pages
 
Thanks

 

Link to post
Share on other sites

You are loading three pages, one after the other, in a single thread, in a single browser, so it is acting just as it should.

 

If you want them to load separately, each link in a separate thread in a separate browser, you need to put them, one by one, in a separate thread (so you code 3 threads there, not only one, like you did now)

 

If you want to write this even smarter, you store the URLs to navigate in a list, you build a define that navigates to the URL you feed to it as a parameter, then you LOOP n times through the list of URLs and code the instructions within the LOOP to open a new thread and a new browser (like you already coded) BUT you write the DEFINE calling only once, using the current list item as parameter...

 

If you are new to UBS, the above may seem to be a bit complicated.

 

So start by simply doing what I said for ONE single thread first:  code the navigation in a DEFINE and call that define inside a loop with 1 iteration, using a parameter (variable) that contains the link, and not the link itself directly.

 

Once you achieved that, you'll be prepared to do it as you want (multithreading)

 

Cheers!

  • Like 1
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...