Jump to content
UBot Underground

Stumped On Using Lists Local To Thread, Really Need Some Help!


Recommended Posts

Hey guys, I have read through a bunch of threads on list/variable scope and multi-threading but still can't figure this out.

 

I have 3 .txt lists (c:\list1.txt, c:\list2.txt, c:\list3.txt) each with 20 items, list1.txt is user1-1 to user1-20, list2.txt is user2-1 to user2-20 and so on...

 

I'm incrementing and passing the IDMARKER variable to the define function so it loads list{IDMARKER}.txt each time the function is called which seems to be working correctly, however when i return the list %templist from the function to the main body of the bot it either overwrites the existing %locallilst or adds the %templist to the end of %locallist

 

What I essentially want is 3 'unique versions' of %locallist so each thread has its own separate list, with browser window#1 working with list1.txt, window #2 with list2.txt etc...

 

I think I either have a scope wrong or am missing a clear list command or have it in the wrong place.

 

Any and all help would be GREATLY appreciated, thanks so much in advance!  :)

set(#idmarker, 1, "Global")
clear list(%templist)
clear list(%locallist)

define $getlist(#idmarker) {
    add list to list(%templist, $list from file("C:\\list{#idmarker}.txt"), "Delete", "Local")
    return(%templist)
}

loop(3) {
    wait(1)
    thread {
        in new browser {
            navigate("http://www.ubotstudio.com/playground/simple-form", "Wait")
            wait(2)
            add list to list(%locallist, $list from text($getlist(#idmarker), $new line), "Delete", "Global")
            increment(#idmarker)
            loop(20) {
                change attribute(<username field>, "value", $next list item(%locallist))
                wait(5)
            }
        }
    }
}
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...