Jump to content
UBot Underground

[FREE] Thread Safe Variables (Source Code)


Recommended Posts

This is a small source code i coded today for few people who needed it!

Basically this is another workaround for local variables leakage , this will allow you to save data and retrieve it just like local variables but (hopefully) won't get messed up!

 

PS: this uses the file management plugin so make sure to install it first!

 

Enjoy!

Thread Safe Variables.ubot

  • Like 2
Link to post
Share on other sites

Thanks again Aymen!

If you had to choose would you use this approach or your local dictionary plugin? (performance wise)

 

Marton

Link to post
Share on other sites

Is there a new version of file management plugin?

I cant open the sample file above..

 

I don't remember the last time I updated, but I have version 1.9.0.0 and the above script works with it.

Link to post
Share on other sites

Thanks again Aymen!

 

If you had to choose would you use this approach or your local dictionary plugin? (performance wise)

 

Marton

 

the local dictionary plugin is mainly built to work with the http post plugin so i'm not sure about the other plugins , use the local dictionary as a first choice and keep this workaround as a substitute :)

 

Is there a new version of file management plugin?

I cant open the sample file above..

 

i'm not sure what version you use!

Just go to the file management thread and download the plugin from there , it is the latest version !

  • Like 1
Link to post
Share on other sites

Hi Aymen,

 

I did some test with this approach. Unfortunately there are situations where I don't have 4 entries in the list.

I don't know if that is a threads error or timing or something else.

 

But when you add a loop while to your code, then you will see what I mean after a while:

 

clear list(%randoms)
folder name($special folder("My Documents"), "TestLocalWorkaround")
ThreadsLoop()
wait(1)
loop while($comparison($list total(%randoms), "=", 4)) {
    clear list(%randoms)
    ThreadsLoop()
    wait(2)
}
define ThreadsLoop {
    thread {
        SetValue("random"$random text(10))
        add item to list(%randoms"Thread id : {$plugin function("File Management.dll""$get threadID")} ||  value : {$GetValue("random")}""Don\'t Delete""Global")
    }
    thread {
        SetValue("random"$random text(10))
        add item to list(%randoms"Thread id : {$plugin function("File Management.dll""$get threadID")} ||  value : {$GetValue("random")}""Don\'t Delete""Global")
    }
    thread {
        SetValue("random"$random text(10))
        add item to list(%randoms"Thread id : {$plugin function("File Management.dll""$get threadID")} ||  value : {$GetValue("random")}""Don\'t Delete""Global")
    }
    thread {
        SetValue("random"$random text(10))
        add item to list(%randoms"Thread id : {$plugin function("File Management.dll""$get threadID")} ||  value : {$GetValue("random")}""Don\'t Delete""Global")
    }
}

 

Unfortunately I have no idea how to troubleshoot that further :-(

 

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