Jump to content



Photo

Thread Spawn Using Same Accounts In Each Thread

thread spawn multithreading tables multi thread thread spawn with tables

  • Please log in to reply
10 replies to this topic

#1 uBotForMe

uBotForMe

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 19 May 2017 - 03:30 PM

Hello

I 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.ubotstud...ki/Thread_Spawn



#2 Code Docta (Nick C.)

Code Docta (Nick C.)

    Member for Hire

  • Fellow UBotter
  • PipPipPip
  • 1482 posts
  • LocationIn a Python or UBot IDE or ubotdocta.com
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 19 May 2017 - 08:34 PM

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


UBot Expert Tutorials Store

 

ubot-docta-header-ubot-expert-store.png

 

Python and UBot expert tutorials and documentation


#3 uBotForMe

uBotForMe

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 20 May 2017 - 03:31 PM

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 Nick

Thanks for your reply. I tried your code but unfortunately it still uses the same accounts in all threads. My data is like this:-

 

username,pass

username1,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?



#4 uBotForMe

uBotForMe

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 20 May 2017 - 04:14 PM

Hi Nick

Thanks for your reply. I tried your code but unfortunately it still uses the same accounts in all threads. My data is like this:-

 

username,pass

username1,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



#5 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3299 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 20 May 2017 - 05:36 PM

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)
}

New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#6 uBotForMe

uBotForMe

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 20 May 2017 - 05:58 PM

 

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)
}

 

Hi

I tried it but still it uses same account in all threads. Not sure what's the issue.



#7 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3299 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 20 May 2017 - 06:18 PM

Hi

I tried it but still it uses same account in all threads. Not sure what's the issue.

try http://wiki.ubotstud...ki/Thread_Spawn


New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#8 Varo

Varo

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 92 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 20 May 2017 - 07:32 PM

@uBotForMe

Try 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. 



#9 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 4658 posts
  • LocationMichigan
  • OS:Windows 10
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 20 May 2017 - 11:12 PM

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")
    }
}


Web Automation Bots, and Ubot Plugins @ BotGuru.net Want a Custom bot? click here or Email me

ForumBanner.png

21 PLUGINS ABSOLUTELY FREE 100s for commands and functions
 


#10 uBotForMe

uBotForMe

    Member

  • Members
  • PipPip
  • 12 posts
  • OS:Windows 7
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 21 May 2017 - 03:14 AM

I am trying it


@uBotForMe

Try 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 by uBotForMe, 21 May 2017 - 03:14 AM.


#11 LoWrIdErTJ - BotGuru

LoWrIdErTJ - BotGuru

    Botguru.net

  • Moderators
  • 4658 posts
  • LocationMichigan
  • OS:Windows 10
  • Total Memory:8Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 21 May 2017 - 01:18 PM

always keep it as simple as possible.  glad it worked for ya


Web Automation Bots, and Ubot Plugins @ BotGuru.net Want a Custom bot? click here or Email me

ForumBanner.png

21 PLUGINS ABSOLUTELY FREE 100s for commands and functions
 






Also tagged with one or more of these keywords: thread spawn, multithreading, tables, multi thread, thread spawn with tables

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users