thezillionaire 2 Posted March 13, 2014 Report Share Posted March 13, 2014 Hello Aymen, Can you tell me a little about how to use the Local List from text and Local list from file. Is that to be used so that you can pull from 1 text file and use for multiple tasks at the same time without confusing ubot? Im still a little new to all this so please be easy on me, lol. Thanks in advance for any help. Quote Link to post Share on other sites
Aymen 385 Posted March 14, 2014 Author Report Share Posted March 14, 2014 It's like Ubot's List from text function but for local usage (data available per thread only) Quote Link to post Share on other sites
Bot-Factory 602 Posted April 11, 2014 Report Share Posted April 11, 2014 I have a little understanding problem. As I understood it, this plugin is a replacement for the local variables. Because they have some issues when multi threading. That data get's shared between threads? So instead of a local variable I use local directory right? So now here's the part where I struggle. in the video Aymen says, that if we use HTTP get, we should put it into a local variable first and then put that local variable into a local directory?So if there is a problem with local variables overlapping between threads, then we will see the same issue here? Or is this only relevant if I'm doing something with a local variable within a thread which takes more time? Thanks in advance for your helpDan Quote Link to post Share on other sites
Aymen 385 Posted April 12, 2014 Author Report Share Posted April 12, 2014 we should put it into a local variable first and then put that local variable into a local directory?you should use the $http get/post in a set command (local or global doesn't matter) , then use the $http last response function to get the latest http response instead of the variable Quote Link to post Share on other sites
Bot-Factory 602 Posted April 12, 2014 Report Share Posted April 12, 2014 you should use the $http get/post in a set command (local or global doesn't matter) , then use the $http last response function to get the latest http response instead of the variableAh ok. So it wouldn't matter if the variable would be overwritten in the meantime because we are using "last response" to load the data and store it in the local dictionary. Ok got it. And I probably should use a http container within a thread right? Or is that only necessary for sites where I do login / cookie stuff? Dan Quote Link to post Share on other sites
Aymen 385 Posted April 13, 2014 Author Report Share Posted April 13, 2014 Ah ok. So it wouldn't matter if the variable would be overwritten in the meantime because we are using "last response" to load the data and store it in the local dictionary. Ok got it. And I probably should use a http container within a thread right? Or is that only necessary for sites where I do login / cookie stuff? Dan yes its better to use a http container (though in some cases you won't have to ) Quote Link to post Share on other sites
Bot-Factory 602 Posted April 15, 2014 Report Share Posted April 15, 2014 Does someone has a test script. Where it's clearly visible that the normal local variables / lists / tables get messed up?Would like to demonstrate / see that if possible. @Aymen: Do you know if that problem still exists in V5? Thanks in advance for your helpDan Quote Link to post Share on other sites
kev123 132 Posted April 15, 2014 Report Share Posted April 15, 2014 Dan I think its just variables that get messed up. The addition of table and list in local dic was for size purposes and the fact there's no local table. Quote Link to post Share on other sites
Bot-Factory 602 Posted April 15, 2014 Report Share Posted April 15, 2014 Dan I think its just variables that get messed up. The addition of table and list in local dic was for size purposes and the fact there's no local table.Yeah, the local list is very helpful. I'm currently changing one of my web scrapers to use that. I had some memory and performance issues with global list when they got over 500k entries. So now I use local lists and write directly to a database. At least that's the idea. Not quite finished yet. Do you know how the variable mess up could be simulated?Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted April 15, 2014 Report Share Posted April 15, 2014 Idea for next release: Local List - Option to remove duplicatestext from local list local list from text - should not import empty lines. The normal ubot function will only import lines with text.Ubot reports 2 list items. The plugin reports 3 list items for the same text Example:plugin command("LocalDictionary.dll", "init local dictionary")plugin command("LocalDictionary.dll", "init local list")clear list(%tmp)set(#aa, "testtest2", "Global")add list to list(%tmp, $list from text(#aa, $new line), "Don\'t Delete", "Global")alert($list total(%tmp))plugin command("LocalDictionary.dll", "local list from text", "test", #aa, $new line)alert($plugin function("LocalDictionary.dll", "$local list total", "test")) Thanks for considering thisDan Quote Link to post Share on other sites
kev123 132 Posted April 15, 2014 Report Share Posted April 15, 2014 it first came to light with the http plugin initially aymen thought it was a cookie issue and for a long time did a lot of work to get round sessions being shared. It was eventually found out it was the local variables sharing data. Now i'm not sure if this is only when you set a variable from a plugin function I haven't tested it enough. This plugin is great though and fixes the problem Quote Link to post Share on other sites
Aymen 385 Posted April 15, 2014 Author Report Share Posted April 15, 2014 Idea for next release: Local List - Option to remove duplicatestext from local list local list from text - should not import empty lines. The normal ubot function will only import lines with text.Ubot reports 2 list items. The plugin reports 3 list items for the same text Example:plugin command("LocalDictionary.dll", "init local dictionary")plugin command("LocalDictionary.dll", "init local list")clear list(%tmp)set(#aa, "testtest2", "Global")add list to list(%tmp, $list from text(#aa, $new line), "Don\'t Delete", "Global")alert($list total(%tmp))plugin command("LocalDictionary.dll", "local list from text", "test", #aa, $new line)alert($plugin function("LocalDictionary.dll", "$local list total", "test")) Thanks for considering thisDan Sure,I'm very busy these days!Hopefully next week i can make couple of plugins updates! Regards, Quote Link to post Share on other sites
Bot-Factory 602 Posted April 15, 2014 Report Share Posted April 15, 2014 Sure,I'm very busy these days!Hopefully next week i can make couple of plugins updates! Regards,Awesome! I will send you a short summary via PM. Dan Quote Link to post Share on other sites
Bot-Factory 602 Posted April 16, 2014 Report Share Posted April 16, 2014 Could someone please explain what the "thread container command" exactly does? ThanksDan Quote Link to post Share on other sites
kev123 132 Posted April 17, 2014 Report Share Posted April 17, 2014 for manual captcha popups dan as ubots isn't the right type Quote Link to post Share on other sites
jamesfar 15 Posted April 20, 2014 Report Share Posted April 20, 2014 How do we clear local list and local table? Please help Quote Link to post Share on other sites
Bot-Factory 602 Posted April 20, 2014 Report Share Posted April 20, 2014 How do we clear local list and local table? Please helpInitialize it again. And they clear automatically when the thread is closed. Dan Quote Link to post Share on other sites
jamesfar 15 Posted April 20, 2014 Report Share Posted April 20, 2014 Initialize it again. And they clear automatically when the thread is closed. Dan What i meant is clear local list/table inside a loop. And the loop is inside the thread If i use initialize then it would clear globally? or it would clear locally? And how you debug using local plugin? Please help Quote Link to post Share on other sites
Aymen 385 Posted April 20, 2014 Author Report Share Posted April 20, 2014 What i meant is clear local list/table inside a loop. And the loop is inside the thread If i use initialize then it would clear globally? or it would clear locally? And how you debug using local plugin? Please help there is a lot of features still missing in the local table/lists for sure!soon i'll add more features + fix more bugs and make this much easier to use Quote Link to post Share on other sites
Bot-Factory 602 Posted April 30, 2014 Report Share Posted April 30, 2014 Could someone please explain why I need the thread container? thread { plugin command("LocalDictionary.dll", "thread container") { set(#capcha d, $plugin function("HTTP post.dll", "$http captcha dialog", "C:\\Program Files (x86)\\Captcha SniperX402\\captchas\\typeu45\\captcha.png"), "Global") }} Couldn't I just use:thread { plugin command("LocalDictionary.dll", "local dictionary add", "captcha", $plugin function("HTTP post.dll", "$http captcha dialog", "C:\\Program Files (x86)\\Captcha SniperX402\\captchas\\typeu45\\captcha.png"))} Dan Quote Link to post Share on other sites
kev123 132 Posted April 30, 2014 Report Share Posted April 30, 2014 its to do with ubot threads aren't setup with the stathread attribute something needed to communicate with COM components. Something dialogs use. Quote Link to post Share on other sites
Bot-Factory 602 Posted April 30, 2014 Report Share Posted April 30, 2014 its to do with ubot threads aren't setup with the stathread attribute something needed to communicate with COM components. Something dialogs use.Ah ok. Because it's a user dialog window. Ok understand. Thanks a lot! Quote Link to post Share on other sites
Bot-Factory 602 Posted April 30, 2014 Report Share Posted April 30, 2014 I still try to understand and identify the issue with local variables and threads. So far I'm not able to reproduce that. I wrote a little test script today. Which is using http get to download some files. Each file contains a number. From 0-10So the script is looping through those files. And then it starts over. With a total of 10000 downloads. I haven't had a single issues. The numbers are always in the exact order from 0-10.... 10000 times. ui drop down("Loops:", "10,100,200,300,400,500,600,700,800,900,1000,2000,5000,10000", #Loops)ui stat monitor("Open Threads:", #thread count)ui stat monitor("Total:", $table total rows(&numbers))clear table(&numbers)set(#thread count, $plugin function("Threads Counter.dll", "threads counter", "reset"), "Global")set(#loopcounter, 0, "Global")set(#fileloop, 0, "Global")loop(#Loops) { loop while($comparison($plugin function("Threads Counter.dll", "threads counter", "read"), ">=", 50)) { wait(0.25) } set(#thread count, $plugin function("Threads Counter.dll", "threads counter", "increment"), "Global") test threads(#fileloop, #loopcounter) increment(#loopcounter) if($comparison(#fileloop, "<", 10)) { then { increment(#fileloop) } else { set(#fileloop, 0, "Global") } }}loop while($comparison(#thread count, ">", 0)) { wait(0.5)}CheckList()stop scriptdefine test threads(#filelooplocal, #loopcounterlocal) { thread { set(#tmp, $plugin function("HTTP post.dll", "$http get", "https://dl.dropboxusercontent.com/u/10322/test/{#filelooplocal}.txt", $plugin function("HTTP post.dll", "$http useragent string", "Chrome 32.0 Win7 64-bit"), "http://www.google.com", "", ""), "local") set table cell(&numbers, #loopcounterlocal, 0, #tmp) set(#thread count, $plugin function("Threads Counter.dll", "threads counter", "decrement"), "Global") }}define CheckList { set(#loopcounter, 0, "Global") set(#testcounter, 0, "Global") set(#error, 0, "Global") loop($table total rows(&numbers)) { if($comparison(#testcounter, "!=", $table cell(&numbers, #loopcounter, 0))) { then { increment(#error) } } increment(#loopcounter) if($comparison(#testcounter, "<", 10)) { then { increment(#testcounter) } else { set(#testcounter, 0, "Global") } } } alert(#error)} But maybe I'm doing something wrong with my repro? Dan Quote Link to post Share on other sites
kev123 132 Posted April 30, 2014 Report Share Posted April 30, 2014 Dan try multi sign in for the same site on a website that should do it Quote Link to post Share on other sites
Bot-Factory 602 Posted April 30, 2014 Report Share Posted April 30, 2014 Dan try multi sign in for the same site on a website that should do it Shouldn't it happen with my example as well? If a local variable shares data between threads?I'm still not sure if the issue is the local variable or if it has something to do with the http plugin and how it handles local variables. Dan 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.