begale 0 Posted August 21, 2013 Report Share Posted August 21, 2013 how can i set ui button for each thread? im using different proxy on each thread ,sometimes there is a problem with a specific proxy and i get a blank page on this thread while the other threads keep running. so i want to push a button and do all the login process again on this thread without stop the bot which will close all the threads. here is the basic code: ui button("login account 1") { if(#thread number = 1) { then { login to account() } else { } } } ui button("login account 2") { if(#thread number = 2) { then { login to account() } else { } } } ui button("login account 3") { if(#thread number = 3) { then { login to account() } else { } } } ui button("login account 4") { if(#thread number = 4) { then { login to account() } else { } } } ui button("login account 5") { if(#thread number = 5) { then { login to account() } else { } } } ui button("login account 6") { if(#thread number = 6) { then { login to account() } else { } } } ui button("login account 7") { if(#thread number = 7) { then { login to account() } else { } } } ui button("login account 8") { if(#thread number = 8) { then { login to account() } else { } } } set(#account number, 0, "Global") loop(8) { wait(2) thread { in new browser { write to browser() wait(10000) } } } define write to browser { increment(#account number) set(#thread number, #account number, "Local") load html(#account number) } define login to account { navigate("http://www.yahoo.com/", "Wait") } Quote Link to post Share on other sites
HelloInsomnia 1103 Posted August 21, 2013 Report Share Posted August 21, 2013 You would make login to account a custom command and send the username, password and proxy as the variables and make all the variables inside of it set to be local. Try this, I only changed the first ui button you will have to add login to account to the rest and all the details. ui button("login account 1") { if(#thread number = 1) { then { login to account("email", "pass", "proxy") } else { } } } ui button("login account 2") { if(#thread number = 2) { then { login to account() } else { } } } ui button("login account 3") { if(#thread number = 3) { then { login to account() } else { } } } ui button("login account 4") { if(#thread number = 4) { then { login to account() } else { } } } ui button("login account 5") { if(#thread number = 5) { then { login to account() } else { } } } ui button("login account 6") { if(#thread number = 6) { then { login to account() } else { } } } ui button("login account 7") { if(#thread number = 7) { then { login to account() } else { } } } ui button("login account 8") { if(#thread number = 8) { then { login to account() } else { } } } set(#account number, 0, "Global") loop(8) { wait(2) thread { in new browser { write to browser() wait(10000) } } } define write to browser { increment(#account number) set(#thread number, #account number, "Local") load html(#account number) } define login to account(#email, #password, #proxy) { thread { in new browser { change proxy(#proxy) navigate("https://login.yahoo.com/config/login", "Wait") type text(<username field>, #email, "Standard") type text(<name="passwd">, #password, "Standard") } } } Quote Link to post Share on other sites
begale 0 Posted August 21, 2013 Author Report Share Posted August 21, 2013 Thanks for the help 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.