Jump to content
UBot Underground

[Free] Local Dictionary Plugin - Local Variables Issue Workaround


Recommended Posts

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.

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

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hello everyone, Another brilliant creation of mine   Description : This plugin is used to save temporary data (same as variables) so you can use it across your code   How does it work ? Each thread

Update 1.2.1 images shows the new commands and functions       -added also a thread container command for running dialog controls in STA mode (workaround for the http captcha dialog and other simila

Yes i'm aware there is couple of issues with it , it was a test release never meant to be public! use the old version ! (download link has been updated again) Regards

Posted Images

  • 4 weeks later...

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 help

Dan

Link to post
Share on other sites

 

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

Link to post
Share on other sites

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

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

Link to post
Share on other sites

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 )

Link to post
Share on other sites

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 help

Dan

Link to post
Share on other sites

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.

Link to post
Share on other sites

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

Link to post
Share on other sites

Idea for next release:

 

  • Local List - Option to remove duplicates
  • text 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"test
test2
""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 this

Dan

Link to post
Share on other sites

 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

Link to post
Share on other sites

Idea for next release:

 

  • Local List - Option to remove duplicates
  • text 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"test

test2

""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 this

Dan

 

Sure,

I'm very busy these days!

Hopefully next week i can make couple of plugins updates!

 

Regards,

Link to post
Share on other sites

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

Link to post
Share on other sites

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

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

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

Link to post
Share on other sites

its to do with ubot threads aren't setup with the stathread attribute something needed to communicate with COM components. Something dialogs use.

Link to post
Share on other sites

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!

Link to post
Share on other sites

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

So 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 script
define 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

Link to post
Share on other sites

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

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