greetings.tcl 760 B

1234567891011121314151617181920212223242526272829
  1. # greetings.tcl
  2. #
  3. # This script greets people who join channels.
  4. # Enable for a channel with: .chanset #channel +greetings
  5. # Disable for a channel with: .chanset #channel -greetings
  6. # tested versions, might run on earlier versions
  7. package require Tcl 8.6
  8. package require eggdrop 1.8.4
  9. namespace eval ::greetings {
  10. # channel flag for enabling/disabling greetings
  11. setudef flag greetings
  12. }
  13. # greet users when they join a channel
  14. proc ::greetings::join_greeting { nick host hand chan } {
  15. # check channel flag if greetings are enabled in this channel
  16. if {![channel get $chan greetings]} {
  17. return 0
  18. }
  19. puthelp "NOTICE $nick :Hi ${nick}!"
  20. return 1
  21. }
  22. namespace eval ::greetings {
  23. bind join - * ::greetings::join_greeting
  24. putlog "Loaded greetings.tcl"
  25. }