Randomly fetch one item from a list without repetitions across multiple command calls

hi i have over 1000 items in a list like


but the same item appears more often
here is my code

$(eval x = $(urlfetch json https://pastebin.com/raw/xxxx).split(";"); x[Math.floor(Math.random() * x.length)])

thank you

I think, the function you want is not possible.

By the way, I would use $(count) variable. Like this…

First create an array [`item1`, `item2`, `item3`, ... `item1000`] in your pastebin.

$(eval x=$(urlfetch json https://pastebin.com/raw/XXXXXX); x[$(count)])

Well it will give error if you use the command over 1000. But, for first 1000 calls, it will work fine and will return unique item.

I hope this will work

Hey @Ambassador!

Your code is correct, don’t change anything, each item is selected at random, having an item show up more often than the others is a regular behavior/impression when using true randomness.
You can read examples of this here or here.

The command @Ritik_Ranjan gave you is the exact same as yours and won’t fix the issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.