Jump to content
UBot Underground

New Update & Thread Spawn Discussion


Recommended Posts

You will need the large data plugin to run the code below.

 

So I just did some quick testing and the thread spawn now works a lot better. It might be time to start switching over to it soon if nobody reports back any bugs.

 

Here is what I tested, besides the bug report Dan had made. I made the code below.

 

In theory the variable result in the end will be 10 sets of the numbers 1-10. This is what we get. To try and trip it up I also made the connections larger than the list and it is still working fine.

 

One very important thing to note:

 

Things will get screwed up when you start to use delays of any kind I think. This may include loading web pages and other things. So when you use Thread Spawn I think we need to be sending the information to a command/function or setting it into a variable immediately.

 

Of course I was just playing with it for a few minutes only time will tell if it will work well in real world situations. But that is why I opened this thread to see what everyone else is finding because it will be exciting if/when this works in the way that I think it can.

clear all data
plugin command("Bigtable.dll", "Clear all large list")
set(#number,1,"Global")
loop(10) {
    add item to list(%numbers,#number,"Don\'t Delete","Global")
    increment(#number)
}
thread spawn(100,21) {
    if($comparison($list position(%numbers),">=",$list total(%numbers))) {
        then {
            set list position(%numbers,0)
        }
        else {
        }
    }
    Add To List($next list item(%numbers))
}
define Add To List(#num) {
    plugin command("Bigtable.dll", "Add item to large list", "numbers", #num)
}
set(#results,$plugin function("Bigtable.dll", "Large list return", "numbers"),"Global")

  • Like 1
Link to post
Share on other sites
 

Not really working for me, at least not the way i do.

 

PLEASE tell me that i fucked it up, i want to use it, and i hope it works.....

I just get the Stealth, and i am getting more and more frustrated with it :S

 

Edited by Sirfrank
Link to post
Share on other sites

I don't think the log commands work with threads I remember trying to do something with them when they came out so that you could see what thread was doing something and it was a big mess.

 

Maybe try adding the numbers to a list or doing something else with them.

Link to post
Share on other sites

i think it does work with  it, if i put a randomised wait in it, it is all good (almost very few error). It seems that all threads tying to acces the variable the same time, and get the same vaue often. If randomised the access time by the randomised waiting, it accesses in different time, so value different at the threads.

 

 

 clear all data
ui log view("Lets see if spawn works....")
set(#loop,0,"Global")
thread spawn(100,10) {
    wait("{$rand(0,2)}.{$rand(0000,9999)}")
    purpose(#loop)
    increment(#loop)
}

Link to post
Share on other sites

Im confused with latest thread spawn....

Example on wiki seems not to answer how I wish to use it.

 

OK UB5 seems better, and like some of the new features so kudos to the Ubot Team!

 

But with spawning I would want to know what spawn number/id each thread is, and would like to pull data from table via thread id.

 

In the example you use a global #row set before the spawn to 0, and increment at end of thread....

But if I was spawning 10 threads at once they would all be 0 at beginning of thread?!

Forgive me if am getting the new threading wrong...

 

Can anyone explain?!

Link to post
Share on other sites

Im confused with latest thread spawn....

Example on wiki seems not to answer how I wish to use it.

 

OK UB5 seems better, and like some of the new features so kudos to the Ubot Team!

 

But with spawning I would want to know what spawn number/id each thread is, and would like to pull data from table via thread id.

 

In the example you use a global #row set before the spawn to 0, and increment at end of thread....

But if I was spawning 10 threads at once they would all be 0 at beginning of thread?!

Forgive me if am getting the new threading wrong...

 

Can anyone explain?!

 

 

You can use the file management or large data (big table) plugin to see the thread ids, like so. This one uses the large data (big table) plugin and uses the large table because its thread safe

clear all data
plugin command("Bigtable.dll", "Clear all Large Tables")
plugin command("Bigtable.dll", "Create Large Table", "data", 10, 1)
set(#row,0,"Global")
thread spawn(10,10) {
    plugin command("Bigtable.dll", "Set Large Table cell", "data", #row, 0, $plugin function("Bigtable.dll", "Thread Id"))
    increment(#row)
}
set(#data,$plugin function("Bigtable.dll", "Return Large Table CSV", "data", 0, 10),"Global")
create table from text(&data,#data)
Link to post
Share on other sites

i think it does work with  it, if i put a randomised wait in it, it is all good (almost very few error). It seems that all threads tying to acces the variable the same time, and get the same vaue often. If randomised the access time by the randomised waiting, it accesses in different time, so value different at the threads.

 

 

 clear all data

ui log view("Lets see if spawn works....")

set(#loop,0,"Global")

thread spawn(100,10) {

    wait("{$rand(0,2)}.{$rand(0000,9999)}")

    purpose(#loop)

    increment(#loop)

}

 

Yea it almost works like this. So I guess this command needs more community testing like this because it's not working with everything if log commands are supposed to be thread safe.

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