uBotForMe 2 Posted May 19, 2017 Report Share Posted May 19, 2017 HelloI am using thread spawn command but it uses same accounts in each thread.Here is my code:- ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) create table from file(#uiopen csv,&csvtable) set(#row,0,"Global") thread spawn($table total rows(&csvtable),5) { in new browser { allow images("No") navigate("#websitelink","Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,$table cell(&csvtable,#row,0),"Standard") type text(<password field>,$table cell(&csvtable,#row,1),"Standard") click(<login button>,"Left Click","No") increment(#row) clear cookies } }Can someone please tell me what wrong I am doing? I followed example 2 (Thread Spawn With Tables) which is given here: http://wiki.ubotstudio.com/wiki/Thread_Spawn Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted May 20, 2017 Report Share Posted May 20, 2017 Hi, Tables are not thread safe. Try this.... ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) clear list(%data) add list to list(%data,$list from file(#uiopen csv),"Delete","Global") thread spawn($list total(%data),5) { in new browser { comment("set to local for threading wont work right otherwise won\'t show in debugger") set(#data NLI,$next list item(%data),"Local") allow images("No") clear cookies navigate("#websitelink","Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") comment("position 0 for email") type text(<email field>,$list item($list from text(#data NLI,","),0),"Standard") comment("postion 1 for password and assuming , is the delimiter") type text(<password field>,$list item($list from text(#data NLI,","),1),"Standard") click(<login button>,"Left Click","No") } } Should work, I didn't test it. Regards,Nick Quote Link to post Share on other sites
uBotForMe 2 Posted May 20, 2017 Author Report Share Posted May 20, 2017 Hi, Tables are not thread safe. Try this.... ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) clear list(%data) add list to list(%data,$list from file(#uiopen csv),"Delete","Global") thread spawn($list total(%data),5) { in new browser { comment("set to local for threading wont work right otherwise won\'t show in debugger") set(#data NLI,$next list item(%data),"Local") allow images("No") clear cookies navigate("#websitelink","Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") comment("position 0 for email") type text(<email field>,$list item($list from text(#data NLI,","),0),"Standard") comment("postion 1 for password and assuming , is the delimiter") type text(<password field>,$list item($list from text(#data NLI,","),1),"Standard") click(<login button>,"Left Click","No") } } Should work, I didn't test it. Regards,Nick Hi NickThanks for your reply. I tried your code but unfortunately it still uses the same accounts in all threads. My data is like this:- username,passusername1,pass I checked with 2 threads and it entered same account in both threads. I was very hopeful that your code will work because it looks perfect using to me but it didn't. Can you please check if there is anything missing? Maybe I need to add little wait time at the end so that it have time to consider data for "next list item" command? Quote Link to post Share on other sites
uBotForMe 2 Posted May 20, 2017 Author Report Share Posted May 20, 2017 Hi NickThanks for your reply. I tried your code but unfortunately it still uses the same accounts in all threads. My data is like this:- username,passusername1,pass I checked with 2 threads and it entered same account in both threads. I was very hopeful that your code will work because it looks perfect using to me but it didn't. Can you please check if there is anything missing? Maybe I need to add little wait time at the end so that it have time to consider data for "next list item" command?I tried to add 1 second wait time but still it runs same accounts in all threads Quote Link to post Share on other sites
pash 504 Posted May 21, 2017 Report Share Posted May 21, 2017 try add wait time before or after next thread. ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) create table from file(#uiopen csv,&csvtable) set(#row,0,"Global") thread spawn($table total rows(&csvtable),5) { in new browser { set(#email,$table cell(&csvtable,#row,0),"Local") set(#password,$table cell(&csvtable,#row,1),"Local") allow images("No") navigate("#websitelink","Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,#email,"Standard") type text(<password field>,#password,"Standard") click(<login button>,"Left Click","No") increment(#row) clear cookies } wait(0.1) } Quote Link to post Share on other sites
uBotForMe 2 Posted May 21, 2017 Author Report Share Posted May 21, 2017 try add wait time before or after next thread. ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) create table from file(#uiopen csv,&csvtable) set(#row,0,"Global") thread spawn($table total rows(&csvtable),5) { in new browser { set(#email,$table cell(&csvtable,#row,0),"Local") set(#password,$table cell(&csvtable,#row,1),"Local") allow images("No") navigate("#websitelink","Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,#email,"Standard") type text(<password field>,#password,"Standard") click(<login button>,"Left Click","No") increment(#row) clear cookies } wait(0.1) } HiI tried it but still it uses same account in all threads. Not sure what's the issue. Quote Link to post Share on other sites
pash 504 Posted May 21, 2017 Report Share Posted May 21, 2017 HiI tried it but still it uses same account in all threads. Not sure what's the issue.try http://wiki.ubotstudio.com/wiki/Thread_Spawn Quote Link to post Share on other sites
Varo 28 Posted May 21, 2017 Report Share Posted May 21, 2017 @uBotForMeTry this code : ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) create table from file(#uiopen csv,&csvtable) set(#row,0,"Global") clear list(%row) loop($table total rows(&csvtable)) { add item to list(%row,#row,"Don\'t Delete","Global") increment(#row) } thread spawn($table total rows(&csvtable),5) { Go($next list item(%row)) wait(1) } define Go(#rowtable) { in new browser { allow images("No") navigate(#websitelink,"Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,$table cell(&csvtable,#rowtable,0),"Standard") type text(<password field>,$table cell(&csvtable,#rowtable,1),"Standard") click(<login button>,"Left Click","No") } } report the results here. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted May 21, 2017 Report Share Posted May 21, 2017 Your welcome..Let me say 1 thing. TO HELL WITH TABLES AND THREADING.. Use them Local lists. Don't make it more difficult then it needs to be.ui open file("browse",#uiopen csv)ui stat monitor("Loop counter",#row)ui text box("Link",#websitelink)clear list(%csvtable)add list to list(%csvtable,$list from file(#uiopen csv),"Delete","Global")thread spawn($list total(%csvtable),5) { Go($next list item(%csvtable)) wait(1)}define Go(#rowtable) { add list to list(%breakdown table,$list from text(#rowtable,","),"Don\'t Delete","Local") in new browser { allow images("No") navigate(#websitelink,"Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,$list item(%breakdown table,0),"Standard") type text(<password field>,$list item(%breakdown table,2),"Standard") click(<login button>,"Left Click","No") }} 2 Quote Link to post Share on other sites
uBotForMe 2 Posted May 21, 2017 Author Report Share Posted May 21, 2017 (edited) I am trying it@uBotForMeTry this code : ui open file("browse",#uiopen csv) ui stat monitor("Loop counter",#row) ui text box("Link",#websitelink) create table from file(#uiopen csv,&csvtable) set(#row,0,"Global") clear list(%row) loop($table total rows(&csvtable)) { add item to list(%row,#row,"Don\'t Delete","Global") increment(#row) } thread spawn($table total rows(&csvtable),5) { Go($next list item(%row)) wait(1) } define Go(#rowtable) { in new browser { allow images("No") navigate(#websitelink,"Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,$table cell(&csvtable,#rowtable,0),"Standard") type text(<password field>,$table cell(&csvtable,#rowtable,1),"Standard") click(<login button>,"Left Click","No") } } report the results here. Your welcome..Let me say 1 thing. TO HELL WITH TABLES AND THREADING.. Use them Local lists. Don't make it more difficult then it needs to be.ui open file("browse",#uiopen csv)ui stat monitor("Loop counter",#row)ui text box("Link",#websitelink)clear list(%csvtable)add list to list(%csvtable,$list from file(#uiopen csv),"Delete","Global")thread spawn($list total(%csvtable),5) { Go($next list item(%csvtable)) wait(1)}define Go(#rowtable) { add list to list(%breakdown table,$list from text(#rowtable,","),"Don\'t Delete","Local") in new browser { allow images("No") navigate(#websitelink,"Wait") wait for browser event("Everything Loaded",10) wait for element(<email field>,10,"Appear") type text(<email field>,$list item(%breakdown table,0),"Standard") type text(<password field>,$list item(%breakdown table,2),"Standard") click(<login button>,"Left Click","No") }} I just tried code of @LoWrIdErTJ - BotGuru and I am glad to inform you that it has worked perfectly. I run 75 accounts and all 75 accounts created. I am so happy that finally I got solution Thank you so much LoWrIdErTJ - BotGuru and Varo Edited May 21, 2017 by uBotForMe Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted May 21, 2017 Report Share Posted May 21, 2017 always keep it as simple as possible. glad it worked for ya 1 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.