proc db_list_clean {} { # do stuff here } proc db_proc { nick uhost handle text } { if {[lindex $text 1] == "clean"} { putquick "PRIVMSG $nick :cleaning the databse" set temp [db_list_clean] if {!$temp} { putquick "PRIVMSG $nick :done" } else { putquick "PRIVMSG $nick :error" } } }