
ON *:JOIN:#:{
  if ($nick == $me) { 
    nicklust Mark $window($chan).hwnd nLUST_CallBack rowselect tooltips balloontips hideempty hottrack dlgframe clientedge underlinehot
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\op.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\voice.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\laud.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\half.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\protect.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\protect.ico)
    dll DLL\nickLUST3.dll AddIcon $chan > $shortfn($mircdir\ico\owner.ico)
    dll DLL\nickLUST3.dll SetBranchImage $chan > 7
    dll DLL\nickLUST3.dll SetGroupText $chan 1 >  Normali
    dll DLL\nickLUST3.dll AddGroup $chan 10 ++ 2 >  Voice +
    dll DLL\nickLUST3.dll AddGroup $chan 11 @+ 1 >  Operatori @ 
    dll Dll\nickLUST3.dll AddGroup $chan 12 % 4 >  Halfop %
    dll DLL\nickLUST3.dll AddGroup $chan 14 &&+ 6 >  Protect &&
    dll DLL\nickLUST3.dll AddGroup $chan 15 ~+ 7 >  Owner ~
    dll DLL\nickLUST3.dll SetGroupView $chan 1 normal
    dll DLL\nickLUST3.dll SetGroupView $chan 10 normal
    dll DLL\nickLUST3.dll SetGroupView $chan 11 normal
    dll DLL\nickLUST3.dll SetGroupView $chan 12 normal
    dll DLL\nickLUST3.dll SetGroupView $chan 14 normal
    dll DLL\nickLUST3.dll SetGroupView $chan 15 normal
    dll DLL\nickLUST3.dll SetGroupIcon $chan 1 3
    dll DLL\nickLUST3.dll SetGroupPos $chan 15 start
    dll DLL\nickLUST3.dll SetGroupPos $chan 14 end
    dll DLL\nickLUST3.dll SetGroupPos $chan 11 end
    dll DLL\nickLUST3.dll SetGroupPos $chan 12 end
    dll DLL\nickLUST3.dll SetGroupPos $chan 10 end
    dll DLL\nickLUST3.dll SetGroupPos $chan 1 end
    dll DLL\nickLUST3.dll SetColor $chan bkg $color(1)
    dll DLL\nickLUST3.dll SetColor $chan text $color(15)
    dll DLL\nickLUST3.dll SetColor $chan tipbkg $color(1)
    dll DLL\nickLUST3.dll SetColor $chan tiptext $color(7)
    dll DLL\nickLUST3.dll SetColor $chan hottext $color(11)
    dll DLL\nickLUST3.dll SetColor $chan divider $color(4) $color(1)
    dll DLL\nickLUST3.dll SetHeaderFontStyle $chan Book antiqua
    dll DLL\nickLUST3.dll SetHeaderColor $chan 15 $color(12)
    dll DLL\nickLUST3.dll SetHeaderColor $chan 11 $color(7)
    dll DLL\nickLUST3.dll SetHeaderColor $chan 12 $color(9)
    dll DLL\nickLUST3.dll SetHeaderColor $chan 10 $color(11)
    dll DLL\nickLUST3.dll SetHeaderColor $chan 14 $color(8)
    dll DLL\nickLUST3.dll SetHeaderColor $chan 1 $color(13)
  }
  haltdef
}

alias nicklust { dll $+(",$mircdirDLL\nickLUST3.dll,") $1- }
alias nlust_callback {
  if ($1 = tooltip) {
    var %extra
    if ($3 == $me) %extra
    nicklust SetTipTitle $2 1 > Info: $3 %extra
    return Stato: $nlist_pnick($remove($nick($2,$3).pnick,$3)) $+ $crlf $+ Idle: $duration($nick($2,$nick($2,$3)).idle) $+ $crlf $+ Host: $gettok($address($3,-1),2,64),$ifmatch,Sconosciuto) $+ $crlf $+ Ident: $gettok($gettok($address($3,-1),2,33),1,64) $+ $crlf $+ Canali: $_comchans($3,32)) $+ $crlf $+ Notify List: $iif($notify($3),Si,No)
  }
}
alias nlist_pnick {
  if ($1 = @) { return Operatore }
  elseif ($1 = ~) { return owner }
  elseif ($1 = &) { return Protect }
  elseif ($1 = +) { return voice }
  elseif ($1 = %) { return halfop }
  elseif ($1 = $null) { return Normale }
}
alias _comchans {
  var %tokk = $iif($2,$ifmatch,$chr(32)), %iii = 1, %chh
  while (%iii <= $comchan($1,0)) {
    %chh = $addtok(%chh,$comchan($1,%iii),%tokk) | inc %iii
  }
  return $sorttok(%chh,%tokk)
}
