Code: Select all
bind chjn - * proc_name
proc proc_name {botname handle channel flag idx uhost} {
global array_name
set handle [string tolower $handle]
set botname [string tolower $botname]
set array_name($handle@$botname) [list [clock seconds] $uhost] ;# Whatever else you want in the list.
}
proc get_handle_of_last_logged_in {} {
global array_name
set temp ""
foreach {user value} [array get array_name] {
lappend temp [list [lindex $value 0] [lindex [split $user @] 0]]
}
set temp [lsort -dictionary -index 0 $temp]
return [lindex [lindex $temp end] 1]
}