BT.badident.tcl 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #########################################################################
  2. ## BlackTools - The Ultimate Channel Control Script ##
  3. ## One TCL. One smart Eggdrop ##
  4. #########################################################################
  5. ########################## BADIDENT 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 badident:protect:join {nick host hand chan} {
  17. global black botnick
  18. set found_ident ""
  19. if {![validchan $chan]} { return }
  20. if {[setting:get $chan badident]} {
  21. set chan1 $chan
  22. if {[matchattr $hand $black(exceptflags) $chan]} { return }
  23. set bl_protect [blacktools:protect $nick $chan]
  24. if {$bl_protect == "1"} { return }
  25. set ident "[string map {"~" ""} [string tolower [lindex [split $host "@"] 0]]]"
  26. set text [check:except $ident $chan $black(badidentwords) $black(badidentexcept) "BADIDENT"]
  27. set check_word [check:file:word $chan $text "BADIDENT"]
  28. if {$check_word != ""} {
  29. set found_ident $check_word
  30. }
  31. if {$found_ident != ""} {
  32. blacktools:banner:2 $nick "BADIDENT:$found_ident" $chan $chan1 $host "0" ""
  33. if {[link:status $chan] == "1"} {
  34. foreach c [link:chan:get $chan] {
  35. blacktools:banner:2 $nick "BADIDENT:$found_ident" $c $c $host "1" ""
  36. }
  37. blacktools:link_ban2 [link:get] 0
  38. } else { who:chan $chan }
  39. }
  40. }
  41. }
  42. proc badident:module {nick host hand chan arg} {
  43. global black lastbind
  44. set type 0
  45. set chan1 "$chan"
  46. set why [lindex [split $arg] 0]
  47. set badi [join [lrange [split $arg] 1 end]]
  48. set number [lindex [split $arg] 1]
  49. if {[regexp {^[&#]} $why] && [matchattr $hand nmo|M $why]} {
  50. set chan "$why"
  51. set why [lindex [split $arg] 1]
  52. set badi [join [lrange [split $arg] 2 end]]
  53. set number [lindex [split $arg] 2]
  54. }
  55. set return [blacktools:mychar $lastbind $hand]
  56. if {$return == "0"} {
  57. return
  58. }
  59. prot:module:process $nick $host $hand $chan $chan1 $why $badi $type $number "badident"
  60. }
  61. ##############
  62. #########################################################################
  63. ## END ##
  64. #########################################################################