wiseguys 3 Posted March 25, 2015 Report Share Posted March 25, 2015 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) } } } } Quote Link to post Share on other sites
Code Docta (Nick C.) 639 Posted March 26, 2015 Report Share Posted March 26, 2015 perhaps this may help http://www.ubotstudio.com/forum/index.php?/topic/17375-tut-example-code-asynchronous-threading-in-ubot-55-and-420/ just split the list by 20 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.