Jump to content
UBot Underground

Grab multiple random items from a list (txt/csv)


Recommended Posts

Is uBot able to grab multiple items from a list in once?

 

Example:

 

I have a list with 100.000 items.

Now i want uBot to get 3 or 8 (or any amount of numbers) items from that list and put this in an element on a website.

 

Is this possible?

 

If so, also possible to get random items from a list (3 or 8 random items)?

Link to post
Share on other sites

If my memory serves me correctly there is a function to get a random list item. That is what you would use to get this done.

 

I understand, but how to get multiple items in once, random. :)

Link to post
Share on other sites

Loop how many items you want.

 

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

 

Use new list with random items.

Link to post
Share on other sites

Loop how many items you want.

 

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

Get random item, save to new list.

 

Use new list with random items.

 

So it isn't possible without the loop/while?

 

By the way, it must not save to new list, it must add to an element on a website.

Link to post
Share on other sites

Using Aaron's suggestion you can randomize set list position then randomize the loop. Use add to list by next list item to avoid and duplicate items.

 

What this will do is randomly pick the list position to start from then randomly choose how many items to add to the list by way of the loop.

 

If you simply add to a new list using a loop with random list item command you risk having duplicate items in one list since that command is completely random.

 

I provided a little bot to demonstrate what I suggested.

 

By the way, it must not save to new list, it must add to an element on a website.

 

Do not confuse ubot list handling with saving data. List are a major part of ubot and how it handles and manipulates data.

randomlist.ubot

Link to post
Share on other sites

Using Aaron's suggestion you can randomize set list position then randomize the loop. Use add to list by next list item to avoid and duplicate items.

 

What this will do is randomly pick the list position to start from then randomly choose how many items to add to the list by way of the loop.

 

If you simply add to a new list using a loop with random list item command you risk having duplicate items in one list since that command is completely random.

 

I provided a little bot to demonstrate what I suggested.

 

 

 

Do not confuse ubot list handling with saving data. List are a major part of ubot and how it handles and manipulates data.

 

Thanks for this 1nspire.

Will take a look at it tonight. :)

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