Randomizing a list - 23/10/11 12:32 AM
So I'm trying to take a list of 12 objects, randomize it, and then display 3 at a time. I'm sorta a newb when it comes to scripting, so help would be appreciated. (player# are all just text strings edited for privacy reason)
I have no idea why it isn't working, so any help is appreciated.
Code:
on *:TEXT:!newlines:*: { set %newlines player1 player2 player3 player4 player5 player6 player7 player8 player9 player10 player11 player12 set %newlinecounter 1 while (%newlinecounter <= 12) { set %newlinerand $rand(1,$numtok(%newlines,32)) echo -s $addtok(%newlinesdisp,$gettok(%newlines,%newlinecounter,32),32) echo -s $deltok(%newlines,%newlinerand,32) inc %newlinecounter 1 } msg $chan $gettok(%newlinesdisp,1,32) - $gettok(%newlinesdisp,2,32) - $gettok(%newlinesdisp,3,32) msg $chan $gettok(%newlinesdisp,4,32) - $gettok(%newlinesdisp,5,32) - $gettok(%newlinesdisp,6,32) msg $chan $gettok(%newlinesdisp,7,32) - $gettok(%newlinesdisp,8,32) - $gettok(%newlinesdisp,9,32) msg $chan $gettok(%newlinesdisp,10,32) - $gettok(%newlinesdisp,11,32) - $gettok(%newlinesdisp,12,32) }
I have no idea why it isn't working, so any help is appreciated.