Code:

alias twisteron .enable #twister | echo $active Twister script is now ON.
alias twisteroff .disable #twister | echo $active Twister script is now OFF.


#twister on
alias -l twistnum {
  inc -e %twister.num [ $+ [ $chan ] $+ . $+ [ $network ] ]
  .timer 1 %twister.num [ $+ [ $chan ] $+ . $+ [ $network ] ] $$1-
}

on *:text:*!twister:#: {
  if (*!twister !iswm $$1) halt
  inc -e %twister.running [ $+ [ $chan ] $+ . $+ [ $network ] ]
  if (%twister.running [ $+ [ $chan ] $+ . $+ [ $network ] ] == 1) {
    unset %twister.num [ $+ [ $chan ] $+ . $+ [ $network ] ]
    msg $chan $nick Has Started Playing Twister:
    unset %moves
    unset %push
    %push = nobody
    %moves = 0
    var %fall $rand(1,4)
    while (%fall < 4) {
      inc %moves
      %push = $nick
      twistnum describe $chan Spins The Twister Board $iif(%twister.num [ $+ [ $chan ] $+ . $+ [ $network ] ],Again)
      var %colour $r(1,15)
      twistnum msg $chan $nick must put their $gettok(Left Hand.Right Hand.Left Foot.Right Foot,$r(1,4),46) on $+($chr(3),%colour,$chr(44),%colour,--)
      var %fall $rand(1,4)
    }
    var %noob = $nick(#,$r(1,$nick(#,0)))
    if (%fall > 3) twistnum msg $chan Sorry, $nick $+ ! You fell on %noob .  4,1 $+ $read(random.txt) 8,1 $+ You almost had %moves successful attempts!!!
    /write moves.txt $nick $+ : %moves
    .timer 1 $calc(%twister.num [ $+ [ $chan ] $+ . $+ [ $network ] ] + 1) unset %twister.running [ $+ [ $chan ] $+ . $+ [ $network ] ]
  }
  if (%twister.running [ $+ [ $chan ] $+ . $+ [ $network ] ] > 1) msg $chan Please wait your turn, $nick $+ .
}

#twister end

on *:TEXT:*:#: {
  if ($strip($1) == !push) {
    /msg $chan 1,13 $nick Just pushed %push off the mat!!!
    /msg $chan $nick CHEATED!!!

  }
  if ($strip($1) == !add) { /write random.txt $2- | /msg $chan 1,13 $nick Just Added $2- To The Random Twister Comments List }
  if ($strip($1) == !twisthelp) { notice $nick Twister commands are: !ten, !played, !twister, !push, !add, !best, !list, !twisthelp }
  if ($strip($1) == !best) { 
    var %file = moves.txt
    /filter -ffcuet 2 32 %file %file
    /msg $chan 4,1 $+ the person that had the most moves on the Twister mat is $read(moves.txt, 1 )
  }
  if ($strip($1) == !list) { play $nick random.txt }
  if ($strip($1) == !played) { msg $chan Twister has been played very badly $lines(moves.txt) times. }
  on *:TEXT:*:#: {
    if ($strip($1) == !ten) {
      msg $chan The ten best moves so far are:
      var %i = 0
      while (%i <= 10) {
        if ($read(moves.txt,%i)) {
          msg $chan $v1
        }
        inc %i
      }
    }
  } 


this is the whole thing.

What i am using to get the top ten is:
Code:
 on *:TEXT:*:#: {
    if ($strip($1) == !ten) {
      msg $chan The ten best moves so far are:
      var %i = 0
      while (%i <= 10) {
        if ($read(moves.txt,%i)) {
          msg $chan $v1
        }
        inc %i
      }
    }



How would i go about sorting the text file so that duplicates are not displayed?

here is a little piece of the textfile(moves.txt)

Code:
ShadowMaster: 14
ShadowMaster: 12
Corbie: 10
aceroms: 10
ShadowMaster: 10
Giggles: 9
Giggles: 9
wolluk: 8
Corbie: 8
Corbie: 8
Corbie: 8
ShadowMaster: 8
ShadowMaster: 8
ShadowMaster: 8
Giggles: 7
Corbie: 7