set welc(msg1) "Message in 1st line" set welc(msg2) "Message in 2nd line" set welc(chan) "#MyChannel" set welc(type) "1" bind join - #MyChannel* givewelcome proc givewelcome {nick uhost hand chan} { global welc set welctxt1 $welc(msg1) set welctxt2 $welc(msg2) regsub -all "%nick" $welctxt1 "$nick" welctxt1 regsub -all "%nick" $welctxt2 "$nick" welctxt2 regsub -all "%chan" $welctxt1 "$chan" welctxt1 regsub -all "%chan" $welctxt2 "$chan" welctxt2 switch $welc(type) { 1 { puthelp "NOTICE $nick :$welctxt1" puthelp "NOTICE $nick :$welctxt2" } 2 { puthelp "PRIVMSG $nick :$welctxt1" puthelp "PRIVMSG $nick :$welctxt2" } } } putlog "Channel Greeting"