Advertisement
ComputerTech

LockDown Script

Apr 14th, 2020
2,441
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #################################################################################################################################################################
  2. #THIS IS SCRIPT IS MADE BY COMPUTERTECH AND BLACKSHADOW
  3. #################################################################################################################################################################
  4. #Have A Script Request Use The Contact Options Below#
  5. #####################################################
  6. #CONTACT OPTIONS
  7. #
  8. #ComputerTech
  9. #IRC IRC.FREENODE.NET ##COMPUTERTECH123
  10. #EMAIL COMPUTERTECH312@GMAIL.COM
  11. #GitHub page : https://github.com/computertech312
  12. #####################################################
  13. #BLaCkShaDoW
  14. #IRC us.undernet.org #tcl-help
  15. #EMAIL blackshadow@tclscripts.net                                                     ##
  16. #GitHub page : https://github.com/tclscripts/
  17. #####################################################
  18. #ComputerTech Productions                           #
  19. #####################################################
  20. #Commands
  21. #
  22. # +999 To Activate The LockMode
  23. # -999 To DeActivate The LockMode
  24. # .clonescan to activate kickban scan
  25. # !masskick  kicks everyone not oped off the channel
  26. #
  27. #################################################################################################################################################################
  28. # START OF EDITING
  29. #################################################################################################################################################################
  30. # put # before die below
  31. #die "Please Make Sure You Have Edited lockdown.tcl The Way You Want It"
  32.  
  33. # Here you set the maximum number of clones to which the bot will act according to the configuration
  34.  
  35. set scn(maxclone) "3"
  36.  
  37. # Here you set the time frame in which the bot will scan the clone channel
  38.  
  39. set scn(time) "30"
  40.  
  41. #Set here what flags the clone scan command can activate. ( .clonescan )
  42.  
  43. set scn(flags) "o|o"
  44.  
  45. #Set to 1 for kickban
  46. #Set to 0 for notify
  47.  
  48. set scn(what) "0"
  49.  
  50. #If you set to scn (what) "1" set the reason for the kickban here.
  51.  
  52. set scn(reason) "This host% host% has exceeded the number of clones accepted on %chan%. For more info contact Operators."
  53.  
  54. #If you have set to scn (what) "1" set here the duration of the money. (minute)
  55.  
  56. set scn(btime) "30"
  57. #################################################################################################################################################################
  58. #END OF EDITING # NO EDTING NEEDED BELOW
  59. #################################################################################################################################################################
  60.  
  61.  
  62. bind pub  -  "+999"  do_lock_mode
  63.  
  64. bind pub  -  "-999"  do_unlock_mode
  65.  
  66. bind pub $scn(flags) .clonescan scanner
  67. setudef flag clonescan
  68.  
  69.  
  70. bind pub n|m !masskick massk
  71.  
  72.  
  73.  
  74. proc do_lock_mode {nick ushost handle chan text} {
  75.  
  76.     if {![botisop $chan]} {
  77.         putserv "privmsg $chan :/<pssst!/>  I'm not op'd  "
  78.         return 0
  79.     }
  80.  
  81.     if {![isop $nick $chan]} {
  82.         putserv "privmsg $chan :Sorry $nick, but you are not op'd in $chan right now"
  83.         return 0
  84.     }
  85.  
  86.  
  87.  
  88.     putserv "mode $chan +imVk lock"
  89.  
  90.  
  91. }
  92.  
  93.  
  94. proc do_unlock_mode {nick ushost handle chan text} {
  95.  
  96.     if {![botisop $chan]} {
  97.         putserv "privmsg $chan :/<pssst!/>  I'm not op'd  "
  98.         return 0
  99.     }
  100.  
  101.     if {![isop $nick $chan]} {
  102.         putserv "privmsg $chan :Sorry $nick, but you are not op'd in $chan right now"
  103.         return 0
  104.     }
  105.  
  106.  
  107.     putserv "mode $chan -imVk lock"
  108.  
  109. }
  110.  
  111.  
  112. if {![info exists clonescanner_running]} {
  113.     timer $scn(time) clonescan:timer
  114.     set clonescanner_running 1
  115. }
  116.  
  117.  
  118. proc scanner {nick host hand chan arg} {
  119.     global scn
  120.     array set clones [list]
  121.     clonescan:act $chan $nick $hand 0 0
  122. }
  123.  
  124. proc clonescan:timer {} {
  125.     global scn
  126.     set type 1
  127.     set channels ""
  128.     foreach chan [channels] {
  129.         if {[validchan $chan] && [channel get $chan clonescan]} {
  130.             lappend channels $chan
  131.         }
  132.     }
  133.     if {$channels != ""} {
  134.         clonescan:act $channels "nick" "chan1" 1 0
  135.     }
  136. }
  137.  
  138. proc clonescan:act {channels nick hand type counter} {
  139.     global scn botnick
  140.     set chan [lindex $channels $counter]
  141.     set cc [expr $counter + 1]
  142.     set found_clones 0
  143.     set found_mask ""
  144.     set theclones ""
  145.     array set clones [list]
  146.     if {$chan != ""} {
  147.         set replace(%chan%) $chan
  148.         foreach user [chanlist $chan] {
  149.             set host [string tolower [lindex [split [getchanhost $user $chan] @] 1]]
  150.             if {[string match "*undernet.org*" $host]} {
  151.                 continue
  152.             }
  153.             set replace(%host%) $host
  154.             lappend clones($host) $user
  155.         }
  156.         foreach clone [array names clones] {
  157.             set userlist [join $clones($clone)]
  158.             if {[llength [split $userlist]] >= $scn(maxclone)} {
  159.                 set found_clones 1
  160.                 lappend found_mask $clone
  161.                 lappend theclones $clones($clone)
  162.                 if {$type == "0"} {
  163.                     putserv "PRIVMSG $nick :We Found [llength [split $userlist]] clones on $chan from the host $clone. these are: [join $clones($clone) ", "]"
  164.                 }
  165.             }
  166.         }
  167.         if {$found_clones == "1"} {
  168.             if {$type == "1"} {
  169.                 putserv " @$chan :[llength [split $theclones]] $found_mask. These are: [join $theclones " ,"]"
  170.             }
  171.             if {$scn(what) == "1"} {
  172.                 foreach m $found_mask {
  173.                     set mask "*!*@$m"
  174.                     set replace(%chan%) $chan
  175.                     set reason [string map [array get replace] $scn(reason)]
  176.                     newchanban $chan $mask $botnick $reason $scn(btime)
  177.                 }
  178.             }
  179.         }
  180.     }
  181.     if {([lindex $channels $cc] != "") && ($type == "1")} {
  182.         utimer 5 [list clonescan:act $channels $nick $hand $type $cc]
  183.     }
  184.     if {($type == "0") && ($found_clones == "0")} {
  185.         putserv "PRIVMSG $chan :\005\[BT\]\005 We didn't find clones on $chan."
  186.     }
  187. }
  188.  
  189.  
  190. proc massk {nick host hand chan var} {
  191.     global botnick
  192.     if {$var != ""} { set reason $var } else { set reason "cleaning up channel" }
  193.     if {[isop $botnick $chan]} {
  194.         putlog "masskick activated on $chan by $nick!"
  195.         putquick "MODE $chan +im"
  196.         timer 2 "puthelp \"MODE $chan -im\""
  197.         foreach user [chanlist $chan] {
  198.             if {![isop $user $chan] && ![matchattr [nick2hand $user $chan] b|b $chan] && ![matchattr [nick2hand $user $chan] o|o $chan]} {
  199.                 putkick $chan $user $reason
  200.             }
  201.         }
  202.     } else { puthelp "NOTICE $nick :Gimme ops first!" }
  203. }
  204.  
  205. putlog "lockdown.tcl Created By ComputerTech and BLaCkShaDoW Loaded Successfully"
  206.  
  207. ##########################################################################################################################################
  208. #CREATED BY COMPUTERTECH AND BLACKSHADOW
  209. ##########################################################################################################################################
Advertisement
RAW Paste Data Copied
Advertisement