Otts 4 Posted January 4, 2014 Report Share Posted January 4, 2014 Thanks to everyone that helped, got past this issue! Quote Link to post Share on other sites
UBotBuddy 331 Posted January 5, 2014 Report Share Posted January 5, 2014 This is a simple example. clear list(%list) add list to list(%list, $list from text("Larry,Moe,Currly", ","), "Delete", "Global") loop($list total(%list)) { thread { in new browser { navigate("https://www.google.com/", "Wait") wait for browser event("Page Loaded", "") type text(<name="q">, $next list item(%list), "Standard") pause script } } } Buddy Quote Link to post Share on other sites
Otts 4 Posted January 5, 2014 Author Report Share Posted January 5, 2014 This is a simple example. clear list(%list) add list to list(%list, $list from text("Larry,Moe,Currly", ","), "Delete", "Global") loop($list total(%list)) { thread { in new browser { navigate("https://www.google.com/", "Wait") wait for browser event("Page Loaded", "") type text(<name="q">, $next list item(%list), "Standard") pause script } } } Buddy This is a simple example. clear list(%list) add list to list(%list, $list from text("Larry,Moe,Currly", ","), "Delete", "Global") loop($list total(%list)) { thread { in new browser { navigate("https://www.google.com/", "Wait") wait for browser event("Page Loaded", "") type text(<name="q">, $next list item(%list), "Standard") pause script } } } BuddyI'm using the define method, my code, my block text is "User:pass" loop($list total(%load_acc)) { clear list(%use_acc) add list to list(%use_acc, $list from text($next list item(%load_acc), ":"), "Delete", "Global") type text($element offset(<name="user[login]">, 0), $list item(%use_acc, 0), "Standard") wait for element($element offset(<password field>, 0), "", "Appear") type text(<password field>, $list item(%use_acc, 1), "Standard") Quote Link to post Share on other sites
Otts 4 Posted January 5, 2014 Author Report Share Posted January 5, 2014 Please somebody just help, im pulling my hair out!!! 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted January 5, 2014 Report Share Posted January 5, 2014 I need to see more than this. Quote Link to post Share on other sites
Otts 4 Posted January 5, 2014 Author Report Share Posted January 5, 2014 I need to see more than this.I've sent you a pm. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted January 5, 2014 Report Share Posted January 5, 2014 put your "list items" in a set command each instead and make sure they are set to local and use variables in the type text commands Quote Link to post Share on other sites
Otts 4 Posted January 5, 2014 Author Report Share Posted January 5, 2014 put your "list items" in a set command each instead and make sure they are set to local and use variables in the type text commandsTried this, not working.When the bot loads, it loads one account only, %use_acc (username:pass)All 3 threads will use this one account, then when each thread has finished, the bot will then load another account, but all 3 threads will use that one account Quote Link to post Share on other sites
Otts 4 Posted January 5, 2014 Author Report Share Posted January 5, 2014 bump, still havent fixed this!!! 3 threads are using 1 account, then changes on the next loop Quote Link to post Share on other sites
bobstratton 2 Posted January 6, 2014 Report Share Posted January 6, 2014 I had a similar problem. Note that wait(5) did not work and I didn't try any other values. I wouldprobably need a longer wait on a slower computer. Note also that thewait was not part of the thread code - it was after the thread. All threads were exactly the same until I put a wait(10) after starting each thread as follows: clear list(%list)add list to list(%list, $list from text("Larry,Moe,Currly", ","), "Delete", "Global")loop($list total(%list)) { thread { in new browser { navigate("https://www.google.com/", "Wait") wait for browser event("Page Loaded", "") type text(<name="q">, $next list item(%list), "Standard") pause script } } wait(10)} There are probably solutions that are faster and much more elegantbut this one was OK for what I was doing. Quote Link to post Share on other sites
bobstratton 2 Posted January 6, 2014 Report Share Posted January 6, 2014 I forgot to mention that my thread code took almost 10 seconds to runafter the new browser was loaded. A shorter wait might work for you.I don't know if the the pause in your thread will make a difference. Quote Link to post Share on other sites
Steve 30 Posted January 6, 2014 Report Share Posted January 6, 2014 I think the OP was having issues with passing variables into custom defined commands. The way its done in the following example is to set the global variables before the thread is opened and then pass those global variables to the custom command which will use them as local variables.In the example, I added a wait for 100 seconds just so you can switch between the open browsers and see that it is using unique account info for each thread. Hope this helps clear list(%accounts) add list to list(%accounts, $list from text("user1:pass1,user2:pass2,user3:pass3,user4:pass4,user5:pass5", ","), "Delete", "Global") loop($list total(%accounts)) { set(#global_account, $next list item(%accounts), "Global") set(#global_username, $find regular expression(#global_account, ".+(?=\\:)"), "Global") set(#global_password, $find regular expression(#global_account, "(?<=\\.+"), "Global") thread { in new browser { login(#global_username, #global_password) } } wait(.5) } define login(#local_username, #local_password) { set(#local_username, #local_username, "Local") set(#local_password, #local_password, "Local") load html("username: {#local_username} <br><br> password: {#local_password}") wait(100) } threading_with_list_example.ubot 1 Quote Link to post Share on other sites
Otts 4 Posted January 6, 2014 Author Report Share Posted January 6, 2014 Thanks everyone, i will close this now! regards Quote Link to post Share on other sites
Steve 30 Posted January 6, 2014 Report Share Posted January 6, 2014 np 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.