Jump to content
UBot Underground

2 Lists - 1 Loop - No Sense - Please Help


Recommended Posts

I have a script that pulls credentials from one list and items to post from another. Both lists are created from local files. The credentials list may only have 5 items in the list, whereas the items to post list may have 50 or more. Regardless of whether I select random item, or next list item, I can never post more than the total number of items in the credentials list. I want the bot to continue to select an item from the credentials list until it has finished with the items list. Make sense?

Link to post
Share on other sites

Yes it does. You will need to use the list total of the items list as the number of cycles in the loop. You could then do something like:

 

In the credentials list, add an if statement..."IF--->list position = $list total

Then--->set position =0 (to restart the list).

 

There are other ways of handling this as well, but i think that's one of the simplest ways to do it. In order for this to work you will need to set #position to 0 and use $list item (for the credentials list)...you will NOT want to use this method on the items list as it will start at the beginning when the list total of the credentials list is reached. Therefore you could use $next list item or random list item on the items list.

 

John

  • Like 1
Link to post
Share on other sites

Yes it does. You will need to use the list total of the items list as the number of cycles in the loop. You could then do something like:

 

In the credentials list, add an if statement..."IF--->list position = $list total

Then--->set position =0 (to restart the list).

 

There are other ways of handling this as well, but i think that's one of the simplest ways to do it. In order for this to work you will need to set #position to 0 and use $list item (for the credentials list)...you will NOT want to use this method on the items list as it will start at the beginning when the list total of the credentials list is reached. Therefore you could use $next list item or random list item on the items list.

 

John

 

 

Thank you master Yoda.

 

Is there anyway to remove the posted items from the csv file after they have been processed? I'm currently writing a log file, but I would like to remove the posted items from the file, or write a value back to the original csv to mark them as done?

Link to post
Share on other sites

What you could do is something like this:

 

If the data from the csv file is in a table, for example, that has 3 columns of data (columns 0,1 and 2), you could use the $set table cell command to add "Completed" to column 3 (which is column#4 since they are 0 based). If the data is being pulled from a list you can use the $remove list item command after using it. But by doing that you will need to both decrement the list position and increment it after removing an item. (because the next list item would by assuming the position of the one you just removed)

 

John

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...