Enigma 78 Posted January 20, 2010 Report Share Posted January 20, 2010 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)? Quote Link to post Share on other sites
Aaron Nimocks 19 Posted January 20, 2010 Report Share Posted January 20, 2010 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. Quote Link to post Share on other sites
Enigma 78 Posted January 20, 2010 Author Report Share Posted January 20, 2010 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. Quote Link to post Share on other sites
Aaron Nimocks 19 Posted January 20, 2010 Report Share Posted January 20, 2010 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. Quote Link to post Share on other sites
Enigma 78 Posted January 20, 2010 Author Report Share Posted January 20, 2010 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. Quote Link to post Share on other sites
1nspire 5 Posted January 20, 2010 Report Share Posted January 20, 2010 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 Quote Link to post Share on other sites
Enigma 78 Posted January 20, 2010 Author Report Share Posted January 20, 2010 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. 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.