Advertisement
Guest User

anticlon.tcl

a guest
Sep 26th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.92 KB | None | 0 0
  1. # $Id: cloneflood.tcl, v4.24.b eggdrop-1.6.17 2005/06/29 01:22:47 Exp $
  2.  
  3. # Begin - Mass Clone Join/Part and Revolving Door Protection v4.24.b
  4. # Build date: 21st June 2005
  5. # Last updated: 29th June 2005
  6. # Copyright © 1999-2005 awyeah (awyeah@awyeah.org)
  7. # This TCL script is designed to work with eggdrop v1.6.17 or higher
  8.  
  9. #########################################################################
  10. # Mass Clone Join/Part and Revolving Door Protection v4.24.b #
  11. # #
  12. # #
  13. # Author: awyeah 29th June 2005 #
  14. # Email: awyeah@awyeah.org Build version 4.24.b #
  15. # Copyright © 2005 awyeah All Rights Reserved http://www.awyeah.org/ #
  16. #########################################################################
  17. # #
  18. # ####### #
  19. # PURPOSE #
  20. # ####### #
  21. # #
  22. # This script basically serves the purpose to prevent mass joining #
  23. # clones and botnets to join channels. This script detects fast joining #
  24. # parting clones and also detects for mass join/part, fast join/part, #
  25. # revolving door floods by clones. It also has additional supporting #
  26. # modules which gives it extra features to eliminate clones. This #
  27. # script is very efficient and can detect almost any kind of mass join, #
  28. # part and revolving door floods. #
  29. # #
  30. # This type of script is most wanted on channels being flooded by bots. #
  31. # I made this script to eliminate floods caused by clones and bots, #
  32. # since they are a nuisance and hard to deal with. Generally tsunami #
  33. # and avalanche floods are stopped and controlled by this script since #
  34. # this script detects clones as they join, so they have no time to #
  35. # implement a flood since they are detected on join. Tsunami and #
  36. # avalanche floods as described by the famous sentinel.tcl are rapid #
  37. # floods originating from single hosts with a variety of numerous #
  38. # control codes and characters embedded in them. #
  39. # #
  40. # This script can be run on almost any network on IRC because it does #
  41. # not utilize any network services. #
  42. # #
  43. #########################################################################
  44. # #
  45. # ########### #
  46. # DESCRIPTION #
  47. # ########### #
  48. # #
  49. # This script will make your eggdrop bot detect mass joining or parting #
  50. # clones and bots where the script is working on and will punish them #
  51. # immediately and effectively. #
  52. # #
  53. # This script also checks for revolving door floods, which are defined #
  54. # as continuous join/part floods normally containing part messages with #
  55. # a variety of control codes -- another way to flood a channel. #
  56. # #
  57. # The bot owner can select the punishment level for clones. Also kick #
  58. # messages can be defined and the clone nick kick counter can be #
  59. # selected to be switched on or off. #
  60. # #
  61. # Additionally this script has 3 supporting modules, which are optional #
  62. # to utilize. These three modules consist of detecting fast join/parts, #
  63. # excessive channel clones and suspected mass joining bots and clones. #
  64. # #
  65. #########################################################################
  66. # #
  67. # ######## #
  68. # FEATURES #
  69. # ######## #
  70. # #
  71. # (1) This script has three '3' basic types of detection systems: #
  72. # (a) Clone Join Detection System #
  73. # (b) Clone Part Detection System #
  74. # (c) Clone Join/Part Revolving Door Detection System #
  75. # #
  76. # (2) This script has '2' settings of channels to work on. #
  77. # (a) Can be activated to work on user defined channels. #
  78. # (b) Can be activated to work on all the channels the bot is on. #
  79. # #
  80. # (3) This script has various options for clone detection such as #
  81. # detecting for unresolved idents, matching idents, matching hosts #
  82. # or similar characters in nicks. #
  83. # #
  84. # (4) This script has separate op, voice, user flag, nick and mask #
  85. # exemption options. It also exempt users with unresolved idents. #
  86. # #
  87. # (5) This script has 4 levels of punishment for clones - all of them #
  88. # being filter kicks, 1 placing sticky bans, another placing global #
  89. # bans and the other two general server bans. #
  90. # #
  91. # (6) You can also select to use the scripts default kick messages when #
  92. # punishing clones or define your own kick messages and use them. #
  93. # #
  94. # (7) This script has an effective channel locking mechanism, which can #
  95. # lock channels to specific modes once a clone flood has been #
  96. # detected. Also a lock notification notice or message can be sent #
  97. # to the channel to notify the users and ops that the channel has #
  98. # been locked since clones have been detected. #
  99. # #
  100. # (8) This script also has a kick counter, which keeps a record of how #
  101. # many clones are kicked by the script. The number of clones kicked #
  102. # are be shown in the end of each kick message if the clone kick #
  103. # counter has been enabled. #
  104. # #
  105. # (9) Also available are 30 types of banmasks, which can be selected #
  106. # with varying wilcards. There are TEN '10' normal banmasks then 10 #
  107. # separate banmasks for the '?' wildcard and 10 separate banmasks #
  108. # for the '*' wildcard. All these banmasks enforce greater range #
  109. # for banning clones. #
  110. # #
  111. # (10) This script also has different speed queuing options for greater #
  112. # kicking performance. Speed queues improve scripts effectiveness. #
  113. # This script has 6 different types of speed queues to select from #
  114. # so the kicking and banning rate can be selected upon the bot #
  115. # owners will so the bot doesn't get Excess Flood or doesn't kick #
  116. # out clones very slowly. #
  117. # #
  118. # (11) Also this script has 3 precise modules which can be loaded and #
  119. # unloaded optionally. These 3 modules provide more enhancements #
  120. # when dealing with clones. #
  121. # (a) Clone Join/Part Scanner (Revolving door) #
  122. # (b) Excessive Clone Scanner (Clones in channel) #
  123. # (c) Suspected Mass Join Botnet Scanner (Botnet join) #
  124. # #
  125. # (12) The EXCESSIVE CLONE SCANNER module is one of most efficient #
  126. # scanning system used to eliminate excessive clones residing in #
  127. # channels. The scan be made to execute when a user join a channel #
  128. # or through a timer which is executed continuously after the #
  129. # defined number of minutes. #
  130. # #
  131. #########################################################################
  132. # #
  133. # ############ #
  134. # REQUIREMENTS #
  135. # ############ #
  136. # #
  137. # The following requirements must be taken into consideration before #
  138. # utilizing this script further: #
  139. # #
  140. # (Fields marked with a '*' are compulsory) #
  141. # #
  142. # (*1) You must be running EGGDROP version 1.6.17 or higher. #
  143. # (*2) You must have TCL v8.3 or higher installed on the system. #
  144. # (3) You must have the latest TCL PATCH LEVEL for v8.3 or above. #
  145. # #
  146. # To FIND the TCL VERSION and PATCH LEVEL your shell is running: #
  147. # (1) At your shell prompt type: tclsh #
  148. # (NOTE: Select step 'a' or step 'b' in the next instruction) #
  149. # (a) If you have several different versions of tcl installed on #
  150. # your system, pick the latest version which is installed. #
  151. # (i) At shell prompt type: tclsh8.3 (and go to step 2) #
  152. # (b) If you have only one version of pick that one or continue #
  153. # with 'tclsh' only if it doesn't say to use another name. #
  154. # (2) To find your tcl version type: info tclversion #
  155. # (3) To find your tcl patch level type: info patchlevel #
  156. # (4) To exit tclsh type: exit #
  157. # #
  158. #########################################################################
  159. # #
  160. # ############ #
  161. # INSTALLATION #
  162. # ############ #
  163. # #
  164. # This quick installation tutorial consists of 6 steps. Please follow #
  165. # all steps correctly in order to setup your script. #
  166. # #
  167. # #
  168. # (1) UNZIP the zipped file cloneflood.zip and you will get the script #
  169. # source file cloneflood.tcl. #
  170. # #
  171. # (a) If you are unzipping the file on MICROSOFT WINDOWS and then want #
  172. # to upload the TCL file onto your shell you can use 'WINZIP' or #
  173. # any other compatible windows unzipping software. #
  174. # #
  175. # (b) If you have uploaded the zipped file onto your shell and want to #
  176. # unzip it. You can use the TAR package available on your shell #
  177. # to unzip the script file: #
  178. # #
  179. # tar zxvf cloneflood.tar.gz #
  180. # #
  181. # (Note: This file is not gziped for UNIX operating systems so only #
  182. # WINZIP on Microsoft Windows can be used to unzip this file) #
  183. # #
  184. # #
  185. # (2) PLACE the unzipped file cloneflood.tcl file in your eggdrops #
  186. # '/scripts' folder along with your other TCL scripts. #
  187. # (Note: You have to upload the script file to your shell if you #
  188. # have unzipped it on your hard drive) #
  189. # #
  190. # (3) OPEN your eggdrops configuration (.conf) file and add a link at #
  191. # the bottom of the configuration file to the path of clone flood #
  192. # remover script, it would be: #
  193. # #
  194. # source scripts/cloneflood.tcl #
  195. # #
  196. # #
  197. # (4) SAVE your bots configuration file. #
  198. # #
  199. # (5) OPEN cloneflood.tcl and start configuring script variables. #
  200. # (START FROM: 'Start configuring variables from here!' #
  201. # END AT: 'Congratulations! Script configuration is now complete') #
  202. # #
  203. # (6) RESTART your eggdrop and your done! #
  204. # #
  205. #########################################################################
  206. # #
  207. # ######## #
  208. # VERSIONS #
  209. # ######## #
  210. # #
  211. # v4.24.b - Fixed a chanset bug encoutered for setting specific #
  212. # (29/06/05) channel join flood settings on rehash and restart. #
  213. # - Added a new bind on init-server and rehash to a timely #
  214. # delayed procedure for it to change specific channel #
  215. # settings for flood-join and to check if the bot is on the #
  216. # channels defined for it before the settings are modified. #
  217. # - Added a control code stripping filter clone:strip:codes #
  218. # for filtering control codes. If the eggdrop version is #
  219. # less than 1.6.17 use a string map and regsub filter and #
  220. # if the eggdrop version is greater than or equal to 1.6.17 #
  221. # then utilize the 'stripcodes' function. #
  222. # - Added more descriptive comments in the settings example #
  223. # and explanation fields. #
  224. # #
  225. # v4.18.b - Initial release of script. #
  226. # (21/06/05) #
  227. # #
  228. #########################################################################
  229. # #
  230. # ######## #
  231. # CONTACTS #
  232. # ######## #
  233. # #
  234. # (*) For any suggestions, comments, questions or bugs reports feel #
  235. # free to email me at: #
  236. # #
  237. # awyeah@awyeah.org #
  238. # #
  239. # #
  240. # (*) You can also contact me on MSN Messenger. My MSN ID is: #
  241. # #
  242. # awyeah@awyeah.org #
  243. # #
  244. # #
  245. # (*) You can also catch me on The DALnet Network: #
  246. # #
  247. # /server irc.dal.net:6667, Nick: awyeah #
  248. # Channels: #eggdrops, #awyeah, #dalusers, #eleet #
  249. # #
  250. # (*) Also I am mostly available on my own IRC Network: #
  251. # #
  252. # /server irc.awyeah.org:6667, Nick: awyeah #
  253. # #
  254. # #
  255. # Note: I have a lot of people bothering me for scripts which they #
  256. # HAVEN'T configured properly themselves. So please read ALL the #
  257. # comments provided while configuring the variables and make sure #
  258. # you follow the same standard format as given in examples when #
  259. # setting each variable in the script. #
  260. # #
  261. #########################################################################
  262. # #
  263. # ######### #
  264. # COPYRIGHT #
  265. # ######### #
  266. # #
  267. # This program is a free software; you can distribute it under the #
  268. # terms of the GNU General Public License under Section 1 as published #
  269. # by the Free Software Foundation; either version 2 of the license, or #
  270. # (at your option) any later version. #
  271. # #
  272. # This program is distributed in the hope that it will be useful, #
  273. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  274. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  275. # GNU General Public License for more details. #
  276. # #
  277. # WARNING: #
  278. # This program is protected by copyright law and international #
  279. # treaties. Unauthorized reproduction of this program, or any portion #
  280. # of it, may result in severe civil penalties and will be prosecuted to #
  281. # the maximum extent possible under the law. #
  282. # #
  283. #########################################################################
  284. # #
  285. # ######### #
  286. # DOWNLOADS #
  287. # ######### #
  288. # #
  289. # Latest versions of this script can be found on the TCL archives of #
  290. # the following websites: #
  291. # #
  292. # (1) http://www.awyeah.org/ #
  293. # (2) http://www.egghelp.org/ #
  294. # (3) http://www.tclscript.com/ #
  295. # #
  296. #########################################################################
  297. # #
  298. # ####### #
  299. # CREDITS #
  300. # ####### #
  301. # #
  302. # (*) I would like to thank 'Sir_Fz' aka Opposing who helped me with #
  303. # this script by giving me ideas on how to improve the coding, #
  304. # making the script execute faster and be more efficient. #
  305. # #
  306. # (*) I give credit to 'user' for the improved banmask selector used #
  307. # in the script with 30 types of banmasks to choose from. #
  308. # #
  309. # (*) Also I would like to thank 'demond' for helping me with a last #
  310. # minute easier and effective solution for removing duplicate #
  311. # elements found in a list for the join and part flood protection. #
  312. # #
  313. # (*) Special thanks to 'LoVeGirL' who did the beta testing for this #
  314. # script and reported any pre-release bugs and errors encountered. #
  315. # #
  316. # #
  317. # ./awyeah #
  318. # #
  319. #########################################################################
  320.  
  321.  
  322. ##############################################
  323. ### Start configuring variables from here! ###
  324. ##############################################
  325.  
  326. #--------------------------------------#
  327. # SET CHANNEL ACTIVATION OPTIONS #
  328. #--------------------------------------#
  329.  
  330. #Set the type of channels you would like this script to work on.
  331. #USAGE: [1/2] (1=USER DEFINED CHANNELS, 2=ALL CHANNELS THE BOT IS ON)
  332. #Use '1' for 'user defined channels' (Will detect clone floods only on the channels defined for the script)
  333. #Use '2' for 'all the channels' the bot is on. (Will detect clone floods on every channel the bot is opped on)
  334. set clone_channel_type "2"
  335.  
  336. ###USE THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1'###
  337. #Set this if you have set the previous setting to '1' for user defined channels, if not then you do
  338. #not need to configure this option. Set the channels here on which this script would work.
  339. #USAGE: set clone_channels "#channel1 #channel2 #channel3" (separate each element with a space)
  340. set clone_channels "#awyeah"
  341.  
  342.  
  343. #------------------------------------#
  344. # SET CLONE DETECTION SETTINGS #
  345. #------------------------------------#
  346.  
  347. #NOTE: Settings in this section of the script are very important and should be configured properly,
  348. #for the script to work efficiently.
  349.  
  350. ### EXPLANATION OF MECHANISM ###
  351. #Settings listed below the define the 'number' of clone joins, parts in less than
  352. #a definite interval of 'seconds'. (Please read these carefully before script setup)
  353. #######################################################################################
  354. ##[1] A value for JOIN FLOOD '3:5' can be read as: ##
  355. ## - '3' or more joins by a single host in less than or equal to '5' seconds. ##
  356. #######################################################################################
  357. ##[2] A value for REVOLVIND DOOR FLOOD '2:3' can be read as: ##
  358. ## - '2' or more join/parts by a single host in less than or equal to '3' seconds. ##
  359. #######################################################################################
  360.  
  361.  
  362. ### RECOMMENDED SETTINGS ###
  363. #Please use the recommended settings or settings similar to the recommended
  364. #ones for optimal results. (If you don't understand leave them as they are)
  365. #FORMAT: <how_many_[joins|parts|revolving_doors]>:<how_many_seconds>
  366. ################################################################################
  367. ##[1] Values recommended for JOIN FLOOD are: ##
  368. ## a) 2:2 b) 2:3 c) 3:3 d) 3:4 e) 4:3 f) 4:5 g) 5:3 h) 5:4 ##
  369. ################################################################################
  370. ##[2] Values recommended for PART FLOOD are: ##
  371. ## a) 2:1 b) 2:2 c) 2:3 d) 3:2 e) 3:3 f) 4:2 g) 4:3 h) 5:3 ##
  372. ################################################################################
  373. ##[3] Values recommended for REVOLVING DOOR FLOOD are: ##
  374. ## a) 2:2 b) 2:3 c) 2:4 d) 3:2 e) 3:4 f) 4:3 g) 4:4 h) 4:5 ##
  375. ################################################################################
  376. #Any 'number' and 'time limit' setting under '5' seconds would be good enough.
  377.  
  378.  
  379. ### CLONE JOIN FLOOD SETTING ###
  380. #Set how many 'JOINS' from a single *!*@host in how many 'SECONDS' would trigger a clone JOIN FLOOD.
  381. #If you want to DISABLE join flood detection, then set this value as '0' or '0:0'.
  382. #(Please use recommended or similar to recommended values for best performance)
  383. #USAGE: set clone_join_flood "number_of_joins:number_of_seconds"
  384. set clone_join_flood "2:2"
  385.  
  386. ### CLONE PART FLOOD SETTING ###
  387. #Set how many 'PARTS' from a single *!*@host in how many 'SECONDS' would trigger a clone PART FLOOD.
  388. #If you want to DISABLE part flood detection, then set this value as '0' or '0:0'.
  389. #(Please use recommended or similar to recommended values for best performance)
  390. #USAGE: set clone_part_flood "number_of_parts:number_of_seconds"
  391. set clone_part_flood "2:2"
  392.  
  393. ### CLONE REVOLDING DOOR (JOIN/PART) FLOOD SETTING ###
  394. #Set how many clone 'JOIN/PARTS' from a single *!*@host in how many 'SECONDS' would trigger a clone
  395. #REVOLVING DOOR FLOOD. (Please use recommended or similar to recommended values for best performance)
  396. #If you want to DISABLE join/part flood detection, then set this value as '0' or '0:0'.
  397. #USAGE: set clone_joinpart_flood "number_of_joins/parts:number_of_seconds"
  398. set clone_joinpart_flood "2:3"
  399.  
  400.  
  401. #-----------------------------------------#
  402. # SET CLONE IDENT DETECION SETTINGS #
  403. #-----------------------------------------#
  404.  
  405. #Set this if you only want to detect clones with similar a *!*host who have UNRESOLVED IDENTS (idents
  406. #with a '~' at the front). Mostly clones are loaded from open port proxies whose idents are not
  407. #resolved by IRC servers and are given an asterisk '~' in the front so they can be detected easily.
  408. #USAGE: [0/1] (0=DON'T CARE ABOUT IDENTS, 1=ONLY DETECT CLONES WITH UNRESOLVED IDENTS)
  409. #Use '0' if you want to make the bot check ALL types of idents.
  410. #Use '1' if you ONLY want the bot to check UNRESOLVED idents (idents with a '~' sign)
  411. #(Note: DISABLING this would be a good option so the bot can catch all types of clones)
  412. set clone_unresolved_ident "0"
  413.  
  414.  
  415. #-----------------------------------------#
  416. # SET CLONE FLOOD MODELOCK SETTINGS #
  417. #-----------------------------------------#
  418.  
  419. #Set this if you want to ENABLE 'channel mode locking' when a clone join, part or revolving door
  420. #flood occurs. This mode lock enforcement can prevent text/notice, avalanche and tsunami floods
  421. #from botnets and clones joining in fast.
  422. #Usage: [0/1] (0=OFF, 1=ON)
  423. set clone_modelock_switch "1"
  424.  
  425. ### IMPORTANT ###
  426. #All the variables below for 'mode lock settings block' should ONLY be set if channel mode locking
  427. #has been enabled, i.e. clone_modelock_switch has been set to '1', otherwise please ignore all
  428. #the mode lock settings block.
  429.  
  430. #Set this to the 'PRIMARY MODE LOCK' you wish to lock on the channel. Also remember when the bot
  431. #is unlocking the channel this modelock will be checked, if it is present then only it will be
  432. #unlocked, otherwise since other ops might have removed it already the bot wouldn't unlock it then.
  433. #Important: Only '1' mode lock can be used for this setting - HIGH PRIORITY MODELOCK
  434. #USAGE: 'm', 'M', 'R' etc. (Please do not use +l or +k)
  435. set clone_primary_modelock "M"
  436.  
  437. #Set this to the 'SECONDARY MODE LOCK' you wish to lock on the channel besides the primary modelock.
  438. #This is an additional mode lock supporting the primary modelock, if you wish to place additional
  439. #modelocks on the channel. This is an OPTIONAL setting, if you do not wish to place any additional
  440. #modelock besides the primary modelock then please leave this setting to by empty as "".
  441. #Important: More than '1' modelocks can also be used for this setting.
  442. #USAGE: 'MR', 'Rc', 'iRM' etc. (The +l or +k modelocks can be used)
  443. set clone_secondary_modelock "R"
  444.  
  445. #Set the time in SECONDS after which the modelock will be removed -- only if the primary modelock
  446. #is found locked on the channel and has not been already removed by other channel ops yet.
  447. #USAGE: A value in between '3 - 10' seconds should be good enough.
  448. set clone_modelock_time "5"
  449.  
  450.  
  451. #-----------------------------------------------------#
  452. # SET CLONE FLOOD MODELOCK NOTIFICATION OPTIONS #
  453. #-----------------------------------------------------#
  454.  
  455. ### IMPORTANT ###
  456. #All these variables should ONLY be set if you have chosen to lock the channel on a clone flood,
  457. #i.e. clone_modelock_switch has been set to '1', otherwise please ignore all the 'mode lock
  458. #notification setting block'.
  459.  
  460. #Set this if you want to NOTIFY channel users when the channel has been locked due a clone flood
  461. #in the channel. This notification will be sent by the type of sending option selected -- next setting.
  462. #USAGE: [0/1] - (0=NO NOTIFICATION, 1=SEND NOTIFICATION)
  463. set clone_notify_switch "0"
  464.  
  465. #Set the type of message sending option to the channel to use when sending the channel modelock
  466. #notification message. There are 3 different sending options available to choose from.
  467. #USAGE: [1/2/3] - (1=CHANNEL TEXT, 2=CHANNEL NOTICE, 3=CHANNEL OP-NOTICE)
  468. #(Note: The default option for this setting is: '2')
  469. set clone_notify_message_type "2"
  470.  
  471. #Set the TYPE of NOTIFICATION MESSAGE to use here. If you wish to use the scripts default
  472. #notice message with its content or your own user-defined notification message.
  473. #USAGE: [1/2] - (1=SCRIPTS DEFAULT MESSAGE, 2=USER DEFINFED MESSAGE)
  474. #(If you have selected option '2' please set your message below)
  475. set clone_notify_type "1"
  476.  
  477. ###USE THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '2'###
  478. #Set the modelock notification MESSAGE content here, which will be sent to the channel when the
  479. #channel is locked. (If you do not specify a notice then the scripts default message will be used)
  480. set clone_notify_message "CLONE FLOOD: Channel has been locked to +$clone_primary_modelock$clone_secondary_modelock for $clone_modelock_time seconds."
  481.  
  482.  
  483. #-----------------------------------#
  484. # SET CLONE PUNISHMENT METHOD #
  485. #-----------------------------------#
  486.  
  487. #Set the punishment level of removing the clones.
  488. #USAGE: [1/2/3/4] - [1=KICK, 2=KICK/BAN, 3=STICKY KICK/BAN, 4=GLOBAL KICK/BAN]
  489. #Use '1' to 'kick' all clones from the channel. (Minimal punishment)
  490. #Use '2' to 'kick and ban' all clones from the channel. (Normal punishment)
  491. #Use '3' to 'kick and ban' all clones using a STICKY ban from the bots banning mechanism. (Moderate punishment)
  492. #Use '4' to 'kick and ban' all clones using a GLOBAL ban from all channels where users with clone *!*@host's are found on with the bot. (Extreme punishment)
  493. #(NOTE: Options '3' and '4' will ignore all on op, voice, flag, nick and mask exemption options set)
  494. set clone_punishment_type "2"
  495.  
  496.  
  497. #-----------------------------------------#
  498. # SET CLONE PUNISHMENT BANMASK TYPE #
  499. #-----------------------------------------#
  500.  
  501. #Select the type of banmask (from the list below) to use when banning clones.
  502. #-----------------------------------------------------------------------------
  503. #RECOMMENDED SETTINGS FOR BANMASK SELECTION:
  504. # - It is recommend that you use setting number '2'
  505. # - If you want a greater range you can use settings number '12' or '22'
  506. # - Else other options with large ranges are settings number '4', '14' or '24'
  507. #-----------------------------------------------------------------------------
  508. # Valid types are:
  509. # 0 - *!user@host.domain
  510. # 1 - *!*user@host.domain
  511. # 2 - *!*@host.domain
  512. # 3 - *!*user@*.domain
  513. # 4 - *!*@*.domain
  514. # 5 - nick!user@host.domain
  515. # 6 - nick!*user@host.domain
  516. # 7 - nick!*@host.domain
  517. # 8 - nick!*user@*.domain
  518. # 9 - nick!*@*.domain
  519. # You can also specify 2 types of wild carded banmasks, 10-19 and 20-29 which correspond
  520. # to the types 0-9 using this sub-rule.
  521. #
  522. # For the 10-19 range, if the user's host.domain is a [name/ip]:
  523. # name - It will replace the numbers in the host.domain with a '?' (question mark) wildcard.
  524. # ip - It will mask as normal, with no '?' replacements as does hostname.
  525. #
  526. # For the 20-29 range, if the user's host.domain is a [name/ip]:
  527. # name - It will replace the numbers in the host.domain with a '*' (star) wildcard.
  528. # ip - It will mask as normal, with no '*' replacements as does hostname.
  529. #
  530. # Explanations of the "?" and "*" wildcards:
  531. # - The character '?' matches any single character
  532. # - The character '*' matches 0 or more characters of any type
  533. #
  534. # * A character can be an alphabet, a number or any other symbol on the keyboard.
  535. #-----------------------------------------------------------------------------------
  536. # Example:
  537. # [Mask #2] awyeah!god@125-628-dialup.mindspring.com => *!*@125-628-dialup.mindspring.com
  538. # [Mask #12] awyeah!god@125-628-dialup.mindspring.com => *!*@???-???-dialup.mindspring.com
  539. # [Mask #22] awyeah!god@125-628-dialup.mindspring.com => *!*@*-*-dialup.mindspring.com
  540. set clone_banmask_type "12"
  541.  
  542. #Set the amount of time in MINUTES to ban the clones for. This will be the time in minutes the
  543. #clones will remain banned from the channel and then removed if the ban is not set to be permanent.
  544. #(NOTE: If you want the ban to be PERMANENT, set this value as '0')
  545. #USAGE: Any positive integer or number
  546. set clone_bantime "1"
  547.  
  548.  
  549. #-----------------------------------#
  550. # SET CLONE EXEMPTION OPTIONS #
  551. #-----------------------------------#
  552.  
  553. ### IMPORTANT - PLEASE READ THIS ###
  554. #When channel OP/VOICE exemption is enabled only current channel OPS/VOICES residing in the channel
  555. #would be exempted, since new joining-in ops/voices will take a second or so to get opped/voiced through
  556. #ChanServ or any other IRC service running on your network. All these exemption settings will be valid
  557. #if the clone punishment type is set to '1' or '2'. This is because 'sticky' and 'global' bans are bot's
  558. #internal banning mechanisms and the bot doesn't exempt ops/voices with its internal banning mechanism.
  559.  
  560. #### EXEMPT CHANNEL OPERATORS FROM CLONE PUNISHMENTS ####
  561. #Set this if you want the bot to exempt all currently residing OPS even though their *!*@host matches
  562. #that of the clones banned. (This is a useful setting for not punishing 'OPS' matching clone hosts)
  563. #USAGE: [0/1] - (0=WILL NOT EXEMPT OPS, 1=WILL EXEMPT OPS)
  564. #If set to '0' channel OPS *will be kicked* if their *!*@host matches that of the clones.
  565. #If set to '1' channel OPS *will NOT be kicked* even if their *!*@host matches that of the clones.
  566. set clone_exempt_ops "1"
  567.  
  568. #### EXEMPT CHANNEL VOICES FROM CLONE PUNISHMENTS ####
  569. #Set this if you want the bot to exempt all current residing VOICES even though their *!*@host matches
  570. #that of the clones banned. (This is a useful setting for not punishing 'VOICES' matching clone hosts)
  571. #USAGE: [0/1] - (0=WILL NOT EXEMPT VOICES, 1=WILL EXEMPT VOICES)
  572. #If set to '0' channel VOICES *will be kicked* if their *!*@host matches that of the clones.
  573. #If set to '1' channel VOICES *will NOT be kicked* even if their *!*@host matches that of the clones.
  574. set clone_exempt_voices "1"
  575.  
  576. #### EXEMPT SPECIFIC USER FLAGS FROM CLONE PUNISHMENTS ####
  577. #Set this if you have enabled to exempt user's with certain 'user flags' on the bots userlist even
  578. #if their *!*@host matches that of the clones banned. Set the 'flags' for bot owners, masters, ops,
  579. #voices, friends etc which will be exempted from clone punishments.
  580. #USAGE: "mnf|mnf", "mn|o", "ovbf|-" etc. ("-" means no flags)
  581. #(Note: If you want to exempt no flags set this to '-|-')
  582. #FORMAT: "GLOBAL_FLAGS|CHANNEL_FLAGS"
  583. set clone_exempt_flags "mn|fbov"
  584.  
  585. #### EXEMPT SPECIFIC NICKS FROM CLONE PUNISHMENTS ####
  586. #Set the list of nicks here you want the script to exempt even if their *!*@host matches that of the
  587. #clones banned. If any of these nicks are detected as clones then they will NOT be punished by the
  588. #clone detector. This is a good option for exempting certain nicks, characters or specific
  589. #keywords in nicks which you don't want the clone nick to punish.
  590. #(NOTE: Wildcards such as '*' and '?' can be used for each entry within the list)
  591. #Guidelines for ADDING and MODIFYING the nick exemption list:
  592. #-------------------------------------------------------------------------------
  593. #1) Please make sure every nick pattern is enclosed within " " quotation marks.
  594. #2) Please make sure each nick pattern is separated by a SPACE or is placed in a NEW LINE.
  595. #3) Please add suitable nick patterns, which effect small patterns, ranges, if you use wildcards.
  596. #4) You can add an entire nick, part of a nick or specific word of a nick to exempt.
  597. #5) You can also add a nick, with the '?' wildcard in it also or the '*' wildcard surrounding the nick.
  598. #-------------------------------------------------------------------------------------------------------
  599. #Explanation of the wildcards masks:
  600. # - The character '*' matches 0 or more characters of any type
  601. # - The character '?' matches any single character
  602. #-----------------------------------------------------------------
  603. #If you do not have any nick to exempt: set clone_exempt_nicks ""
  604. set clone_exempt_nicks {
  605. "nick1"
  606. "nick2"
  607. "nick3"
  608. }
  609.  
  610. #### EXEMPT SPECIFIC MASKS FROM CLONE PUNISHMENTS ####
  611. #Set the list of masks here you want the script to exempt even if their *!*@host matches that of the
  612. #clones banned. If any of these masks are detected as clones then they will NOT be punished by the
  613. #clone detector. This is a good option for exempting certain masks, characters or specific
  614. #keywords in user masks which you don't want the clone detector to punish.
  615. #(NOTE: Wildcards such as '*' and '?' can be used for each entry within the list)
  616. #Guidelines for ADDING and MODIFYING the mask exemption list:
  617. #----------------------------------------------------------------------------------
  618. #1) Please remember all masks should are in the format: nick!ident@host.domain.com
  619. #2) Please make sure every mask pattern is enclosed within " " quotation marks.
  620. #3) Please make sure each mask pattern is separated by a SPACE or is placed in a NEW LINE.
  621. #4) Please add suitable mask patterns, which effect small patterns, ranges, if you use wildcards.
  622. #5) You can add an entire mask 'nick!user@host.domain' or a part of a mask to exempt.
  623. #6) You can also add a mask, with the '?' wildcard in it also or the '*' wildcard surrounding the mask.
  624. #-------------------------------------------------------------------------------------------------------
  625. #Explanation of the wildcards masks:
  626. # - The character '*' matches 0 or more characters of any type
  627. # - The character '?' matches any single character
  628. #-----------------------------------------------------------------
  629. #If you do not have any nick to exempt: set clone_exempt_masks ""
  630. set clone_exempt_masks {
  631. "nick!ident@host.domain.com"
  632. "*!*@host.domain.com"
  633. "*!*@*.domain.com"
  634. }
  635.  
  636.  
  637. #----------------------------------------#
  638. # SET CLONE PUNIHSMENT SPEED QUEUE #
  639. #----------------------------------------#
  640.  
  641. ###NOTE: ONLY SET this block if PUNISHMENT TYPE has been SET to '1' or '2'###
  642.  
  643. #Select the type of speed queue to use for kicking and banning the clones. This option has been
  644. #given because the bots banning and kicking mechanism has separate queues so it doesn't get flooded
  645. #of the server (Excess flood), since some queues are delayed and some are fast. There are 7 types of
  646. #queues available to select from depending upon the speed/rate you wish to remove the clones at.
  647. #------------------------------------------------------------------------------------------------
  648. #SPEED: The speed of listed queues is from '1 - 7' (given in the order: slowest ---> fastest)
  649. #USAGE: [1/2/3/4/6/7] (There are 7 types of queues available to choose from)
  650. #1 - puthelp (BAN: 1-2 second delayed queue, KICK: 1-2 second delayed queue)
  651. #2 - pushmode (BAN: Default speed queue, KICK: 1 combines number channel modes into one line as possible)
  652. #3 - putkick (BAN: Default speed queue, KICK: combines number of kicks into one line as possible)
  653. #4 - putserv (BAN: Default speed queue, KICK: Default speed queue)
  654. #5 - putquick (BAN: Fast speed queue, KICK: Fast speed queue)
  655. #6 - putdccraw (BAN: Fastest speed without queuing, KICK: Fastest speed without queuing)
  656. #(WARNING: Speed number 7 uses no queues, so it can flood your bot off the server at most times)
  657. #If you are not sure which speed queue to use, use the default speed queue i.e., speed number '4'.
  658. set clone_kick_queue "5"
  659.  
  660. ###USE THIS 'ONLY' IF YOU HAVE SELECTED THE SPEED QUEUE OPTION TO BE '1', '2', '4' OR '5'###
  661. #Set this if you have only selected one of the 'puthelp', 'putserv' or 'putquick' speed queues. This
  662. #option will add a '-next' option in front of the speed queues making execution more faster. The '-next'
  663. #switch option pushes messages to the front of the queue so they are executed as faster as possible.
  664. #USAGE: [0/1] (0=DISABLE THE '-NEXT' OPTION, 1=ENABLE THE '-NEXT' OPTION)
  665. #Use '0' if you DO NOT wish to use the '-next' option in your speed queues.
  666. #Use '1' if you WISH to use the '-next' option in your speed queues for faster performance.
  667. #(NOTE: If you DO NOT use the '-next' option with the 1, 2, 4 or 5 speed queues the speed of placing
  668. #bans and the speed of kicking users can slow down a bit)
  669. set clone_queue_next_option "1"
  670.  
  671.  
  672. #-------------------------------------#
  673. # SETUP CLONE KICK MESSAGE TYPE #
  674. #-------------------------------------#
  675.  
  676. #Set this if you would like to use your OWN kick messages for kicking clones or wish to use the
  677. #DEFAULT script kick messages for kicking clones. (The scripts default kick message is more informative)
  678. #(NOTE: If you want to define your own kick messages -- you will have to define 6 separate ones)
  679. #USAGE: [0/1] (O=SCRIPT DEFAULT KICK MESSAGES, 1=USER DEFINED KICK MESSAGES)
  680. set clone_kick_msg_type "0"
  681.  
  682. ###USE THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1'###
  683. #Set these to your customizable user defined KICK messages. These kick messages will be shown when clone
  684. #are kicked out by the bot. These kick messages can contain all types of control codes, which are
  685. #supported on IRC such as colors, bolds, underlines, reverses and etc.
  686. #(NOTE: Listed below are '6' different types of kick messages for the clone detector)
  687. ###################################################################################################################################
  688. ##1) Set the kick message for MASS JOINING CLONES
  689. set clone_kick_user1_msg "Expulsado por ingreso de clones masivos"
  690. ###################################################################################################################################
  691. ##2) Set the kick message for MASS PARTING CLONES
  692. set clone_kick_user2_msg "Expulsado por ingreso de clones masivos"
  693. ###################################################################################################################################
  694. ##3) Set the kick message for MASS JOINING/PARTING CLONES, REVOLVING DOOR FLOOD
  695. set clone_kick_user3_msg "Expulsado por ingreso de clones masivos"
  696. ###################################################################################################################################
  697. ##4) Set the kick message for FAST JOINING/PARTING CLONES
  698. set clone_kick_user4_msg "Expulsado por ingreso de clones masivos"
  699. ###################################################################################################################################
  700. ##5) Set the kick message for EXCESSIVE RESIDING CLONES IN A CHANNEL
  701. set clone_kick_user5_msg "Expulsado por ingreso de clones masivos"
  702. ###################################################################################################################################
  703. ##6) Set the kick message for SUSPECTED MASS JOINING CLONE BOTNET
  704. set clone_kick_user6_msg "Expulsado por ingreso de clones masivos"
  705. ###################################################################################################################################
  706. #(HINT: The smaller the kick message and the less control codes the kick message contains the more faster kicks will be placed)
  707.  
  708.  
  709. #------------------------------#
  710. # SET CLONE KICK COUNTER #
  711. #------------------------------#
  712.  
  713. #Set this if you wish to use a kick counter in every clone kick message. The number of kicks done
  714. #by the clone detector will be displayed at the end of each clone kick message.
  715. #(NOTE: The clone kick counter can slow down script's kicking performance)
  716. #USAGE: [0/1] (0=DISABLED, 1=ENABLED)
  717. set clone_kick_counter_type "0"
  718.  
  719.  
  720. ###USE THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1'###
  721. #Set the FILENAME and PATH here in which you want to store the clone nicks KICK COUNTING DATABASE in.
  722. #If you do not know which path to specify just type in a filename for your clone nick kick counting database.
  723. #CHECKING CURRENT PATH: To see your current directory path type 'pwd' at your shell prompt
  724. #(Note: The filename and extension [*.file] of the file can be named as anything)
  725. #Example: set clone_kick_counter_file "/usr/home/awyeah/eggdrop/clonekicks.dat"
  726. set clone_kick_counter_file "clonekicks.dat"
  727.  
  728.  
  729. ############################
  730. ##### OPTIONAL MODULES #####
  731. ############################
  732.  
  733. #This script contains 3 additional modules, which can be turned ON and OFF depending upon the desired
  734. #will of the bot owner. The 3 modules are listed below as follows:
  735. ######################################################
  736. #[1] CLONE FAST JOIN/PART SCANNER (REVOLVING DOOR)
  737. #[2] EXCESSIVE CLONE SCANNER (CLONES IN CHANNEL)
  738. #[3] SUSPECTED MASS JOIN BOTNET SCANNER (BOTNET JOIN)
  739. ######################################################
  740. #(NOTE: As default all modules are set OFF)
  741.  
  742.  
  743. ############################################################
  744. #### (1) ADDITIONAL MODULE: CLONE FAST JOIN/PART SCANNER ###
  745. ############################################################
  746.  
  747. #Set this if you want to enable punishing users who join and then quickly part a channel. This module
  748. #punishes users who do fast join/parts and revolving doors. This is a good protection against multiple
  749. #join/parts from a single host to eliminate bots who flood through part messages.
  750. #USAGE: [0/1] (0=DISABLED, 1=ENABLED)
  751. set clone_flyby_type "0"
  752.  
  753. ### IMPORTANT ###
  754. #All the variables below for 'clone fast join/part scanner module' should ONLY be set if clone fast
  755. #join/part scanner module has been enabled, i.e. clone_flyby_type has been set to '1', otherwise please
  756. #ignore all the mode lock settings block.
  757.  
  758. #Set the time in SECONDS for which the clone fast join/part scanner module will check for fast joins
  759. #and parts. If a join and part is done within this time then it would be counted as a revolving door
  760. #otherwise it will be detected as a normal join and part.
  761. #USAGE: Any positive integer (Recommended: 2 - 5 secs)
  762. set clone_flyby_time "2"
  763.  
  764. #Set this if you only want to check for fast joins/parts which only contain a part message and have
  765. #joined and parted within the defined number of seconds which is defined above. Set the length of
  766. #the part message here. If the part message is less than this then it will not be counted as
  767. #as a fast join and part, but if it is equal or greater to this number then it will be detected.
  768. #TURN OFF: To turn off this setting, set the value as '0'
  769. #USAGE: Any positive integer or number
  770. set clone_flyby_reason_length "0"
  771.  
  772.  
  773. ######################################################
  774. ### (2) ADDITIONAL MODULE: EXCESSIVE CLONE SCANNER ###
  775. ######################################################
  776.  
  777. #Set this if you want the bot to check the channel for clones. Clones will be detect based upon
  778. #similar *!*@hosts of users residing in the channel. This module can slow the bot down a bit based
  779. #upon which type of excessive clone checking is used.
  780. #USAGE: [0/1/2/3] - (0=OFF, 1=CHECK ON-JOIN, 2=FULL SCAN ON-JOIN, 3=FULL SCAN EVERY 'X' MINUTES)
  781. #Use '0' if you want to DISABLE checking the channel for clones. (DISABLE clone scanner module)
  782. #Use '1' if you want to scan a channel for clones for the user who joined in.
  783. #Use '2' if you want to fully scan a channel for all clones when a user joins in.
  784. #Use '3' if you want to fully scan a channel for all clones when a user joins in every 'x' minutes.
  785. #(Note: Setting '1' and '2' can be slow the bot down if the channel has a lot of joins and parts)
  786. set clone_remover_type "0"
  787.  
  788. ###SET THIS ONLY IF THE ABOVE SETTING HAS BEEN SET TO '3'###
  789. #Set this to the time in MINUTES, which will be executed continuously for a scan of all the
  790. #clones in the channel. (NOTE: Please do not set this value very low as it can make the bot slow
  791. #if the channel has a lot of users residing)
  792. #USAGE: Any positive integer or number
  793. set clone_remover_time "10"
  794.  
  795. #Set the maximum number of clones you would like to allow in a channel. If the limit of clones
  796. #exceeds this number then all the users with matching similar *!*@host's i.e. clones residing in
  797. #the channel would be removed from the channel.
  798. #USAGE: Any positive number greater than 1
  799. set clone_max_allowed "2"
  800.  
  801.  
  802. #################################################################
  803. ### (3) ADDITIONAL MODULE: SUSPECTED MASS JOIN BOTNET SCANNER ###
  804. #################################################################
  805.  
  806. ###NOTE: THIS IS AN ADVANCED SETTING - IF YOU DON'T UNDERSTAND THEN DON'T ENABLE THIS###
  807. #Set this if you want to detect suspected mass joining botnet nicks. Suspected mass joining botnet
  808. #nicks will be detected through regular expression matching patterns defined in the list given below.
  809. #USAGE: [0/1/2] (0=OFF, 1=DETECT ALL TYPES OF IDENTS, 2=ONLY DETECT IDENTS WITH ASTERISKS '~')
  810. #Use '0' if you want to DISABLE checking the channel suspecting mass joining botnets.
  811. #Use '1' if you want to scan all idents for suspecting mass joining botnets.
  812. #Use '2' if you want to scan all unresolved idents (idents with '~') for suspecting mass joining botnets.
  813. #(Recommended: Setting '2' is recommended to be used)
  814. set clone_regexp_match_switch "0"
  815.  
  816. #Set the maximum number of mass joining botnet clones you would like to allow to join in a channel.
  817. #If the number of clones exceeds this limit then all the detected patterns of nicks will be punished
  818. #from the channel. (Recommended: The recommended setting is '1')
  819. #USAGE: Any positive number
  820. set clone_regexp_clones "1"
  821.  
  822. #Set the list of REGULAR EXPRESSION matching patterns that will detect randomly generated, drone,
  823. #botnet nicks which will be detected for mass joining clones. IF YOU DO NOT UNDERSTAND HOW TO EDIT
  824. #OR ADD NEW REGULAR EXPRESSION PATTERNS THEN PLEASE LEAVE THIS SETTING ALONE.
  825. set clone_regexp_matches {
  826. { [a-z]{1}[0-9]{1}[a-z]{1}[0-9]{1}[a-z]{1} }
  827. { [a-z]{2}[0-9]{2}[a-z]{2}[0-9]{2} }
  828. { [a-z]{1}[0-9]{4,8}[a-z]{1} }
  829. { [A-Z]{1}[0-9]{4,8}[A-Z]{1} }
  830. { [a-z]{2,8}-[0-9]{3,6} }
  831. { [a-z]{2,8}_[0-9]{3,6} }
  832. { [a-z]{2,8}[0-9]{3,6} }
  833. { [a-z]{4,}[0-9]{4,5} }
  834. { \[[a-z]{4,}\]-{3,} }
  835. { \[[a-z]{4,}\]_{3,} }
  836. { \[[a-z]{4,}\]{3,} }
  837. { \[[A-Z]{4,}\]{3,} }
  838. }
  839.  
  840. #############################################################
  841. ### Congratulations! Script configuration is now complete ###
  842. #############################################################
  843.  
  844.  
  845. ##############################################################################
  846. ### Don't edit anything else from this point onwards even if you know tcl! ###
  847. ##############################################################################
  848.  
  849. bind join - "*" clone:join:chan:type
  850. bind part - "*" clone:part:chan:type
  851. bind join - "*" clone:remover:module
  852. bind flud - join clone:join:flood:check
  853. bind evnt - rehash clone:delay:settings
  854. bind evnt - prerehash clone:clear:utimers
  855. bind evnt - init-server clone:delay:settings
  856. if {$clone_kick_counter_type == 1} { bind kick - "*" clone:kick:counter }
  857.  
  858. if {($clone_remover_type == 3) && ![string match "*clone:remover:scan*" [timers]]} { timer $clone_remover_time clone:remover:scan }
  859. if {($clone_exempt_ops == 0) && ($clone_exempt_voices == 0)} { set clone_exempt_ops_voices "1"
  860. } elseif {($clone_exempt_ops == 0) && ($clone_exempt_voices == 1)} { set clone_exempt_ops_voices "2"
  861. } elseif {($clone_exempt_ops == 1) && ($clone_exempt_voices == 0)} { set clone_exempt_ops_voices "3"
  862. } elseif {($clone_exempt_ops == 1) && ($clone_exempt_voices == 1)} { set clone_exempt_ops_voices "4"
  863. } else { set clone_exempt_ops_voices "1" }
  864.  
  865.  
  866. proc clone:delay:settings {type} {
  867. timer 3 [list clone:modify:settings $type]
  868. }
  869.  
  870. proc clone:modify:settings {type} {
  871. global clone_channel_type clone_channels clone_join_flood
  872. switch -- $clone_channel_type {
  873. 1 { set clone_working_channels [split $clone_channels] }
  874. 2 { set clone_working_channels [channels] }
  875. default { set clone_working_channels [channels] }
  876. }
  877. foreach clone_channel $clone_working_channels {
  878. if {[botonchan $clone_channel]} {
  879. channel set $clone_channel flood-join $clone_join_flood
  880. }
  881. }
  882. putlog "\002MASS JOIN/PART CLONE PROTECTION\002: Configuring channel flood-join settings."
  883. save
  884. }
  885.  
  886. proc clone:join:chan:type {nick uhost hand chan} {
  887. global clone_channel_type clone_channels
  888. if {![isbotnick $nick] && [botisop $chan]} {
  889. switch -- $clone_channel_type {
  890. 1 {
  891. if {[lsearch -exact [split [string tolower $clone_channels]] [string tolower $chan]] != -1} {
  892. clone:join:check $nick $uhost $hand $chan
  893. }
  894. }
  895. 2 {
  896. if {[string equal "#" [string index $chan 0]]} {
  897. clone:join:check $nick $uhost $hand $chan
  898. }
  899. }
  900. default { putlog "\002MASS JOIN/PART CLONE PROTECTION\002: No channel type selected."; return 0 }
  901. }
  902. }
  903. }
  904.  
  905. proc clone:part:chan:type {nick uhost hand chan {reason ""}} {
  906. global clone_channel_type clone_channels
  907. if {![isbotnick $nick] && [botisop $chan]} {
  908. switch -- $clone_channel_type {
  909. 1 {
  910. if {[lsearch -exact [split [string tolower $clone_channels]] [string tolower $chan]] != -1} {
  911. clone:part:check $nick $uhost $hand $chan $reason
  912. }
  913. }
  914. 2 {
  915. if {[string equal "#" [string index $chan 0]]} {
  916. clone:part:check $nick $uhost $hand $chan $reason
  917. }
  918. }
  919. default { putlog "\002MASS JOIN/PART CLONE PROTECTION\002: No channel type selected."; return 0 }
  920. }
  921. }
  922. }
  923.  
  924.  
  925. proc clone:join:check {nick uhost hand chan} {
  926. global clone_exempt_nicks clone_unresolved_ident clone_banmask_type clone_nicks_joinpart clone_regexp_clones
  927. global clone_nicks_join clone_modelock_switch clone_exempt_masks clone_bantime clone_regexp_match_switch
  928. global clone_join_flood clone_joinpart_flood clone_type1_count clone_type3_count clone_regexp_matches
  929. global clone_exempt_flags clone_flyby_type clone_flyby clone_flyby_time clone_punishment_type
  930. set nickuhost [string tolower $nick:$uhost]; set hostchan [lindex [split [string tolower $uhost] @] 1]:[string tolower $chan]
  931. if {($clone_unresolved_ident == 1) && ![string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { return 0 }
  932. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 0]]]} { foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] { if {[matchattr $hand $clone_exempt_global_flag]} { return 0 } } }
  933. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 1]]]} { foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] { if {[matchattr $hand $clone_exempt_local_flag $chan]} { return 0 } } }
  934. if {$clone_exempt_nicks != ""} { foreach clone_exempt_nick $clone_exempt_nicks { if {[string match -nocase $clone_exempt_nick $nick]} { return 0 } } }
  935. if {$clone_exempt_masks != ""} { foreach clone_exempt_mask $clone_exempt_masks { if {[string match -nocase $clone_exempt_mask "${nick}![getchanhost $nick $chan]"]} { return 0 } } }
  936. if {![info exists clone_type1_count($hostchan)]} { set clone_type1_count($hostchan) 0 }
  937. lappend clone_nicks_join($hostchan) $nickuhost
  938. if {[incr clone_type1_count($hostchan)] >= [lindex [split $clone_join_flood :] 0]} {
  939. if {$clone_modelock_switch == 1} { clone:channel:lock $chan }; set clone_number 0
  940. foreach person $clone_nicks_join($hostchan) {
  941. lappend clone_list $person
  942. }
  943. set clone_list [list]
  944. foreach user [chanlist $chan] {
  945. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  946. lappend clone_list $user:[getchanhost $user $chan]
  947. }
  948. }
  949. set clone_list [lsort -unique $clone_list]
  950. if {[llength $clone_list] > 1} {
  951. foreach clone $clone_list {
  952. if {$clone_punishment_type == 2} {
  953. set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  954. putquick "MODE $chan +b $clone_banmask" -next
  955. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  956. }
  957. if {[onchan [lindex [split $clone :] 0] $chan]} {
  958. incr clone_number; clone:punishment $clone $chan $clone_number [llength $clone_list] 1
  959. }
  960. }
  961. }
  962. utimer 1 [list clone:delay:check [lindex [split $uhost @] 1] $chan $clone_number [llength $clone_list] 1]
  963. }
  964. utimer [lindex [split $clone_join_flood :] 1] [list clone_expire_join $hostchan $nickuhost]
  965. if {![info exists clone_type3_count($hostchan)]} { set clone_type3_count($hostchan) 0 }
  966. lappend clone_nicks_joinpart($hostchan) $nickuhost
  967. if {[incr clone_type3_count($hostchan)] >= [expr [lindex [split $clone_joinpart_flood :] 0]*2]} {
  968. if {$clone_modelock_switch == 1} { clone:channel:lock $chan }
  969. foreach person $clone_nicks_joinpart($hostchan) {
  970. lappend clone_list $person
  971. }
  972. set clone_list [list]
  973. foreach user [chanlist $chan] {
  974. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  975. lappend clone_list $user:[getchanhost $user $chan]
  976. }
  977. }
  978. foreach clone $clone_list {
  979. if {$clone_punishment_type == 2} {
  980. set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  981. putquick "MODE $chan +b $clone_banmask" -next
  982. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  983. }
  984. if {[onchan [lindex [split $clone :] 0] $chan]} {
  985. clone:punishment $clone $chan 0 0 3
  986. }
  987. }
  988. utimer 1 [list clone:delay:check:flud [lindex [split $uhost @] 1] $chan 3]
  989. }
  990. utimer [lindex [split $clone_joinpart_flood :] 1] [list clone_expire_joinpart $hostchan $nickuhost]
  991. if {$clone_flyby_type == 1} {
  992. if {![info exists clone_flyby([string tolower $nick:$chan])]} {
  993. set clone_flyby([string tolower $nick:$chan]) 1
  994. }
  995. if {[info exists clone_flyby([string tolower $nick:$chan])]} {
  996. utimer $clone_flyby_time [list unset clone_flyby([string tolower $nick:$chan])]
  997. }
  998. }
  999. if {$clone_regexp_match_switch == 1} {
  1000. foreach clone_regexp_match $clone_regexp_matches {
  1001. if {[regexp {^$clone_regexp_match$} $nick]} {
  1002. break; set clone_regexp_match_pattern $clone_regexp_match
  1003. }
  1004. }
  1005. set clone_number 0; set clone_list [list]
  1006. foreach user [chanlist $chan] {
  1007. if {[regexp {^$clone_regexp_match_pattern$} $user]} {
  1008. lappend clone_list $user:[getchanhost $user $chan]
  1009. }
  1010. }
  1011. foreach person [chanlist $chan] {
  1012. if {[string equal [lindex [split $uhost @] 1] [lindex [split [getchanhost $person $chan] @] 0]] && ([lsearch -exact [string tolower $clone_list] [string tolower $person]] == -1)} {
  1013. lappend clone_list $person:[getchanhost $person $chan]
  1014. }
  1015. }
  1016. if {[llength $clone_list] > $clone_regexp_clones} {
  1017. foreach clone $clone_list {
  1018. incr clone_number; set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  1019. putquick "MODE $chan +b $clone_banmask" -next; clone:punishment $clone $chan $clone_number [llength $clone_list] 6
  1020. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1021. }
  1022. }
  1023. } elseif {$clone_regexp_match_switch == 2} {
  1024. foreach clone_regexp_match $clone_regexp_matches {
  1025. if {[regexp {^$clone_regexp_match$} $nick]} {
  1026. break; set clone_regexp_match_pattern $clone_regexp_match
  1027. }
  1028. }
  1029. set clone_number 0; set clone_list [list]
  1030. foreach user [chanlist $chan] {
  1031. if {[regexp {^$clone_regexp_match_pattern$} $user] && [string equal "~" [string equal [string index [lindex [split [getchanhost $user $chan] @] 0] 0]]]} {
  1032. lappend clone_list $user:[getchanhost $user $chan]
  1033. }
  1034. }
  1035. foreach person [chanlist $chan] {
  1036. if {[string equal [lindex [split $uhost @] 1] [lindex [split [getchanhost $person $chan] @] 0]] && [string equal "~" [string equal [string index [lindex [split [getchanhost $person $chan] @] 0] 0]]] && ([lsearch -exact [string tolower $clone_list] [string tolower $person]] == -1)} {
  1037. lappend clone_list $person:[getchanhost $person $chan]
  1038. }
  1039. }
  1040. if {[llength $clone_list] > $clone_regexp_clones} {
  1041. foreach clone $clone_list {
  1042. incr clone_number; set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  1043. putquick "MODE $chan +b $clone_banmask" -next; clone:punishment $clone $chan $clone_number [llength $clone_list] 6
  1044. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1045. }
  1046. }
  1047. }
  1048. }
  1049.  
  1050.  
  1051. proc clone:part:check {nick uhost hand chan reason} {
  1052. global clone_nicks_part clone_modelock_switch clone_exempt_masks clone_bantime clone_flyby_reason_length
  1053. global clone_exempt_flags clone_flyby_type clone_flyby clone_flyby_time clone_punishment_type
  1054. global clone_exempt_nicks clone_unresolved_ident clone_banmask_type clone_nicks_joinpart
  1055. global clone_part_flood clone_joinpart_flood clone_type2_count clone_type3_count
  1056. set nickuhost [string tolower $nick:$uhost]; set hostchan [lindex [split [string tolower $uhost] @] 1]:[string tolower $chan]
  1057. if {($clone_unresolved_ident == 1) && ![string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { return 0 }
  1058. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 0]]]} { foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] { if {[matchattr $hand $clone_exempt_global_flag]} { return 0 } } }
  1059. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 1]]]} { foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] { if {[matchattr $hand $clone_exempt_local_flag $chan]} { return 0 } } }
  1060. foreach clone_exempt_nick $clone_exempt_nicks { if {[string match -nocase $clone_exempt_nick $nick]} { return 0 } }
  1061. foreach clone_exempt_mask $clone_exempt_masks { if {[string match -nocase $clone_exempt_mask "${nick}![getchanhost $nick $chan]"]} { return 0 } }
  1062. if {![info exists clone_type2_count($hostchan)]} { set clone_type2_count($hostchan) 0 }
  1063. lappend clone_nicks_part($hostchan) $nickuhost
  1064. if {[incr clone_type2_count($hostchan)] >= [lindex [split $clone_part_flood :] 0]} {
  1065. set clone_number 0
  1066. foreach person $clone_nicks_part($hostchan) {
  1067. lappend clone_list $person
  1068. }
  1069. set clone_list [list]
  1070. foreach user [chanlist $chan] {
  1071. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  1072. lappend clone_list $user:[getchanhost $user $chan]
  1073. }
  1074. }
  1075. set clone_list [lsort -unique $clone_list]
  1076. if {[llength $clone_list] > 0} {
  1077. foreach clone $clone_list {
  1078. if {$clone_punishment_type == 2} {
  1079. set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  1080. putquick "MODE $chan +b $clone_banmask" -next
  1081. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1082. }
  1083. if {[onchan [lindex [split $clone :] 0] $chan]} {
  1084. incr clone_number; clone:punishment $clone $chan $clone_number [llength $clone_list] 2
  1085. }
  1086. }
  1087. }
  1088. utimer 1 [list clone:delay:check [lindex [split $uhost @] 1] $chan $clone_number [llength $clone_list] 2]
  1089. }
  1090. utimer [lindex [split $clone_part_flood :] 1] [list clone_expire_part $hostchan $nickuhost]
  1091. if {![info exists clone_type3_count($hostchan)]} { set clone_type3_count($hostchan) 0 }
  1092. lappend clone_nicks_joinpart($hostchan) $nickuhost
  1093. if {[incr clone_type3_count($hostchan)] >= [expr [lindex [split $clone_joinpart_flood :] 0]*2]} {
  1094. if {$clone_modelock_switch == 1} { clone:channel:lock $chan }
  1095. foreach person $clone_nicks_joinpart($hostchan) {
  1096. lappend clone_list $person
  1097. }
  1098. set clone_list [list]
  1099. foreach user [chanlist $chan] {
  1100. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  1101. lappend clone_list $user:[getchanhost $user $chan]
  1102. }
  1103. }
  1104. foreach clone $clone_list {
  1105. if {$clone_punishment_type == 2} {
  1106. set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  1107. putquick "MODE $chan +b $clone_banmask" -next
  1108. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1109. }
  1110. if {[onchan [lindex [split $clone :] 0] $chan]} {
  1111. clone:punishment $clone $chan 0 0 3
  1112. }
  1113. }
  1114. utimer 1 [list clone:delay:check:flud [lindex [split $uhost @] 1] $chan 3]
  1115. }
  1116. utimer [lindex [split $clone_joinpart_flood :] 1] [list clone_expire_joinpart $hostchan $nickuhost]
  1117. if {$clone_flyby_type == 1} {
  1118. if {[getchanjoin $nick $chan] >= [expr [clock seconds] - $clone_flyby_time]} {
  1119. if {[string trim [string length $reason]] < $clone_flyby_reason_length} { return 0 }
  1120. if {$clone_punishment_type == 2} {
  1121. set clone_banmask [clone:banmask $nick!$uhost $clone_banmask_type]
  1122. putquick "MODE $chan +b $clone_banmask" -next
  1123. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1124. }
  1125. if {[onchan $nick $chan]} {
  1126. clone:punishment $nick:$uhost $chan 0 0 4
  1127. }
  1128. set clone_list [list]
  1129. foreach user [chanlist $chan] {
  1130. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  1131. lappend clone_list $user:[getchanhost $user $chan]
  1132. }
  1133. }
  1134. if {[llength $clone_list] > 0} {
  1135. foreach clone $clone_list {
  1136. clone:punishment $nick:$uhost $chan 0 0 4
  1137. }
  1138. }
  1139. utimer 1 [clone:delay:check:flud [lindex [split $uhost @] 1] $chan 4]
  1140. }
  1141. if {[info exists clone_flyby([string tolower $nick:$chan])]} {
  1142. putquick "MODE $chan +b [clone:banmask $nick!$uhost $clone_banmask_type]" -next
  1143. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1144. if {[info exists clone_flyby([string tolower $nick:$chan])]} {
  1145. unset clone_flyby([string tolower $nick:$chan])
  1146. }
  1147. if {[onchan $nick $chan]} {
  1148. clone:punishment $nick:$uhost $chan 0 0 4
  1149. }
  1150. set clone_list [list]
  1151. foreach user [chanlist $chan] {
  1152. if {[string equal -nocase [lindex [split [getchanhost $user $chan] @] 1] [lindex [split $uhost @] 1]]} {
  1153. lappend clone_list $user:[getchanhost $user $chan]
  1154. }
  1155. }
  1156. if {[llength $clone_list] > 0} {
  1157. foreach clone $clone_list {
  1158. clone:punishment $nick:$uhost $chan 0 0 4
  1159. }
  1160. }
  1161. utimer 1 [clone:delay:check:flud [lindex [split $uhost @] 1] $chan 4]
  1162. }
  1163. }
  1164. }
  1165.  
  1166.  
  1167. proc clone:delay:check {mask chan number total type} {
  1168. foreach clone [chanlist $chan] {
  1169. if {[string equal -nocase $mask [lindex [split [getchanhost $clone $chan] @] 1]]} {
  1170. incr number; incr total; clone:punishment $clone:[getchanhost $clone $chan] $chan $number $total $type
  1171. }
  1172. }
  1173. }
  1174.  
  1175. proc clone:delay:check:flud {mask chan type} {
  1176. foreach clone [chanlist $chan] {
  1177. if {[string equal -nocase $mask [lindex [split [getchanhost $clone $chan] @] 1]]} {
  1178. clone:punishment $clone:[getchanhost $clone $chan] $chan 0 0 $type
  1179. }
  1180. }
  1181. }
  1182.  
  1183. proc clone:channel:lock {chan} {
  1184. global clone_primary_modelock clone_secondary_modelock clone_modelock_time clone_channel_locked
  1185. global clone_notify_switch clone_notify_message_type clone_notify_type clone_notify_message
  1186. if {$clone_primary_modelock == ""} { set clone_primary_modelock m }
  1187. if {![info exists clone_channel_locked($chan)] && ![string match *$clone_primary_modelock* [getchanmode $chan]]} {
  1188. putquick "MODE $chan +$clone_primary_modelock$clone_secondary_modelock" -next
  1189. utimer $clone_modelock_time [list putquick "MODE $chan -$clone_primary_modelock$clone_secondary_modelock" -next]
  1190. utimer [expr $clone_modelock_time + 3] [list unset clone_channel_locked($chan)]
  1191. set clone_channel_locked($chan) "locked"
  1192. if {$clone_notify_switch == 1} {
  1193. switch -- $clone_notify_message_type {
  1194. 1 { set clone_notify "PRIVMSG $chan" }
  1195. 2 { set clone_notify "NOTICE $chan" }
  1196. 3 { set clone_notify "NOTICE @$chan" }
  1197. default { set clone_notify "NOTICE $chan" }
  1198. }
  1199. if {$clone_notify_type == 1} { set clone_notify_string "$clone_notify :CLONE FLOOD: Channel has been locked to +$clone_primary_lockmode$clone_secondary_modelock for $clone_modelock_time seconds as suspected clones are detected."; putquick $clone_notify_string -next
  1200. } elseif {($clone_notify_type == 2) && ($clonelocknotice != "")} { set clone_notify_string "$clone_notify :$clone_notify_message"; putquick $clone_notify_string -next
  1201. } else { set clone_notify_string "$clone_notify :CLONE FLOOD: Channel has been locked to +$clone_primary_lockmode$clone_secondary_modelock for $clone_modelock_time seconds as suspected clones are detected."; putquick $clone_notify_string -next
  1202. }
  1203. }
  1204. }
  1205. }
  1206.  
  1207. proc clone_expire_join {hostchan nickuhost} {
  1208. global clone_type1_count clone_nicks_join
  1209. incr clone_type1_count($hostchan) -1
  1210. set clone_nicks_join($hostchan) [lreplace $clone_nicks_join($hostchan) [lsearch -exact $clone_nicks_join($hostchan) $nickuhost] [lsearch -exact $clone_nicks_join($hostchan) $nickuhost]]
  1211. return
  1212. }
  1213.  
  1214. proc clone_expire_part {hostchan nickuhost} {
  1215. global clone_type2_count clone_nicks_part
  1216. incr clone_type2_count($hostchan) -1
  1217. set clone_nicks_part($hostchan) [lreplace $clone_nicks_part($hostchan) [lsearch -exact $clone_nicks_part($hostchan) $nickuhost] [lsearch -exact $clone_nicks_part($hostchan) $nickuhost]]
  1218. return
  1219. }
  1220.  
  1221. proc clone_expire_joinpart {hostchan nickuhost} {
  1222. global clone_type3_count clone_nicks_joinpart
  1223. incr clone_type3_count($hostchan) -1
  1224. set clone_nicks_joinpart($hostchan) [lreplace $clone_nicks_joinpart($hostchan) [lsearch -exact $clone_nicks_joinpart($hostchan) $nickuhost] [lsearch -exact $clone_nicks_joinpart($hostchan) $nickuhost]]
  1225. return
  1226. }
  1227.  
  1228.  
  1229. proc clone:remover:module {nick uhost hand chan} {
  1230. global clone_banmask_type clone_punishment_type clone_bantime clone_unresolved_ident clone_channels
  1231. global clone_channel_type clone_remover_type clone_max_allowed clone_exempt_flags clone_exempt_nicks clone_exempt_masks
  1232. if {[isbotnick $nick] || ![botisop $chan] || ($clone_channel_type == 1) && ([lsearch -exact [split [string tolower $clone_channels]] [string tolower $chan]] == -1)} { return 0 }
  1233. if {($clone_unresolved_ident == 1) && ![string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { return 0 }
  1234. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 0]]]} { foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] { if {[matchattr $hand $clone_exempt_global_flag]} { return 0 } } }
  1235. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 1]]]} { foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] { if {[matchattr $hand $clone_exempt_local_flag $chan]} { return 0 } } }
  1236. foreach clone_exempt_nick $clone_exempt_nicks { if {[string match -nocase $clone_exempt_nick $nick]} { return 0 } }
  1237. foreach clone_exempt_mask $clone_exempt_masks { if {[string match -nocase $clone_exempt_mask "${nick}![getchanhost $nick $chan]"]} { return 0 } }
  1238. switch -- $clone_remover_type {
  1239. 1 {
  1240. set clone_list [list]; set clone_banmask [clone:banmask $nick!$uhost $clone_banmask_type]
  1241. foreach user [chanlist $chan] {
  1242. if {[string match -nocase *$clone_banmask* "${nick}![getchanhost $user $chan]"]} {
  1243. lappend clone_list $user:$uhost
  1244. }
  1245. }
  1246. if {[llength $clone_list] > $clone_max_allowed} {
  1247. set clone_number 0
  1248. foreach person $clone_list {
  1249. if {$clone_punishment_type == 2} {
  1250. putquick "MODE $chan +b $clone_banmask" -next
  1251. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1252. }
  1253. incr clone_number; clone:punishment $person $chan $clone_number [llength $clone_list] 5
  1254. }; set clone_list ""
  1255. }
  1256. }
  1257. 2 {
  1258. set clone_list [list]
  1259. foreach user [chanlist $chan] {
  1260. foreach person [chanlist $chan] {
  1261. if {[string match -nocase *[clone:banmask $person![getchanhost $person $chan] $clone_banmask_type]* "${user}![getchanhost $user $chan]"] && ![string equal -nocase $person $user]} {
  1262. lappend clone_list $person:[getchanhost $person $chan]; set clone_banmask [clone:banmask $person![getchanhost $person $chan] $clone_banmask_type]
  1263. }
  1264. }
  1265. if {[llength $clone_list] > $clone_max_allowed} {
  1266. set clone_number 0
  1267. foreach person $clone_list {
  1268. if {$clone_punishment_type == 2} {
  1269. putquick "MODE $chan +b $clone_banmask" -next
  1270. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1271. }
  1272. incr clone_number; clone:punishment $person $chan $clone_number [llength $clone_list] 5
  1273. }
  1274. }; set clone_list ""
  1275. }; unset clone_list
  1276. }
  1277. default { return 0 }
  1278. }
  1279. }
  1280.  
  1281.  
  1282. proc clone:remover:scan {} {
  1283. global clone_remover_type clone_max_allowed clone_exempt_flags clone_exempt_nicks clone_exempt_masks
  1284. global clone_remover_time clone_banmask_type clone_remover_type clone_unresolved_ident
  1285. global clone_channel_type clone_channels clone_max_allowed clone_punishment_type
  1286. switch -- $clone_channel_type {
  1287. 1 { set channels [channels] }
  1288. 2 { set channels [split $clone_channels] }
  1289. default { return 0 }
  1290. }
  1291. set clone_list [list]
  1292. foreach chan $channels {
  1293. foreach user [chanlist $chan] {
  1294. foreach person [chanlist $chan] {
  1295. if {[info exists clone_ident]} { unset clone_ident }; if {[info exists clone_global_flag]} { unset clone_global_flag }; if {[info exists clone_local_flag]} { unset clone_local_flag }
  1296. if {[info exists clone_nick]} { unset clone_nick }; if {[info exists clone_mask]} { unset clone_mask }
  1297. if {[string match -nocase *[clone:banmask $person![getchanhost $person $chan] $clone_banmask_type]* "${user}![getchanhost $user $chan]"] && ![string equal -nocase $person $user]} {
  1298. lappend clone_list $person:[getchanhost $person $chan]; set clone_banmask [clone:banmask $person![getchanhost $person $chan] $clone_banmask_type]
  1299. } elseif {($clone_unresolved_ident == 1) && ![string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { set clone_ident 1
  1300. } elseif {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 0]]]} { foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] { if {[matchattr $hand $clone_exempt_global_flag]} { set clone_global_flag 1 } }
  1301. } elseif {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 1]]]} { foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] { if {[matchattr $hand $clone_exempt_local_flag $chan]} { set clone_local_flag 1 } }
  1302. } elseif {$clone_exempt_nicks != ""} { foreach clone_exempt_nick $clone_exempt_nicks { if {[string match -nocase $clone_exempt_nick $nick]} { set clone_nick 1 } }
  1303. } elseif {$clone_exempt_masks != ""} { foreach clone_exempt_mask $clone_exempt_masks { if {[string match -nocase $clone_exempt_mask "${nick}![getchanhost $nick $chan]"]} { set clone_mask 1 } }
  1304. }
  1305. if {![info exists clone_ident]} { set clone_ident 0 }; if {![info exists clone_global_flag]} { set clone_global_flag 0 }; if {![info exists clone_local_flag]} { set clone_local_flag 0 }
  1306. if {![info exists clone_nick]} { set clone_nick 0 }; if {![info exists clone_mask]} { set clone_mask 0 }
  1307. if {($clone_ident == 0) && ($clone_global_flag == 0) && ($clone_local_flag == 0) && ($clone_nick == 0) && ($clone_mask == 0) && ([llength $clone_list] > $clone_max_allowed)} {
  1308. set clone_number 0
  1309. foreach person $clone_list {
  1310. if {$clone_punishment_type == 2} {
  1311. putquick "MODE $chan +b $clone_banmask" -next
  1312. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1313. }
  1314. incr clone_number; clone:punishment $person $chan $clone_number [llength $clone_list] 5
  1315. }
  1316. }; set clone_list ""
  1317. }; unset clone_list
  1318. }
  1319. }
  1320. if {($clone_remover_type == 3) && ![string match "*clone:remover:scan*" [timers]]} { timer $clone_remover_time clone:remover:scan }
  1321. }
  1322.  
  1323.  
  1324. proc clone:punishment {clone chan number total type} {
  1325. global clone_kick_user2_msg clone_banmask_type clone_bantime clone_kick_counter_type clone_kick_user6_msg
  1326. global clone_kick_counter_file clone_punishment_type clone_exempt_ops_voices clone_kick_user1_msg
  1327. global clone_kick_msg_type clone_kick_user3_msg clone_kick_user4_msg clone_kick_user5_msg
  1328. global clone_unresolved_ident clone_exempt_flags clone_exempt_masks clone_exempt_nicks
  1329. if {$clone_kick_counter_type == 1} {
  1330. if {![file exists $clone_kick_counter_file]} {
  1331. create:clone:kick:file $clone_kick_counter_file
  1332. } else {
  1333. set file [open $clone_kick_counter_file "r"]; set current_kicks [gets $file]
  1334. if {$current_kicks == ""} { set current_kicks 1 }
  1335. close $file; set clone_kicks $current_kicks
  1336. }
  1337. }
  1338. set nick [lindex [split $clone :] 0]; set uhost [lindex [split $clone :] 1]
  1339. set clone_banmask [clone:banmask [string map {: !} $clone] $clone_banmask_type]
  1340. switch -- $type {
  1341. 1 {
  1342. switch -- $clone_kick_msg_type {
  1343. 0 { set clone_kick_msg "$clone_kick_user1_msg" }
  1344. 1 { set clone_kick_msg $clone_kick_user1_msg }
  1345. default { set clone_kick_msg "clone_kick_user1_msg" }
  1346. }
  1347. }
  1348. 2 {
  1349. switch -- $clone_kick_msg_type {
  1350. 0 { set clone_kick_msg "$clone_kick_user1_msg" }
  1351. 1 { set clone_kick_msg $clone_kick_user2_msg }
  1352. default { set clone_kick_msg "$clone_kick_user1_msg" }
  1353. }
  1354. }
  1355. 3 {
  1356. switch -- $clone_kick_msg_type {
  1357. 0 { set clone_kick_msg "$clone_kick_user1_msg" }
  1358. 1 { set clone_kick_msg $clone_kick_user3_msg }
  1359. default { set clone_kick_msg "0,1 Clone Join/Part Flood 12,0 - 12Mass 2join/part revolving door flood 12detected 2from 12host 6$clone_banmask" }
  1360. }
  1361. }
  1362. 4 {
  1363. switch -- $clone_kick_msg_type {
  1364. 0 { set clone_kick_msg "0,1 Excessive Clones 12,0 - Excessive 2clones residing 12in channel 12detected 2from 12host 6$clone_banmask" }
  1365. 1 { set clone_kick_msg $clone_kick_user4_msg }
  1366. default { set clone_kick_msg "0,1 Excessive Clones 12,0 - Excessive 2clones residing 12in channel 12detected 2from 12host 6$clone_banmask" }
  1367. }
  1368. }
  1369. 5 {
  1370. switch -- $clone_kick_msg_type {
  1371. 0 { set clone_kick_msg "0,1 Fast Join/Part Flood 12,0 - Fast 2join/part flood 12detected 2from 12host 6$clone_banmask" }
  1372. 1 { set clone_kick_msg $clone_kick_user5_msg }
  1373. default { set clone_kick_msg "0,1 Fast Join/Part Flood 12,0 - Fast 2join/part flood 12detected 2from 12host 6$clone_banmask" }
  1374. }
  1375. }
  1376. 6 {
  1377. switch -- $clone_kick_msg_type {
  1378. 0 { set clone_kick_msg "0,1 Suspected Mass Joining Clones 12,0 - Suspected 2ordered nick 12botnet 12detected 2from 12host 6$clone_banmask" }
  1379. 1 { set clone_kick_msg $clone_kick_user6_msg }
  1380. default { set clone_kick_msg "0,1 Suspected Mass Joining Clones 12,0 - Suspected 2ordered nick 12botnet 12detected 2from 12host 6$clone_banmask" }
  1381. }
  1382. }
  1383. default { set clone_kick_msg "0,1 Clone Flood 12,0 - Mass 2join, join/part, revolving door, excessive clones 12flood 2from 12host 6$clone_banmask" }
  1384. }
  1385. if {$total > 1} { set clone_kick_msg "$clone_kick_msg -2 (Clone 12$number 2of 12$total2)" }
  1386. if {[string match "*(Clone * of *)*" [clone:strip:codes $clone_kick_msg]]} {
  1387. switch -- $clone_kick_counter_type {
  1388. 0 { set clone_kick_msg $clone_kick_msg }
  1389. 1 { set clone_kick_msg "$clone_kick_msg 2,0(Kick #$clone_kicks)" }
  1390. default { set clone_kick_msg $clone_kick_msg }
  1391. }
  1392. } else {
  1393. switch -- $clone_kick_counter_type {
  1394. 0 { set clone_kick_msg $clone_kick_msg }
  1395. 1 { set clone_kick_msg "$clone_kick_msg 2,0- (Kick #$clone_kicks)" }
  1396. default { set clone_kick_msg $clone_kick_msg }
  1397. }
  1398. }
  1399. set message $clone_kick_msg
  1400. if {($clone_punishment_type == 1) || ($clone_punishment_type == 2)} {
  1401. if {($clone_exempt_ops_voices == 1) || ($clone_exempt_ops_voices == 2) && ![isvoice $nick $chan] || ($clone_exempt_ops_voices == 3) && ![isop $nick $chan] || ($clone_exempt_ops_voices == 4) && ![isvoice $nick $chan] && ![isop $nick $chan]} {
  1402. if {[info exists clone_ident]} { unset clone_ident }; if {[info exists clone_global_flag]} { unset clone_global_flag }; if {[info exists clone_local_flag]} { unset clone_local_flag }
  1403. if {[info exists clone_nick]} { unset clone_nick }; if {[info exists clone_mask]} { unset clone_mask }
  1404. if {($clone_unresolved_ident == 1) && [string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { set clone_ident 1 }
  1405. if {([string trim [lindex [split $clone_exempt_flags |] 0]] != "-") && ([string trim [lindex [split $clone_exempt_flags |] 0]] != "")} {
  1406. foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] {
  1407. if {[matchattr [nick2hand $nick $chan] $clone_exempt_global_flag]} {
  1408. break; set clone_global_flag 1
  1409. }
  1410. }
  1411. }
  1412. if {([string trim [lindex [split $clone_exempt_flags |] 1]] != "-") && ([string trim [lindex [split $clone_exempt_flags |] 1]] != "")} {
  1413. foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] {
  1414. if {[matchattr [nick2hand $nick $chan] $clone_exempt_local_flag $chan]} {
  1415. break; set clone_local_flag 1
  1416. }
  1417. }
  1418. }
  1419. if {$clone_exempt_nicks != ""} {
  1420. foreach clone_exempt_nick $clone_exempt_nicks {
  1421. if {[string match -nocase $clone_exempt_nick $nick]} {
  1422. break; set clone_nick 1
  1423. }
  1424. }
  1425. }
  1426. if {$clone_exempt_masks != ""} {
  1427. foreach clone_exempt_mask $clone_exempt_masks {
  1428. if {[string match -nocase *$clone_exempt_mask* "${nick}![getchanhost $nick $chan]"]} {
  1429. break; set clone_mask 1
  1430. }
  1431. }
  1432. }
  1433. if {![info exists clone_ident]} { set clone_ident 0 }; if {![info exists clone_global_flag]} { set clone_global_flag 0 }; if {![info exists clone_local_flag]} { set clone_local_flag 0 }
  1434. if {![info exists clone_nick]} { set clone_nick 0 }; if {![info exists clone_mask]} { set clone_mask 0 }
  1435. if {($clone_ident == 0) && ($clone_global_flag == 0) && ($clone_local_flag == 0) && ($clone_nick == 0) && ($clone_mask == 0)} {
  1436. do:clone:kick $nick $chan $message
  1437. }
  1438. }
  1439. } elseif {$clone_punishment_type == 3} {
  1440. newchanban $chan $clone_banmask clones $message $clone_bantime; return 0
  1441. } elseif {$clone_punishment_type == 4} {
  1442. newban $clone_banmask clones $message $clone_bantime; return 0
  1443. } else {
  1444. if {($clone_exempt_ops_voices == 1) || ($clone_exempt_ops_voices == 2) && ![isvoice $nick $chan] || ($clone_exempt_ops_voices == 3) && ![isop $nick $chan] || ($clone_exempt_ops_voices == 4) && ![isvoice $nick $chan] && ![isop $nick $chan]} {
  1445. if {[info exists clone_ident]} { unset clone_ident }; if {[info exists clone_global_flag]} { unset clone_global_flag }; if {[info exists clone_local_flag]} { unset clone_local_flag }
  1446. if {[info exists clone_nick]} { unset clone_nick }; if {[info exists clone_mask]} { unset clone_mask }
  1447. if {($clone_unresolved_ident == 1) && [string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { set clone_ident 1 }
  1448. if {([string trim [lindex [split $clone_exempt_flags |] 0]] != "-") && ([string trim [lindex [split $clone_exempt_flags |] 0]] != "")} {
  1449. foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] {
  1450. if {[matchattr [nick2hand $nick $chan] $clone_exempt_global_flag]} {
  1451. break; set clone_global_flag 1
  1452. }
  1453. }
  1454. }
  1455. if {([string trim [lindex [split $clone_exempt_flags |] 1]] != "-") && ([string trim [lindex [split $clone_exempt_flags |] 1]] != "")} {
  1456. foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] {
  1457. if {[matchattr [nick2hand $nick $chan] $clone_exempt_local_flag $chan]} {
  1458. break; set clone_local_flag 1
  1459. }
  1460. }
  1461. }
  1462. if {$clone_exempt_nicks != ""} {
  1463. foreach clone_exempt_nick $clone_exempt_nicks {
  1464. if {[string match -nocase $clone_exempt_nick $nick]} {
  1465. break; set clone_nick 1
  1466. }
  1467. }
  1468. }
  1469. if {$clone_exempt_masks != ""} {
  1470. foreach clone_exempt_mask $clone_exempt_masks {
  1471. if {[string match -nocase *$clone_exempt_mask* "${nick}![getchanhost $nick $chan]"]} {
  1472. break; set clone_mask 1
  1473. }
  1474. }
  1475. }
  1476. if {![info exists clone_ident]} { set clone_ident 0 }; if {![info exists clone_global_flag]} { set clone_global_flag 0 }; if {![info exists clone_local_flag]} { set clone_local_flag 0 }
  1477. if {![info exists clone_nick]} { set clone_nick 0 }; if {![info exists clone_mask]} { set clone_mask 0 }
  1478. if {($clone_ident == 0) && ($clone_global_flag == 0) && ($clone_local_flag == 0) && ($clone_nick == 0) && ($clone_mask == 0)} {
  1479. putquick "MODE $chan +b $clone_banmask" -next
  1480. do:clone:kick $nick $chan $message
  1481. }
  1482. }
  1483. }
  1484. }
  1485.  
  1486.  
  1487. proc do:clone:kick {nick chan message} {
  1488. global clone_kick_queue clone_queue_next_option
  1489. switch -- $clone_kick_queue {
  1490. 1 {
  1491. switch -- $clone_queue_next_option {
  1492. 0 { puthelp "KICK $chan $nick :$message" }
  1493. 1 { puthelp "KICK $chan $nick :$message" -next }
  1494. default { puthelp "KICK $chan $nick :$message" -next }
  1495. }
  1496. }
  1497. 2 {
  1498. switch -- $clone_queue_next_option {
  1499. 0 { putserv "KICK $chan $nick :$message" }
  1500. 1 { putserv "KICK $chan $nick :$message" -next }
  1501. default { putserv "KICK $chan $nick :$message" -next }
  1502. }
  1503. }
  1504. 3 {
  1505. putkick $chan $nick $message
  1506. }
  1507. 4 {
  1508. switch -- $clone_queue_next_option {
  1509. 0 { putserv "KICK $chan $nick :$message" }
  1510. 1 { putserv "KICK $chan $nick :$message" -next }
  1511. default { putserv "KICK $chan $nick :$message" -next }
  1512. }
  1513. }
  1514. 5 {
  1515. switch -- $clone_queue_next_option {
  1516. 0 { putquick "KICK $chan $nick :$message" }
  1517. 1 { putquick "KICK $chan $nick :$message" -next }
  1518. default { putquick "KICK $chan $nick :$message" -next }
  1519. }
  1520. }
  1521. 6 { putdccraw 0 [string length "KICK $chan $nick :$message\n"] "KICK $chan $nick :$message\n" }
  1522. default {
  1523. switch -- $clone_queue_next_option {
  1524. 0 { putquick "KICK $chan $nick :$message" }
  1525. 1 { putquick "KICK $chan $nick :$message" -next }
  1526. default { putquick "KICK $chan $nick :$message" -next }
  1527. }
  1528. }
  1529. }
  1530. }
  1531.  
  1532.  
  1533. proc clone:channel:unban {mask chan} {
  1534. if {[botisop $chan] && [ischanban $mask $chan]} {
  1535. pushmode $chan -b $mask
  1536. }
  1537. }
  1538.  
  1539. proc clone:clear:utimers {type} {
  1540. foreach utimer [utimers] {
  1541. if {[string match -nocase "*clone_*_count*" [lindex $utimer 1]]} {
  1542. killutimer [lindex $utimer 2]
  1543. }
  1544. }
  1545. }
  1546.  
  1547.  
  1548. proc clone:join:flood:check {nick uhost hand chan} {
  1549. global clone_channels clone_modelock_switch clone_kick_type clone_kick_msg_type clone_exempt_hosts clone_channel_type clone_banmask_type
  1550. global clone_exempt_hosts clone_exempt_flags clone_exempt_ops clone_exempt_voices clone_unresolved_ident clone_punishment_type clone_bantime
  1551. if {[isbotnick $nick] || ![botisop $chan] || ($clone_channel_type == 1) && ([lsearch -exact [split [string tolower $clone_channels]] [string tolower $chan]] == -1)} { return 1 }
  1552. if {($clone_unresolved_ident == 1) && ![string equal "~" [string index [lindex [split $uhost @] 0] 0]]} { return 1 }
  1553. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 0]]]} { foreach clone_exempt_global_flag [split [string trim [lindex [split $clone_exempt_flags |] 0]] ""] { if {[matchattr $hand $clone_exempt_global_flag]} { return 1 } } }
  1554. if {![string equal "-" [string trim [lindex [split $clone_exempt_flags |] 1]]]} { foreach clone_exempt_local_flag [split [string trim [lindex [split $clone_exempt_flags |] 1]] ""] { if {[matchattr $hand $clone_exempt_local_flag $chan]} { return 1 } } }
  1555. if {$clone_exempt_nicks != ""} { foreach clone_exempt_nick $clone_exempt_nicks { if {[string match -nocase $clone_exempt_nick $nick]} { return 1 } } }
  1556. if {$clone_exempt_masks != ""} { foreach clone_exempt_mask $clone_exempt_masks { if {[string match -nocase $clone_exempt_mask "${nick}![getchanhost $nick $chan]"]} { return 1 } } }
  1557. if {$clone_modelock_switch == 1} { clone:channel:lock $chan }
  1558. if {$clone_punishment_type == 2} {
  1559. set clone_banmask [clone:banmask $nick!$uhost $clone_banmask_type]
  1560. putquick "MODE $chan +b $clone_banmask" -next
  1561. if {$clone_bantime > 0} { timer $clone_bantime [list clone:channel:unban $clone_banmask $chan] }
  1562. }
  1563. set clone_list [list]; set clone_number 0
  1564. foreach user [chanlist $chan] {
  1565. if {[string equal -nocase [lindex [split $uhost @] 1] [lindex [split [getchanhost $user $chan] @] 1]]} {
  1566. lappend clone_list $user:[getchanhost $user $chan]
  1567. }
  1568. }
  1569. foreach clone $clone_list {
  1570. if {[llength $clone_list] > 1} {
  1571. incr clone_number; clone:punishment $clone $chan $clone_number [llength $clone_list] 1
  1572. } else {
  1573. clone:punishment $clone $chan 0 0 1
  1574. }
  1575. }
  1576. utimer 1 [list clone:delay:check:flud [lindex [split $uhost @] 1] $chan 1]; return 1
  1577. }
  1578.  
  1579.  
  1580. proc clone:strip:codes {string} {
  1581. global numversion
  1582. if {$numversion >= 1061700} {
  1583. set string [stripcodes bcruag $string]
  1584. } else {
  1585. regsub -all -- {\003([0-9]{1,2}(,[0-9]{1,2})?)?} $string "" string
  1586. set string [string map {"\017" "" "\037" "" "\002" "" "\026" "" "\006" "" "\007" ""} $string]
  1587. }
  1588. }
  1589.  
  1590. proc clone:banmask [list name [list type $clone_banmask_type]] {
  1591. if {[scan $name {%[^!]!%[^@]@%s} nick user host]!=3} {
  1592. error "Usage: clone:banmask <nick!user@host> \[type\]"
  1593. }
  1594. if {![string is int -strict $type] || $type < 0 || $type > 29} {
  1595. error "Invalid ban type."
  1596. }
  1597. set ip [string match {*[0-9]} $host]
  1598. if {$type < 10 || $ip} {
  1599. if {[string match {[3489]} [expr {$type%10}]]} {
  1600. if $ip {
  1601. set host [join [lrange [split $host .] 0 2] .].*
  1602. } elseif {[string match *.*.* $host]} {
  1603. set host *.[join [lrange [split $host .] end-1 end] .]
  1604. }
  1605. }
  1606. } elseif {$type > 19} {
  1607. regsub -all {[0-9]+} $host * host
  1608. } else {
  1609. regsub -all {[0-9]} $host ? host
  1610. }
  1611. set type [expr {$type%10}]
  1612. if [string match {[1368]} $type] {
  1613. set user *[string trimleft $user ~]
  1614. } elseif {[string match {[2479]} $type]} {
  1615. set user *
  1616. }
  1617. if [string match {[01234]} $type] {
  1618. set nick *
  1619. }
  1620. return $nick!$user@$host
  1621. }
  1622.  
  1623.  
  1624. proc create:clone:kick:file {clonekickfile} {
  1625. putlog "\[MASS JOIN/PART CLONE PROTECTION\] ERROR: The \002clone 'kick counter' file\002 does not exist!"
  1626. putlog "Creating clone kick counter file: \002$clonekickfile\002"
  1627. set file [open $clonekickfile "w"]
  1628. puts $file 1; close $file
  1629. }
  1630.  
  1631. proc clone:kick:counter {nick uhost handle chan target reason} {
  1632. global clone_kick_counter_file clone_kick_counter_type
  1633. if {[isbotnick $nick] && ![isbotnick $target] && ($clone_kick_counter_type == 1)} {
  1634. if {![file exists $clone_kick_counter_file]} {
  1635. create:clone:kick:file $clone_kick_counter_file
  1636. } elseif {[string match -nocase "*(Clone * of *)*" $reason]} {
  1637. set file [open $clone_kick_counter_file "r"]
  1638. set currentkicks [gets $file]; close $file
  1639. set file [open $clone_kick_counter_file "w"]
  1640. puts $file [expr $currentkicks + 1]; close $file
  1641. }
  1642. }
  1643. }
  1644.  
  1645.  
  1646. putlog "\[LOADED\] Mass Clone Join/Part and Revolving Door Protection v4.24.b by \002awyeah (awyeah@awyeah.org)\002"
  1647. if {$clone_channel_type == 1} { putlog "ACTIVE: Mass Clone Join/Part and Revolving Door Protection is ENABLED on: \002[split [string tolower $clone_channels]]\002"
  1648. } elseif {$clone_channel_type == 2} { putlog "ACTIVE: Mass Clone Join/Part and Revolving Door Protection is ENABLED on: \002All channels the bot is on\002"
  1649. } else { putlog "\[UNLOADED\] Mass Clone Join/Part and Revolving Door Protection: \002No channel type selected.\002" }
  1650.  
  1651. putlog "--------------------------------------------------------"
  1652. putlog " MASS CLONE JOIN/PART PROTECTION - MAIN SCRIPT SETTINGS"
  1653. putlog "--------------------------------------------------------"
  1654. if {[string match *0* $clone_join_flood] || ($clone_join_flood == "")} {
  1655. putlog "Clone join protection: \002Disabled\002"
  1656. } else {
  1657. putlog "Clone join protection: \002[lindex [split $clone_join_flood :] 0] or more joins in less than [lindex [split $clone_join_flood :] 1] seconds\002"
  1658. }
  1659. if {[string match *0* $clone_part_flood] || ($clone_part_flood == "")} {
  1660. putlog "Clone part protection: \002Disabled\002"
  1661. } else {
  1662. putlog "Clone part protection: \002[lindex [split $clone_part_flood :] 0] or more parts in less than [lindex [split $clone_part_flood :] 1] seconds\002"
  1663. }
  1664. if {[string match *0* $clone_joinpart_flood] || ($clone_joinpart_flood == "")} {
  1665. putlog "Clone revolving door protection: \002Disabled\002"
  1666. } else {
  1667. putlog "Clone revolving door protection: \002[lindex [split $clone_joinpart_flood :] 0] or more join/part cycles in less than [lindex [split $clone_joinpart_flood :] 1] seconds\002"
  1668. }
  1669. if {$clone_modelock_switch == 0} {
  1670. putlog "Channel lock protection: \002Disabled\002"
  1671. } elseif {$clone_modelock_switch == 1} {
  1672. putlog "Channel lock protection: \002Enabled\002"
  1673. if {$clone_primary_modelock != ""} {
  1674. putlog "Channel mode lock: \002+$clone_primary_modelock$clone_secondary_modelock\002"
  1675. } else {
  1676. putlog "Channel mode lock: \002+m\002"
  1677. }
  1678. }
  1679. if {$clone_notify_switch == 0} {
  1680. putlog "Channel lock notification: \002Disabled\002"
  1681. } elseif {$clone_notify_switch == 1} {
  1682. putlog "Channel lock notification: \002Enabled\002"
  1683. if {$clone_notify_message_type == 1} {
  1684. putlog "Channel lock notification type: \002CHANNEL TEXT\002"
  1685. } elseif {$clone_notify_message_type == 2} {
  1686. putlog "Channel lock notification type: \002CHANNEL NOTICE\002"
  1687. } elseif {$clone_notify_message_type == 3} {
  1688. putlog "Channel lock notification type: \002CHANNEL OP-NOTICE\002"
  1689. }
  1690. }
  1691. if {$clone_exempt_ops == 0} {
  1692. putlog "Channel operators exemption: \002Disabled\002"
  1693. } elseif {$clone_exempt_ops == 1} {
  1694. putlog "Channel operators exemption: \002Enabled\002"
  1695. }
  1696. if {$clone_exempt_voices == 0} {
  1697. putlog "Channel voices exemption: \002Disabled\002"
  1698. } elseif {$clone_exempt_voices == 1} {
  1699. putlog "Channel voices exemption: \002Enabled\002"
  1700. }
  1701. if {[string equal "-" $clone_exempt_flags] || [string equal "-|-" $clone_exempt_flags] || ($clone_exempt_flags == "")} {
  1702. putlog "User flags exemption: \002Disabled\002"
  1703. } else {
  1704. putlog "User flags exemption: \002Enabled\002"
  1705. putlog "User flags: \002$clone_exempt_flags\002"
  1706. }
  1707. if {$clone_banmask_type > 0} {
  1708. if {[string equal "1" [string length $clone_banmask_type]]} {
  1709. if {$clone_banmask_type == 0} {
  1710. putlog "Banmask type: \002*!user@host.domain\002"
  1711. } elseif {$clone_banmask_type == 1} {
  1712. putlog "Banmask type: \002*!*user@host.domain\002"
  1713. } elseif {$clone_banmask_type == 2} {
  1714. putlog "Banmask type: \002*!*@host.domain\002"
  1715. } elseif {$clone_banmask_type == 3} {
  1716. putlog "Banmask type: \002*!*user@*.domain\002"
  1717. } elseif {$clone_banmask_type == 4} {
  1718. putlog "Banmask type: \002*!*@*.domain\002"
  1719. } elseif {$clone_banmask_type == 5} {
  1720. putlog "Banmask type: \002nick!user@host.domain\002"
  1721. } elseif {$clone_banmask_type == 6} {
  1722. putlog "Banmask type: \002nick!*user@host.domain\002"
  1723. } elseif {$clone_banmask_type == 7} {
  1724. putlog "Banmask type: \002nick!*@host.domain\002"
  1725. } elseif {$clone_banmask_type == 8} {
  1726. putlog "Banmask type: \002nick!*user@*.domain\002"
  1727. } elseif {$clone_banmask_type == 9} {
  1728. putlog "Banmask type: \002nick!*@*.domain\002"
  1729. }
  1730. } elseif {[string equal "2" [string length $clone_banmask_type]]} {
  1731. if {[string equal "0" [string index $clone_banmask_type 1]]} {
  1732. set clone_display_banmask "Banmask type: \002*!user@host.domain\002"
  1733. } elseif {[string equal "1" [string index $clone_banmask_type 1]]} {
  1734. set clone_display_banmask "Banmask type: \002*!*user@host.domain\002"
  1735. } elseif {[string equal "2" [string index $clone_banmask_type 1]]} {
  1736. set clone_display_banmask "Banmask type: \002*!*@host.domain\002"
  1737. } elseif {[string equal "3" [string index $clone_banmask_type 1]]} {
  1738. set clone_display_banmask "Banmask type: \002*!*user@*.domain\002"
  1739. } elseif {[string equal "4" [string index $clone_banmask_type 1]]} {
  1740. set clone_display_banmask "Banmask type: \002*!*@*.domain\002"
  1741. } elseif {[string equal "5" [string index $clone_banmask_type 1]]} {
  1742. set clone_display_banmask "Banmask type: \002nick!user@host.domain\002"
  1743. } elseif {[string equal "6" [string index $clone_banmask_type 1]]} {
  1744. set clone_display_banmask "Banmask type: \002nick!*user@host.domain\002"
  1745. } elseif {[string equal "7" [string index $clone_banmask_type 1]]} {
  1746. set clone_display_banmask "Banmask type: \002nick!*@host.domain\002"
  1747. } elseif {[string equal "8" [string index $clone_banmask_type 1]]} {
  1748. set clone_display_banmask "Banmask type: \002nick!*user@*.domain\002"
  1749. } elseif {[string equal "9" [string index $clone_banmask_type 1]]} {
  1750. set clone_display_banmask "Banmask type: \002nick!*@*.domain\002"
  1751. }
  1752. if {[string equal "1" [string index $clone_banmask_type 0]]} {
  1753. set clone_banmask_wildcard "?"
  1754. } elseif {[string equal "2" [string index $clone_banmask_type 0]]} {
  1755. set clone_banmask_wildcard "*"
  1756. }
  1757. putlog "$clone_display_banmask \002(replacing numbers in the *!*@host with the '$clone_banmask_wildcard' wildcard)\002"
  1758. }
  1759. }
  1760. if {$clone_punishment_type == 1} {
  1761. putlog "Punishment type: \002Kick all clones from the channel\002"
  1762. } elseif {$clone_punishment_type == 2} {
  1763. putlog "Punishment type: \002Kick and ban all clones from the channel\002"
  1764. } elseif {$clone_punishment_type == 3} {
  1765. putlog "Punishment type: \002Kick and ban all clones from the channel - STICKY BAN\002"
  1766. } elseif {$clone_punishment_type == 4} {
  1767. putlog "Punishment type: \002Kick and ban all clones and users matching clones *!*@host from all channels found on matching with the bot - GLOBAL BAN\002"
  1768. } else {
  1769. putlog "Punishment type: \002Kick and ban all clones from the channel\002"
  1770. }
  1771. if {$clone_bantime == 0} {
  1772. putlog "Ban time: \002PERMANENT\002"
  1773. } else {
  1774. putlog "Ban time: \002$clone_bantime minutes\002"
  1775. }
  1776. if {$clone_kick_msg_type == 1} {
  1777. putlog "Kick messages: \002User defined\002"
  1778. } else {
  1779. putlog "Kick messages: \002Script defaults\002"
  1780. }
  1781. if {$clone_kick_counter_type == 0} {
  1782. putlog "Kick counter: \002Disabled\002"
  1783. } elseif {$clone_kick_counter_type == 1} {
  1784. putlog "Kick counter: \002Enabled\002"
  1785. }
  1786. putlog "------------------------------------------------------"
  1787. if {$clone_flyby_type == 0} {
  1788. putlog "Flyby module: \002Disabled\002"
  1789. } elseif {$clone_flyby_type == 1} {
  1790. putlog "Flyby module: \002Enabled\002"
  1791. putlog "Maximum flyby time: \002$clone_flyby_time seconds\002"
  1792. if {$clone_flyby_reason_length > 0} {
  1793. putlog "Flyby part message length: \002$clone_flyby_reason_length characters\002"
  1794. } else {
  1795. putlog "Flyby part message length: \002Disabled\002"
  1796. }
  1797. }
  1798. putlog "------------------------------------------------------"
  1799. if {$clone_remover_type == 0} {
  1800. putlog "Clone remover module: \002Disabled\002"
  1801. } elseif {$clone_remover_type == 1} {
  1802. putlog "Clone remover module: \002Scan channel for clones on user joins\002"
  1803. } elseif {$clone_remover_type == 2} {
  1804. putlog "Clone remover module: \002Full channel scan for clones on user joins\002"
  1805. } elseif {($clone_remover_type == 3) && ($clone_remover_time > 0)} {
  1806. putlog "Clone remover module: \002Full channel scan for clones every $clone_remover_time minutes\002"
  1807. }
  1808. if {$clone_max_allowed > 0} {
  1809. putlog "Maximum clones allowed: \002$clone_max_allowed\002"
  1810. }
  1811. putlog "------------------------------------------------------"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement