guardchan.tcl 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # GuardChan by JamesOff
  2. # Kickbans people if they're not in the bot's userfile
  3. # No other filtering options, sorry
  4. #
  5. # Released under the BSD licence
  6. # http://jamesoff.net/site/projects/eggdrop-scripts/guardchan
  7. # Instructions:
  8. # - edit the owner setting below to your nick
  9. # - load script
  10. # - for channels you want to protect: .chanset #channel +guardchan
  11. # Only configurable setting (default has invalid char in to make sure you set it)
  12. set guardchan_owner "YOUR_NICK_HERE%"
  13. # Stop editing here unless you like TCL
  14. bind join - *!*@* guardchan_join
  15. setudef flag guardchan
  16. proc guardchan_join { nick host handle channel } {
  17. global guardchan_owner
  18. if {![channel get $channel guardchan]} {
  19. return 0
  20. }
  21. if {$handle == "*"} {
  22. if [botisop $channel] {
  23. putkick $channel $nick "You are not permitted to be in here"
  24. puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel"
  25. return 0
  26. } else {
  27. puthelp "PRIVMSG $guardchan_owner :HELP! $nick has joined $channel and I can't do anything about it :("
  28. return 0
  29. }
  30. }
  31. }