BT.badhost.tcl 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #########################################################################
  2. ## BlackTools - The Ultimate Channel Control Script ##
  3. ## One TCL. One smart Eggdrop ##
  4. #########################################################################
  5. ########################## BADHOST TCL ##############################
  6. #########################################################################
  7. ## ##
  8. ## BlackTools : http://blacktools.tclscripts.net ##
  9. ## Bugs report : http://www.tclscripts.net/ ##
  10. ## GitHub page : https://github.com/tclscripts/BlackToolS-TCL ##
  11. ## Online Help : irc://irc.undernet.org/tcl-help ##
  12. ## #TCL-HELP / UnderNet ##
  13. ## You can ask in english or romanian ##
  14. ## ##
  15. #########################################################################
  16. proc badhost:protect {nick host hand chan} {
  17. global black botnick
  18. set uhost [lindex [split $host @] 1]
  19. set chan1 $chan
  20. set found_bad ""
  21. if {![validchan $chan]} { return }
  22. if {[setting:get $chan badhost]} {
  23. if {[matchattr $hand $black(exceptflags) $chan]} { return }
  24. set bl_protect [blacktools:protect $nick $chan]
  25. if {$bl_protect == "1"} { return }
  26. if {![botisop $chan] && ![setting:get $chan xonly]} { return }
  27. set gethost [check:except $uhost $chan $black(badhostword) $black(badhostexcept) "BADHOST"]
  28. set check_word [check:file:word $chan $gethost "BADHOST"]
  29. if {$check_word != ""} {
  30. set found_bad $check_word
  31. }
  32. if {$found_bad != ""} {
  33. blacktools:banner:2 $nick "BADHOST:$found_bad" $chan $chan1 $host "0" ""
  34. if {[link:status $chan] == "1"} {
  35. foreach c [link:chan:get $chan] {
  36. blacktools:banner:2 $nick "BADHOST:$found_bad" $c $c $host "1" ""
  37. }
  38. blacktools:link_ban2 [link:get] 0
  39. } else { who:chan $chan }
  40. }
  41. }
  42. }
  43. proc badhost:module {nick host hand chan arg} {
  44. global black lastbind
  45. set type 0
  46. set chan1 "$chan"
  47. set why [lindex [split $arg] 0]
  48. set badh [join [lrange [split $arg] 1 end]]
  49. set number [lindex [split $arg] 1]
  50. if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
  51. set chan "$why"
  52. set why [lindex [split $arg] 1]
  53. set badh [join [lrange [split $arg] 2 end]]
  54. set number [lindex [split $arg] 2]
  55. }
  56. set return [blacktools:mychar $lastbind $hand]
  57. if {$return == "0"} {
  58. return
  59. }
  60. prot:module:process $nick $host $hand $chan $chan1 $why $badh $type $number "badhost"
  61. }
  62. ##############
  63. #########################################################################
  64. ## END ##
  65. #########################################################################