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

  1. bind msgm - * hello_response
  2.  
  3.  
  4. proc hello_response { nick uhost handle text } {
  5. global seen
  6. if {![info exists seen($nick)]} {
  7. set seen($nick) 1
  8. putserv "privmsg $nick :Hello !"
  9. }
  10.  
  11. # If you want to do something different if it's not the first time,
  12. # it goes in the else clause here.
  13.  
  14. if {[info exists seen($nick)] == 1} {
  15. set seen($nick) 2
  16. putserv "privmsg $nick :what are you doing ?"
  17. }
  18.  
  19. }
  20.  

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!" } } ... }