All pastes #770881 Raw Edit

timer notice

public text v1 · immutable
·published 2007-11-12 17:41 UTC
rendered paste body
set welc(msg1) "1st line message" 
set welc(msg2) "2nd line message"    
set welc(chan) "#My.Channel"
set welc(type) "1"    

bind join - #My.Channel* 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 { 
      utimer 5 puthelp "NOTICE $nick :$welctxt1" 
      utimer 5 puthelp "NOTICE $nick :$welctxt2" 
    }    
    2 { 
      utimer 5 puthelp "PRIVMSG $nick :$welctxt1" 
      utimer 5 puthelp "PRIVMSG $nick :$welctxt2" 
    }    
  }    
}    
putlog "Channel Greeting"