Thread Docta Framework Pro Edition

UBot Studio

Advanced Threading


Thread Docta

Threading Framework

Editions it can be used with: Pro and Developer Only

Although this code does not have any Python in it for the sake of Pro users of UBot Studio this style of threading I call “Thread Docta” was inspired by Python 3’s asyncio package. It’s not nearly as complex but I fear almost just as power full. Thread Docta solves many of the same issues as asyncio yet it’s simplicity has enabled me to make this Framework for UBot users to enjoy multiprocessing with ease. You will learn to thread most of your code within minutes.

In this download there are several examples that show some of the most common ways to do web automation with multiprocessing.

  1. Downloading user data and “Posting” it to submit forms.

  2. Scraping data from the web.

  3. Loading a file and filling in forms.

  4. Processing desktop data.

Pretty much all you have to do is create your code for the desired page and put it in the “Custom Code” tab and hit run!

What makes “Thread Docta” so special is there is no need for thread/file locks. There’s no need for counters or thread safe incrementing! All those things can create more issues and definitely a lot more code. Thread Docta Pro Edition uses 4 free plugins.

  1. Large data – for dynamic list

  2. Advanced files – file counts

  3. Diagnostic – timer

  4. Advanced shell – to delete a folder

The plugins are for the sake of Pro UBot Edition users as they cant use UBot’s Iron Python commands and functions. I am working on the Python version for the Developer Edition which will soon follow and it will remain plugin free. Nothing wrong with plugins as you will see here in this free code framework. However, the more plugins you have the bigger the compiled software.

So in short what Thread Docta does is takes a list of data divides it by how many threads you want to run and splits the list evenly across all the threads. Then it spawns a thread with a list of their own. So, if you have a list of 1000 and you want 10 threads each thread will have its own list of 100 items to process. Only 10 threads!? Ya well, spawning threads especially with using a browser is expensive in terms of resources so it is actually more efficient to use less threads. This has been proven with this bot here which uses the same base principles and the core code is almost the same. This is a good case for less is more. Only way to really know is for you to see is to download it now and run the examples at different thread amounts and see for your self. After the threads are all complete the next stop is to combine all the lists into one and save them to file. There is another way to append to file while the software is running and it saves to a file corresponding to the thread name. This is shown in addition to the combining method.

I made this Framework for the UBotter community so others can make faster software in less time and to sell more sources and software in the UBot Store. I certainly hope people use it, learn from it and profit from it!

You will see much of the same code that was presented in the other Boot Camp source codes and a great deal about threading.

This Framework is not exhaustive however, you will need to make some minor adjustments some of the time as I couldn’t possibly account for all use cases. If you do have any issues just ask me in one of the Skype groups, add me on Skype or message me on the UBot forum and I will do the best I can to help you out.

There are 10 custom commands not including the Custom Code commands in which there are 7. The seven are specific to httpbin form poster.

There are also 7 custom functions.

If you have not already downloaded this Threading Framework you can pick it up in my UBot Store, above is the link.

Posted in Thread Docta.