ok, made some other changes:
Code:
;;;; chanlist
#chanlist on
raw 321:*:{
  window -hn "Channels list"
 [color:red] if ($appactive == $true) { 
    if ($window(%active).type == channel) { window -a %active }
  }[/color]
[color:blue] ;;; only sets focus if a channel window was $active[/color]

  window -hls @chanlist1 
  window @chanlist 10 100 788 200
}
raw 322:*:{
  aline @chanlist1 $right(... $+ $3,4) - $2 - $4-
  halt
}
raw 323:*:{
   [color:red]set %showtime $ctime[/color]
[color:blue];;; settup to show the delay, remove if you dont want this (as well as the line below that has $duration in it) [/color]


  write -c @chanlist.txt
  savebuf @chanlist1 @chanlist.txt
  clear @chanlist1
  reversesort
 [color:red] .timerrelist 1 $r(60,120) chanrelist [/color]
}

alias chanrelist {
  [color:red] echo -s $duration($calc($ctime - %showtime))[/color]
[color:blue];;;; this shows what the delay was in status, remove this with the settup above if you dont want to see the delay[/color]

  set %active $active
  clear @chanlist
  list
}

alias reversesort {
  var %clistlines = $lines(@chanlist.txt)
  while (%clistlines) {
    aline @chanlist $read -l $+ %clistlines @chanlist.txt
    dec %clistlines
  }
  sline @chanlist 10
}
;;;;;;
#chanlist end