stu
Junior Member
Stu
Posts: 82 Reputation: 1
39 / /
Joined: Sep 2004
|
O.P. RE: Random numbers, prevent from being used more than once
Ok, true enough, if I want to take the extra time to change that now, and each future one as I add it. I am just going to leave that for now though. As I said, I have now cut out the which statement alltogether, and am using just the Text array so its not a huge deal right now, to me..
I still cant get this to work though, when it calls the GetRandomLyric function,nothing seems to happen, and it just returns "undefined"..
Edit: Looks like I was missing a line of code, my bad.. testing it out now..
quote: quote:
--------------------------------------------------------------------------------
Originally posted by CookieRevised
Actualy foaly's method is not going to work
--------------------------------------------------------------------------------
It works perfectly fine for generating the random number without repetition until 10 others have been selected.
I tried his method as well, but could not get that to work. If you think it can, that would be great if you could think of a way for me to figure it out, always better to know more than one method..
___________________________________________________________
Ok, so I got it to display a lyric. when the lyric is chosen, it is removed from the array, and added into arrPrevious (but it only seems to stay there for one lyric, see debuging). After 10 lyrics though, they dont get added back into the original array. Here is what the script debugger shows.. As you can see, my Text array consists of 12 Tests..
quote: Started Personal Message
Printed personal message - Test 10
ArrPrevious - ,,,,,,,,Test 10
ArrLyrics - Test 1,Test 2,Test 3,Test 4,Test 5,Test 6,Test 7,Test 8,Test 9,Test 11,Test 12
Started Personal Message
Printed personal message - Test 8
ArrPrevious - ,,,,,,,,Test 8
ArrLyrics - Test 1,Test 2,Test 3,Test 4,Test 5,Test 6,Test 7,Test 9,Test 11,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 9
ArrPrevious - ,,,,,,,,Test 9
ArrLyrics - Test 1,Test 2,Test 3,Test 4,Test 5,Test 6,Test 7,Test 11,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 5
ArrPrevious - ,,,,,,,,Test 5
ArrLyrics - Test 1,Test 2,Test 3,Test 4,Test 6,Test 7,Test 11,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 11
ArrPrevious - ,,,,,,,,Test 11
ArrLyrics - Test 1,Test 2,Test 3,Test 4,Test 6,Test 7,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 2
ArrPrevious - ,,,,,,,,Test 2
ArrLyrics - Test 1,Test 3,Test 4,Test 6,Test 7,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 1
ArrPrevious - ,,,,,,,,Test 1
ArrLyrics - Test 3,Test 4,Test 6,Test 7,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 4
ArrPrevious - ,,,,,,,,Test 4
ArrLyrics - Test 3,Test 6,Test 7,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 7
ArrPrevious - ,,,,,,,,Test 7
ArrLyrics - Test 3,Test 6,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 3
ArrPrevious - ,,,,,,,,Test 3
ArrLyrics - Test 6,Test 12
Timer = 15000
Started Personal Message
Printed personal message - Test 12
ArrPrevious - ,,,,,,,,Test 12
ArrLyrics - Test 6
Timer = 15000
Started Personal Message
Printed personal message - Test 6
ArrPrevious - ,,,,,,,,Test 6
ArrLyrics -
Timer = 15000
Started Personal Message
Printed personal message -
ArrPrevious - ,,,,,,,,
ArrLyrics -
Timer = 15000
This post was edited on 07-05-2007 at 03:07 AM by stu.
|
|