guardchan.tcl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. # - choose if you want just kicks or bans too
  10. # - load script
  11. # - for channels you want to protect: .chanset #channel +guardchan
  12. # (default has invalid char in to make sure you set it)
  13. set guardchan_owner "YOUR_NICK_HERE%"
  14. # set to 1 to ban users rather than just kick them
  15. set guardchan_ban 0
  16. # Stop editing here unless you like TCL
  17. #
  18. #
  19. #
  20. #
  21. #
  22. #
  23. # No really, TCL is a world of pain ;)
  24. bind join - *!*@* guardchan_join
  25. setudef flag guardchan
  26. proc guardchan_join { nick host handle channel } {
  27. global guardchan_owner guardchan_ban
  28. if {![channel get $channel guardchan]} {
  29. return 0
  30. }
  31. if {$handle == "*"} {
  32. if [botisop $channel] {
  33. if {!$guardchan_ban} {
  34. putkick $channel $nick "You are not permitted to be in here"
  35. puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel"
  36. } else {
  37. set ban [maskhost "$nick!$host"]
  38. newchanban $channel $ban "guardchan" "Banned for not being in userfile"
  39. puthelp "PRIVMSG $guardchan_owner :Banned $nick from $channel"
  40. }
  41. return 0
  42. } else {
  43. puthelp "PRIVMSG $guardchan_owner :HELP! $nick has joined $channel and I can't do anything about it :("
  44. return 0
  45. }
  46. }
  47. }