kev123 132 Posted June 14, 2015 Author Report Share Posted June 14, 2015 comment("add some sites to list just for example") clear list(%urls) add item to list(%urls,"http://www.ubotstudio.com","Delete","Global") add item to list(%urls,"http://www.bing.com","Delete","Global") add item to list(%urls,"http://www.ebay.com","Delete","Global") add item to list(%urls,"http://www.stackoverflow.com","Delete","Global") divider comment("add proxies as a list here") plugin command("Smartthreads.dll", "Thread control Add proxys", "10.1.1.1:80 10.2.2.2.2:80 etc", "Basic List", "") plugin command("Smartthreads.dll", "Thread control normal", "Test", $list total(%urls), 3, "Yes") define Test(#pos, #proxy) { set(#result,$plugin function("HTTP post.dll", "$http get", $list item(%urls,#pos), $plugin function("HTTP post.dll", "$http useragent string", "Random"), "", #proxy, 10),"Local") comment("SCRAPE THE PAGE TITLE") alert($find regular expression(#result,"\\<title\\b[^>]*\\>\\s*(?<Title>[\\s\\S]*?)\\</title\\>")) } basic example using proxies Quote Link to post Share on other sites
Black Automation 20 Posted June 14, 2015 Report Share Posted June 14, 2015 so can we use multiple defines inside each other?example: (below does not work obviously, just an example. Just wanted to know if we could use defines inside defines, just to keep code easy to edit) clear list(%urls) add item to list(%urls,"http://www.ubotstudio.com","Delete","Global") add item to list(%urls,"http://www.bing.com","Delete","Global") add item to list(%urls,"http://www.ebay.com","Delete","Global") add item to list(%urls,"http://www.stackoverflow.com","Delete","Global") divider plugin command("Smartthreads.dll", "Thread control normal", "Test", $list total(%urls), 3, "No") define Test(#pos) { set(#result,$plugin function("HTTP post.dll", "$http get", $list item(%urls,#pos), $plugin function("HTTP post.dll", "$http useragent string", "Random"), "", "", 10),"Local") comment("SCRAPE THE PAGE TITLE") alert($find regular expression(#result,"\\<title\\b[^>]*\\>\\s*(?<Title>[\\s\\S]*?)\\</title\\>")) newdefine() } define newdefine { add item to list(%newlist, $find regular expression(#result, "\\<title\\b[^>]*\\>\\s*(?<Title>[\\s\\S]*?)\\</title\\>"), "Delete", "Global") } Quote Link to post Share on other sites
kev123 132 Posted June 14, 2015 Author Report Share Posted June 14, 2015 define newdefine(#result) { alert($find regular expression(#result,"\\<title\\b[^>]*\\>\\s*(?<Title>[\\s\\S]*?)\\</title\\>")) } yes you can use a define inside just like normal way in ubot. Keep in mind it behaves the same way ubot defines work where local variables are local to that define only in your example the second define would need to look like this. and edit the first define to pass #result in. Quote Link to post Share on other sites
Black Automation 20 Posted June 14, 2015 Report Share Posted June 14, 2015 Thanks for the quick reply Kev, One other question, is it possible to add a predefined list to the proxy function of your plugin?Sorry, I've had your plugin for a while, just now trying to add it to some bots.BTW.. your plugin is great, really speeds things up. Quote Link to post Share on other sites
kev123 132 Posted June 14, 2015 Author Report Share Posted June 14, 2015 yeah just drop the list in like %proxylist in the proxy box. 1 Quote Link to post Share on other sites
SaHiN 14 Posted June 14, 2015 Report Share Posted June 14, 2015 Thank you kev Quote Link to post Share on other sites
SaHiN 14 Posted June 15, 2015 Report Share Posted June 15, 2015 Bug : http://i.imgur.com/7We9Ung.png Loop 10, Threads 5 Test 1 : result 10Test 2 : result 9Test 3 : result 10Test 4 : result 9Test 5 : result 10Test 6 : result 9 result 10-9-10-9-10-9 Quote Link to post Share on other sites
kev123 132 Posted June 15, 2015 Author Report Share Posted June 15, 2015 Sahin The issue isn't with the plugin. ubots add item to list isn't thread safe. If you require high performance lists use my large date free plugin. thankskev123 Quote Link to post Share on other sites
jamesfar 15 Posted July 22, 2015 Report Share Posted July 22, 2015 My question : 1. What if i want to attach the proxy to an account. I mean the proxies is on the database attached to each account. Database using sqlite2. If i use smartthread plugin with bigtable plugin will the multithread safe threads? Thanks Quote Link to post Share on other sites
kev123 132 Posted July 22, 2015 Author Report Share Posted July 22, 2015 Hi 1. You wouldn't use the plugins internal proxy control for this. But you could read accounts from within the thread define or read them all back as one and they pass them as a list to the plugin command such as username:password:proxy:port:proxypass and then splithow do you do it now with normal threads? it should be the similar. 2. Yes this would be fine for the commands that require thread safety such as add to list etc. thankskev123 Quote Link to post Share on other sites
jamesfar 15 Posted July 22, 2015 Report Share Posted July 22, 2015 Hi 1. You wouldn't use the plugins internal proxy control for this. But you could read accounts from within the thread define or read them all back as one and they pass them as a list to the plugin command such as username:password:proxy:port:proxypass and then splithow do you do it now with normal threads? it should be the similar. 2. Yes this would be fine for the commands that require thread safety such as add to list etc. thankskev123First i attach a username from sqlite then attach other attribute (password,proxy,etc) of that username. So i don't use list for username. i prefer sqlite as database as it is easier to updating the data Can smartthread plugin work together with sqlite like i describe above? Quote Link to post Share on other sites
kev123 132 Posted July 22, 2015 Author Report Share Posted July 22, 2015 so if I understand correctly you have a database row that has username in a column , password in other etc. If you read these as and when you need them from the SQLite DB then if the SQLite commands work ok in normal ubot threads they will work ok with the plugin. if you read them out before creating the thread to work with this plugin you would have to read them all out at once and pass in a list to the plugin in the format I showed on my previous post. The thread controller would then pass each list item to a new thread. thanksKev123 Quote Link to post Share on other sites
kev123 132 Posted July 22, 2015 Author Report Share Posted July 22, 2015 also this plugin will still only be able to go to the maximum number of threads that you currently achieve with normal ubot threads can.it just does it faster and easier code. thankskev123 Quote Link to post Share on other sites
jamesfar 15 Posted July 22, 2015 Report Share Posted July 22, 2015 still confuse but i will try to read the whole post in this thread Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 Where did i do wrong here ... ? Issue :1. Stop Button not stopping the threads.2. The inner loop that create #SubDB is not looping3. The loop after all threads finished is not running4. Data missing in the database (If i run using lazy botters it runs perfectly) All 3 files here : 1. MULTITHREADING TEMPLATE KEV 123.ubot : http://www.mediafire.com/download/dirccloob25ylsw/MULTITHREADING_TEMPLATE_KEV_123.ubot2. MULTITHREADING TEMPLATE LAZY BOTTER.ubot : http://www.mediafire.com/download/3jatzg4tejj6dzd/MULTITHREADING_TEMPLATE_LAZY_BOTTER.ubot3. test.db : http://www.mediafire.com/download/gsr1ysyghtyab6f/test.db Spec :- Win 7 64 bit- 32 GB RAM- Ubot 5.7.1MULTITHREADING TEMPLATE KEV 123.ubot Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 have you got script errors disabled? straight away it brings up a script error "can't convert for interger to string" there seems to be a error somewhere with your code. The thread code seems ok though except that you aren't setting max threads you allowing it to max at what ever the list size is. Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 ok after checking it appears that the "count from data" SQLite query returns nothing. Are you sure the SQLite plugin can be used like this in threads the other example you sent didn't lazybotters didn't include any SQLite. Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 The thread code seems ok though except that you aren't setting max threads you allowing it to max at what ever the list size is.Since the process is a long process so the threads will be maxed out that is why i want to test with maxed out total threads running ok after checking it appears that the "count from data" SQLite query returns nothing. Are you sure the SQLite plugin can be used like this in threads the other example you sent didn't lazybotters didn't include any SQLite.Sorry wrong ubot file for lazy botter version. Here is the right version and include sqlite command in it and execute perfectly : http://www.mediafire.com/download/tfxv8yh68q15hcy/MULTITHREADING_TEMPLATE_FIXXX.ubot It has the same sqlite query on both version. So if in lazy botter's version works ok then it should works on smartthread version. right? Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 set(#Akun,$plugin function("SQLlite.dll", "$sqlite data reader", #DB, "select akun from akun where status is NULL order by random() limit 1;"),"Local") it looks to be that the above command is causing the DB to lock. this may be because the smarthread is faster and i'm not sure if aymen designed the sqlite plugin to be used like this. The whole point of the smarthread is it allows you to Q threads with there desired parameters. it would be better read all details into a list beforehand and pass them into the thread it also means it will be faster i'll post a example in a following post below. thankskev123 Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 comment("you would replace this with your code to read accounts you want to process. The smarthread will Q them and can handle very large lists") comment("for better memory control use large data plugin") add list to list(%listofaccounts,$list from text("account1 account2 account3 account4 account5 account6 account7 account8 account9 account10 account11 acccount12",$new line),"Delete","Global") comment("___________________________________________________________") divider set(#maxthreads,10,"Global") plugin command("Smartthreads.dll", "Threadcontrol Advanced initial", #maxthreads) plugin command("Smartthreads.dll", "Thread control Advanced add", "test", "List", %listofaccounts, "No") plugin command("Smartthreads.dll", "Thread control Advanced finish wait") define test(#row, #account) { alert(#account) } please see code for example Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 I tried your codes and add my data into it but got only 1 result and seems the #row not increasing clear all datacomment("you would replace this with your code to read accounts you want to process. The smarthread will Q them and can handle very large lists")comment("for better memory control use large data plugin")ui button("Stop") { plugin command("Smartthreads.dll", "Smart thread stop")}set(#DB,"D:\\TEMP-DEL\\test.db","Global")plugin command("Bigtable.dll", "Clear all large list")plugin command("Bigtable.dll", "large List from text", "Akun", $plugin function("SQLlite.dll", "$sqlite data reader", #DB, "select akun from akun;"), $new line, "replace")set(#ListTotal,$plugin function("Bigtable.dll", "Large list total", "Akun"),"Global")comment("___________________________________________________________")dividerset(#maxthreads,#ListTotal,"Global")plugin command("Smartthreads.dll", "Threadcontrol Advanced initial", #maxthreads)plugin command("Smartthreads.dll", "Thread control Advanced add", "test", "List", "Akun", "No")plugin command("Smartthreads.dll", "Thread control Advanced finish wait")define test(#row, #account) { set(#account,$plugin function("Bigtable.dll", "Large list item", "Akun", #row),"Local") add item to list(%Result,#account,"Don\'t Delete","Global")} What did i do wrong? Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 this one works but never got the same amount between source and result source = 100result < 100 clear all datacomment("you would replace this with your code to read accounts you want to process. The smarthread will Q them and can handle very large lists")comment("for better memory control use large data plugin")ui button("Stop") { plugin command("Smartthreads.dll", "Smart thread stop")}set(#DB,"D:\\TEMP-DEL\\test.db","Global")loop(0) { plugin command("Bigtable.dll", "Clear all large list") plugin command("Bigtable.dll", "large List from text", "Akun", $plugin function("SQLlite.dll", "$sqlite data reader", #DB, "select akun from akun;"), $new line, "replace")}add list to list(%Akun,$list from text($plugin function("SQLlite.dll", "$sqlite data reader", #DB, "select akun from akun;"),""),"Delete","Global")comment("___________________________________________________________")dividerset(#maxthreads,$list total(%Akun),"Global")plugin command("Smartthreads.dll", "Threadcontrol Advanced initial", #maxthreads)plugin command("Smartthreads.dll", "Thread control Advanced add", "test", "List", %Akun, "No")plugin command("Smartthreads.dll", "Thread control Advanced finish wait")define test(#row, #account) { add item to list(%Result,#account,"Don\'t Delete","Global")} Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 add item to list(%Result,#account,"Don\'t Delete","Global") the problem with your first example as you didn't you needed to use large list return. instead you just put the name of the list. The above code isn't thread safe, also it probably would cause issues with the large data plugin as what your trying to do is instantly add all items to the list now you know how touse the plugin try integrating into real world example Quote Link to post Share on other sites
jamesfar 15 Posted July 23, 2015 Report Share Posted July 23, 2015 add item to list(%Result,#account,"Don\'t Delete","Global")the problem with your first example as you didn't you needed to use large list return. instead you just put the name of the list. The above code isn't thread safe, also it probably would cause issues with the large data plugin as what your trying to do is instantly add all items to the list now you know how touse the plugin try integrating into real world exampleSorry i did not understand I try this : clear all datacomment("you would replace this with your code to read accounts you want to process. The smarthread will Q them and can handle very large lists")comment("for better memory control use large data plugin")ui button("Stop") { plugin command("Smartthreads.dll", "Smart thread stop")}set(#DB,"D:\\TEMP-DEL\\test.db","Global")plugin command("Bigtable.dll", "Clear all large list")plugin command("Bigtable.dll", "large List from text", "Akun", $plugin function("SQLlite.dll", "$sqlite data reader", #DB, "select akun from akun;"), $new line, "replace")comment("___________________________________________________________")dividerset(#maxthreads,$plugin function("Bigtable.dll", "Large list total", "Akun"),"Global")plugin command("Smartthreads.dll", "Threadcontrol Advanced initial", #maxthreads)plugin command("Smartthreads.dll", "Thread control Advanced add", "test", "List", "Akun", "No")plugin command("Smartthreads.dll", "Thread control Advanced finish wait")define test(#row, #account) { alert(#account)} Result :- Only 1 loop- Alert : Akun What did i do wrong here? Quote Link to post Share on other sites
kev123 132 Posted July 23, 2015 Author Report Share Posted July 23, 2015 plugin command("Smartthreads.dll", "Thread control Advanced add", "test", "List", "Akun", "No") What I said in previous post akun is a string. all your passing to the thread control is a string. you need to use the "large list return" command in its place. recommend looking at the large data plugin thread and examples that come with it. thankskev123 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.