Jump to content
UBot Underground

[Sell] Smart Thread Plugin - Easy threading


Recommended Posts

Hi James.

 

I converted the example from the thread you posted.

I also removed some of the stuff that was in the script that is not directly required to get the job done:

 

So here's the ThreadPlugin Version. 

 

Create Lists()

plugin command("Smartthreads.dll""Thread control normal""codeprocedure"$list total(%List1), 5, "No")

define codeprocedure(#counter) {

    add list to list(%local break down$list from text($list item(%List1#counter), ","), "Don\'t Delete""Local")

    set(#VariableA$list item(%local break down, 0), "Local")

    set(#VariableB$list item(%local break down, 1), "Local")

    set(#VariableC$list item(%local break down, 2), "Local")

    add item to list(%recompile"{#VariableB},{#VariableC},{#VariableA}""Don\'t Delete""Global")

}

define Create Lists {

    clear list(%List1)

    clear list(%recompile)

    add list to list(%List1$list from text("A,26,z

B,25,y

C,24,x

D,23,w

E,22,v

F,21,u

G,20,t

H,19,s

I,18,r

J,17,q

K,16,p

L,15,o

M,14,n

N,13,m

O,12,l

P,11,k

Q,10,j

R,9,i

S,8,h

T,7,g

U,6,f

V,5,e

W,4,d

X,3,c

Y,2,b

Z,1,a"$new line), "Don\'t Delete""Global")

}

 

 

Let me know if there are any questions.

 

PS:  Writing to a ubot global list from within threads doesn't work 100% reliable all the time. I highly recommend to use large data plugin for this job.

 

Dan

 

 

Have you try it before posting Dan?

 

Because it produce different result

 

http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/page-2&do=findComment&comment=73972 >>> from 26 source data it produce 26 result. Correct

 

Your code : from 26 source produce only 8 result. Sometimes produce only 25 result. Sometimes produce correct 26 result

 

Here are videos from my screen for the result of your code Dan : http://screencast.com/t/9IpKJwzwcFIE

 

Team Viewer available if you would like to check

 

Please let me know

 

I also try using sqlite plugin as Database storage and when all data processed the threads are not going down. Seems to stuck

Link to post
Share on other sites
  • Replies 185
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi James.   I converted the example from the thread you posted. I also removed some of the stuff that was in the script that is not directly required to get the job done:   So here's the ThreadPlugin

So in general. With multithreading there are a couple of things you should be aware of.   1. Threads are running at the same time. So you can't use global variables to store data.  2. Add data to a gl

Duplicate post. I replied in the ExBrowser Thread.   Dan

Have you try it before posting Dan?

 

Because it produce different result

 

http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/page-2&do=findComment&comment=73972 >>> from 26 source data it produce 26 result. Correct

 

Your code : from 26 source produce only 8 result. Sometimes produce only 25 result. Sometimes produce correct 26 result

 

Please let me know

 

I also try using sqlite plugin as Database storage and when all data processed the threads are not going down. Seems to stuck

 

Real man don't test code! They just run it....

 

Seriously.... you need some background know how to understand this issue. This problem is related to global lists and global variables.

If you try to write or increment them at the same time from multiple threads, you will run into issues. You could call it "they are not thread safe". 

 

So the faster your script / your threads run, there more likely it is that you will see this problem. That is the reason why some people think there is no problem. 

If you run a browser based bot with 5 threads in parallel where each thread needs a couple of seconds to finish, you will not see that issue.

 

But if you scrape 1 Million urls with http plugin then you will know what I mean.

 

So the reason the other script "works" is just because there is some additional stuff in the script. Going through multiple defines, adding some in new browser commands.

Stuff that is not required for what the script is supposed to do. It's just an example.

 

So the reason why it's working is because it executes slower because of the other stuff. But both scripts are just an example of the structure. They are nothing you would use in the real world. 

Sorting list items can be done without threading. 

 

PM me if you have more questions about that topic. Don't want to hijack the thread here.

 

Dan

Link to post
Share on other sites

Real man don't test code! They just run it....

 

Seriously.... you need some background know how to understand this issue. This problem is related to global lists and global variables.

If you try to write or increment them at the same time from multiple threads, you will run into issues. You could call it "they are not thread safe". 

 

So the faster your script / your threads run, there more likely it is that you will see this problem. That is the reason why some people think there is no problem. 

If you run a browser based bot with 5 threads in parallel where each thread needs a couple of seconds to finish, you will not see that issue.

 

But if you scrape 1 Million urls with http plugin then you will know what I mean.

 

So the reason the other script "works" is just because there is some additional stuff in the script. Going through multiple defines, adding some in new browser commands.

Stuff that is not required for what the script is supposed to do. It's just an example.

 

So the reason why it's working is because it executes slower because of the other stuff. But both scripts are just an example of the structure. They are nothing you would use in the real world. 

Sorting list items can be done without threading. 

 

PM me if you have more questions about that topic. Don't want to hijack the thread here.

 

Dan

 

PM Sent Dan

Link to post
Share on other sites

Have you try it before posting Dan?

 

Because it produce different result

 

http://www.ubotstudio.com/forum/index.php?/topic/10042-new-v4-tutorial-multi-threading-example/page-2&do=findComment&comment=73972 >>> from 26 source data it produce 26 result. Correct

 

Your code : from 26 source produce only 8 result. Sometimes produce only 25 result. Sometimes produce correct 26 result

 

Here are videos from my screen for the result of your code Dan : http://screencast.com/t/9IpKJwzwcFIE

 

Team Viewer available if you would like to check

 

Please let me know

 

I also try using sqlite plugin as Database storage and when all data processed the threads are not going down. Seems to stuck

just use the large table plugin it was built to fix this issue with ubot normal lists

Link to post
Share on other sites

Feature Request:

 

There is one thing I currently can't do with the plugin. Breakdown a large list and run commands in between threads.

 

So let's say I have a list with 1Million urls. No the smartthread plugin can loop through that list perfectly. 

But if I want to do something every 5000 or every 5000 threads, I can't do that. 

 

So I would like to have an optionfor standard and advanced mode:

run in between define

run every N threads

finish all threads before run (YES/NO).  

 

So I set that to 500 and select YES.

The plugin should run 500 threads. Waits until all of them are finished. Then execute the in between define. 

Then run the next 500 threads. 

 

If finish is set to NO, the plugin would just launch the in between define as a regular thread every 500 threads. 

This could be used to update statmons for example or write to log files and so on.

 

That's really the only thing I'm currently missing. Other than that the plugin is a real time saver!!!

 

Thanks for making it available.

Dan

Link to post
Share on other sites

Little TIP:

 

If you want to update a statmon, you could run that in a separated thread:

 

define UpdateStatmon {
    loop while($comparison($plugin function("Bigtable.dll""Large list total""status"), "!="$plugin function("Bigtable.dll""Large list total""orderids"))) {
        set(#status"Extracted {$plugin function("Bigtable.dll""Large list total""status")} from {$plugin function("Bigtable.dll""Large list total""orderids")}""Global")
        wait(1)
    }
}

 

And launch that with advanced thread control:

plugin command("Smartthreads.dll""Thread control Advanced add""UpdateStatmon""Loop Number", 1, "No")

 

And at the beginning of your mean thread you add:

set(#date$plugin function("Bigtable.dll""Large list item""datelist"#counter), "Local")

 

 

You could also update the global variable directly of course. But that's not so clean. Because depending on which thread runs when, the counter might jump up and down sometimes. Which will look a little bit odd for users. Or use an increment. But as you know.. this could miss some increments if the commands runs at the same time. So also not very clean in my easy.  Just if someone says my idea is to complicated :-)

 

Cheers

Dan

Link to post
Share on other sites

Little TIP:

 

If you want to update a statmon, you could run that in a separated thread:

 

define UpdateStatmon {

    loop while($comparison($plugin function("Bigtable.dll""Large list total""status"), "!="$plugin function("Bigtable.dll""Large list total""orderids"))) {

        set(#status"Extracted {$plugin function("Bigtable.dll""Large list total""status")} from {$plugin function("Bigtable.dll""Large list total""orderids")}""Global")

        wait(1)

    }

}

 

And launch that with advanced thread control:

plugin command("Smartthreads.dll""Thread control Advanced add""UpdateStatmon""Loop Number", 1, "No")

 

And at the beginning of your mean thread you add:

set(#date$plugin function("Bigtable.dll""Large list item""datelist"#counter), "Local")

 

 

 

good work not 100% how it all ties together but already have my own ideas.

 

I may add the ability to set threads as backgroundworker basically what this means is the thread/s you set to this status will run until the "main threads" have completed and auto shutdown thus making simple anything like this and ensuring they close

Link to post
Share on other sites

today suddenly i got smartthreads.dll detected as a virus by avira

 

anyone has the same situation ?

 

http://screencast.com/t/7VswnHnVPyh

 

Antivir is the only AV that shows that:

 

So 1 out of 54 AV scanners

https://www.virustotal.com/en/file/b3d02f68b42195721268a665d1ba92e61370c9715372e2f8a27a7ae22b7bf9d3/analysis/1408017485/

 

So I would say: False positive. Add it to the whitelist and you are good to go.

 

Cheers

Dan

Link to post
Share on other sites

Antivir is the only AV that shows that:

 

So 1 out of 54 AV scanners

https://www.virustotal.com/en/file/b3d02f68b42195721268a665d1ba92e61370c9715372e2f8a27a7ae22b7bf9d3/analysis/1408017485/

 

So I would say: False positive. Add it to the whitelist and you are good to go.

 

Cheers

Dan

yes false positive because the plugin is encrypted. Wont cause a issue when bots are compiled or be present.

Link to post
Share on other sites
  • 3 weeks later...

Update 1.1

 

Login to robobest.com to download the latest update (on the right hand side)

use the login credentials you entered on purchase. If you have forgot them use the reset password link.

 

Added:

 

Thread control Items Processed

 

This Gives a number for items processed, best used as part of a progress bar.

example code

ui stat monitor("processed", $plugin function("Smartthreads.dll", "Thread control Items Processed"))
plugin command("Smartthreads.dll", "Thread control normal", "testing", 10, 3, "No")
define testing(#row) {
    in new browser {
        wait(1)
    }
}

Smart thread stop

 

This stops the threading process

 

example code

 

ui button("Start") {
    plugin command("Smartthreads.dll""Thread control normal""testing", 10, 3, "No")
}
ui button("Stop") {
    plugin command("Smartthreads.dll""Smart thread stop")
}
define testing(#row) {
    in new browser {
        wait(1)
    }
}

 

 

 

 

 

Link to post
Share on other sites
  • 2 weeks later...

held off for a while to give everyone a fair chance price now increased.

 

Still a very useful and great plugin. Even for the regular price. Makes threading so much easier. 

I use it in all my bots now.

Dan

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

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