4
0

greetings.tcl 892 B

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