noiphost.tcl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # no ip checker for eggdrop
  2. # (c) James Seward 2003-6
  3. # version 1.1
  4. # http://www.jamesoff.net/site/projects/eggdrop-scripts/noiphost
  5. # james@jamesoff.net
  6. # Released under the GPL
  7. ## INSTRUCTIONS
  8. ###############################################################################
  9. # This script bans users joining your channel with non-resolving hosts. Bans
  10. # last for a day. (Change the 1440 in the line near the end of the script to
  11. # change this).
  12. #
  13. # Users who are +o, +v, or +f in your bot (local or global) are left alone.
  14. #
  15. # Enable the 'noiphosts' flag for channels you want to protect.
  16. # --> .chanset #somechannel +noiphosts
  17. #
  18. # Enable the debug level on the partyline for some debug output
  19. # --> .console +d (to enable)
  20. # --> .console -d (to disable)
  21. ## CODE
  22. ###############################################################################
  23. #bind to joins
  24. bind join - *!*@* bancheck_join
  25. #add our channel flag
  26. setudef flag noiphosts
  27. #it all happens in here
  28. proc bancheck_join { nick host handle channel } {
  29. #check we're active
  30. if {![channel get $channel noiphosts]} {
  31. return 0
  32. }
  33. putloglev d * "noiphosts: join by $host to $channel"
  34. #don't apply to friends, voices, ops
  35. if {[matchattr $handle +fov|+fov $channel]} {
  36. putloglev d * "noiphosts: $nick is a friend"
  37. return 0
  38. }
  39. #check host
  40. if [regexp {@([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})$} $host matches ip] {
  41. putlog "noiphosts: $nick has an un-resolved host ($ip), banning"
  42. set banhost "*@$ip"
  43. newchanban $channel $banhost "noiphosts" "Non-resolving host" 1440
  44. }
  45. }
  46. putlog "noiphost 1.1 by JamesOff loaded"