Posted to tcl by render2 at Thu May 23 09:46:02 GMT 2019view pretty

bind msgm - * hello_response


proc hello_response { nick uhost handle text } {
    global seen
    if {![info exists seen($nick)]} {
        set seen($nick) 1
        putserv "privmsg $nick :Hello !"
    }
    
    # If you want to do something different if it's not the first time,
    # it goes in the else clause here.

   if {[info exists seen($nick)] == 1} {
        set seen($nick) 2
        putserv "privmsg $nick :what are you doing ?"
        }

}

Comments

Posted by sebres at Thu May 23 10:32:50 GMT 2019 [text] [code]

proc hello_response { nick uhost handle text } { global seen if {![info exists seen($nick)]} { set seen($nick) 0 putserv "privmsg $nick :Hello !" return; # first time } incr seen($nick) switch $seen($nick) { 1 { putserv "privmsg $nick :what are you doing ?" } 2 { putserv "privmsg $nick : this is my 3rd message to you!" } } ... }