List processing and Multi Threading

MisterP

Пользователь
Регистрация
08.02.2014
Сообщения
87
Благодарностей
0
Баллы
6
Hey there,
I got another question. Lets say my bot looks like this:

1. Read file and put it to variable "fileContent"
2. Add fileContent to "list1"
3. Get first Line in "list1" (and delete that line after taking) and save it as "CurrentLine"
4. Go to a web site with "CurrentLine" as URL
5. Go To Step 3

The file has 3 entries;
www.site1.com
www.site2.com
www.site3.com


When I load up this ZennoTemplate and make 3 threads, will thread 1 just open up site1.com and thread 2 open up site2.com (which I want, or will each template open all three site one after another?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Hey. Why you read file and then add that file content to list ? Why you do not bind that file to your list initially ?

To answer to your question, there is no such tread counting as thread 1 2 3 etc. If you set 3 threads then all 3 lines will be taken one after another, not sure what you mean with each template. Make sure that you have to delete line after taken or all 3 threads will use one and that same first line...
 

MisterP

Пользователь
Регистрация
08.02.2014
Сообщения
87
Благодарностей
0
Баллы
6
Hey,
I don't know how to add a text file directly to the list!

However:
I have done that with "get line (in order, starting with the first entry)" and "delete line after take", but still each instance starts with with the first entry "www.site1.com" instead of one instance with site1.com, another instance starting with site2.com and the third instance starting with site3.com

Am I missing something?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Hey,
I don't know how to add a text file directly to the list!

However:
I have done that with "get line (in order, starting with the first entry)" and "delete line after take", but still each instance starts with with the first entry "www.site1.com" instead of one instance with site1.com, another instance starting with site2.com and the third instance starting with site3.com

Am I missing something?
Have you read all about lists in wiki ? http://zennolab.com/wiki/en:list

If still you have problems let me know.

Thanks
 

MisterP

Пользователь
Регистрация
08.02.2014
Сообщения
87
Благодарностей
0
Баллы
6
I've seen the tutorials and directly from a file would probably be an issue bceause the user has to specify the file directory :-)

However, I am still having that problem. Each instnace opens the list and starts from the first entry even though the other instance has done that entry already. I need to figure out a way to solve that (and as far as I know there is a way I have been doing a few years ago, but I cant figure it out anymore)
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
I've seen the tutorials and directly from a file would probably be an issue bceause the user has to specify the file directory :-)

However, I am still having that problem. Each instnace opens the list and starts from the first entry even though the other instance has done that entry already. I need to figure out a way to solve that (and as far as I know there is a way I have been doing a few years ago, but I cant figure it out anymore)
What you mean user have to specify path ? Do you develop templates for sale ? LOL

Search in forum for examples with term bind to list.

I think that you template takes info from file and puts in list then delete from list and this is all you have.
This case bot will take all info and put all that in internal list and take first line, this is what you have told to do. You never told to your bot to take second line...

Anyway if you want further help please post example of you template, and I will point out where is mistake...
 

MisterP

Пользователь
Регистрация
08.02.2014
Сообщения
87
Благодарностей
0
Баллы
6
No, I am using it myself but the path of the list.txt that I want to use may change, so I don't want anything too static within ZennoPoster!

True; I never told my bot to take the second line because I didn't know how to do it - I just want to specify for each instance to take the "next" line...This is where I get stuck.

A list gets created within my bot. Then I want to run it multihtreaded, so thread#1 should take entry #1, thread#2 should tkae entry#2 etc.
This is where I don't know how to do that within ZennoPoster's internal function. Maybe I need to do it with c#?

I am still trying my best right here, playing around with it but I just can't figure it out..I am still playing with the list processing module!
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Why do not you post your template example ?
And why do not you use forum search. ?
You do not need any C# to do this simple thing.

in list processing action choose your list and pick bind to file. and in Path set static path OR any variable what holds your path.



In list itself tick all 3 checkboxes.


Then with using next list processing action you Get first line with line deletion, so that next thread will take first line again it in real will second line, and so on.



Hope that helps
 
  • Спасибо
Реакции: MisterP

MisterP

Пользователь
Регистрация
08.02.2014
Сообщения
87
Благодарностей
0
Баллы
6
HI lokiys,
thanks for your response once again, you are indeed very very talented with zennoposter!

While the way you showed me indeed worked for me, the only downside to this is that the textfile wll remain empty. My text file is having log in details so the way you described it works and each template is loading a different entry like I wanted it to, but the entry then gets deleted and I end up with having no account details anymore.

Is there another workaround within zennoposter or would I need to build a feature that saves the acc detials (after grabbing it from the list) within a backup text file?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
HI lokiys,
thanks for your response once again, you are indeed very very talented with zennoposter!

While the way you showed me indeed worked for me, the only downside to this is that the textfile wll remain empty. My text file is having log in details so the way you described it works and each template is loading a different entry like I wanted it to, but the entry then gets deleted and I end up with having no account details anymore.

Is there another workaround within zennoposter or would I need to build a feature that saves the acc detials (after grabbing it from the list) within a backup text file?

Everything else depends what your logic is.
You can also use loop with counter and then take line by number, or you can re-save account details from backupfile.
Or you can just double information in your file, like

site1
site2
site1
site2

etc.
 
  • Спасибо
Реакции: MisterP

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)