Code:
on *:text:!draw:#:{
  if ($numtok($($+(%,names.,$nick),2),32) == 0) { set %names. $+ $nick A B C D E F G H I J K L M N O P Q R S T U V W X Y Z | goto draw }
  elseif ($numtok($($+(%,names.,$nick),2),32) == 1) {
    .msg $chan 2 $+ $nick $+ 's last card is $gettok($($+(%,names.,$nick),2), 1, 32) $+ . 
    unset %names. $+ $nick
    halt
  }
  else { goto draw }
  :draw
  var %i 1
  while (%i <= 2) {
    var % $+ $($+(c,%i),2) $gettok($($+(%,names.,$nick),2), $rand(1,$numtok($($+(%,names.,$nick),2),32)), 32)
    set %names. $+ $nick $remtok($($+(%,names.,$nick),2), $($+(%,c,%i),2), 32)
    inc %i
  }
  .msg $chan 2 $+ $nick drew %c1 and %c2 $+ . Remaining cards: $numtok($($+(%,names.,$nick),2),32) 
}


Final product, pending. Made it where it draws 2 and you can change the number of 'names' in the list at any moment. If it's an odd amount, it triggers the 'last card' message. If it's evens, it just goes back to the start. Either way it lists how many cards remain at the end of each post.

I also made a shuffle and shuffle all command to reset without reaching the end.

Code:
on *:text:!shuffle:#:{ unset %names. $+ $nick | .msg $chan 2 $+ $nick $+ 's deck has been shuffled. }


on *:text:!shuffleall:#:{ 
  if ($nick isop #) { unset %names.* | .msg $chan 4Warning! All decks have been reshuffled. }
  else { msg $chan 4Error! Only operators can shuffle everyone's deck. }
}


Last edited by Mythos; 02/01/15 01:04 AM.