Once you have all the nicks in a file use something like this instead of repeating so much code:

Code:
alias pickn {
  var %list, %choose = $$1, %file = somefile.txt, %limit = $lines(%file)
  if (!$exists(%file)) return
  if (%choose > %limit) return
  
  while ($numtok(%list,32) < %choose) {
    var %pick = $read(%file,$rand(1,%limit))
    if ($istok(%list,%pick,32)) { continue }
    %list = $addtok(%list,%pick,32)
  }

  echo -ag %list
}