Choller 3 Posted September 7, 2010 Report Share Posted September 7, 2010 I am using a "random list item" in a loop but I keep getting the same item in the list everytime.I also tried using random(0,list total) for trying to get a specific item but still no go.Is this a bug? p.s.: If you see a broken image link then please click on it and you will see it. Quote Link to post Share on other sites
MiriamMB 63 Posted September 7, 2010 Report Share Posted September 7, 2010 I am using a "random list item" in a loop but I keep getting the same item in the list every time.I also tried using random(0,list total) for trying to get a specific item but still no go. Is this a bug? If you're trying to get a specific item then use next list item or list item with a set list postion set to 0. But random list item seems to be working fine. If it giving you the same item over and over with no change at all? Or is it bringing up the list item too often? Quote Link to post Share on other sites
Choller 3 Posted September 7, 2010 Author Report Share Posted September 7, 2010 IT is giving me the same item over and over again. I am calling it from another script though (so in another tab). I think I will use next list for now and rotate through it. Quote Link to post Share on other sites
Choller 3 Posted September 7, 2010 Author Report Share Posted September 7, 2010 Stupid me forgot to clear the list sorry... Quote Link to post Share on other sites
MiriamMB 63 Posted September 7, 2010 Report Share Posted September 7, 2010 Stupid me forgot to clear the list sorry... lol no biggie. Quote Link to post Share on other sites
theninjamanz 29 Posted September 9, 2010 Report Share Posted September 9, 2010 lol no biggie. actually there is a funkier way I've done this with a random list item. Basically you set a variable to the random item in the list.You use that list item.You then remove that list item.You then save the remaining list to a new list.You then read the least.And then you loop it back. What you end up with is a list of items that diminishes, saves, reads, and loops in random. And you get the guarantee that you will exhaust completely the list in a random fashion. Otherwise you could get the same list item twice. 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.