Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2017
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 23.20 KB | None | 0 0
  1. #####################################################################
  2.  
  3. #####################################################################
  4.  
  5. ##           Invite.tcl By xAkc <xAkc@web-bg.org>                  ##
  6.  
  7. #####################################################################
  8.  
  9. #####################################################################
  10.  
  11.  
  12.  
  13. set type_ban "20"
  14.  
  15.  
  16.  
  17. #### (I've decided that n?c?* | *n?c?* | *n?c? | *i?e?t* is exremely dangerous,
  18.  
  19. #### so I will NOT add them, if you thinks it is needed, mail me!)
  20.  
  21. # Types are:
  22.  
  23. ## 1 - nick!*@*
  24.  
  25. ## 2 - nick*!*@*
  26.  
  27. ## 3 - *nick*!*@*
  28.  
  29. ## 4 - *!ident@*
  30.  
  31. ## 5 - *!*ident@*
  32.  
  33. ## 6 - *!*ident*@*
  34.  
  35. ## 7 - *!*ident@*.host.com
  36.  
  37. ## 8 - *!ident@*.host.com
  38.  
  39. ## 9 - *!*ident*@*.host.com
  40.  
  41. ## 10 - *!ident@some.host.com
  42.  
  43. ## 11 - *!*ident@some.host.com
  44.  
  45. ## 12 - *!*ident*@some.host.com
  46.  
  47. ## 13 - nick!*@*.host.com
  48.  
  49. ## 14 - nick*!*@*.host.com
  50.  
  51. ## 15 - *nick*!*@*.host.com
  52.  
  53. ## 16 - nick*!*@some.host.com
  54.  
  55. ## 17 - *nick*!*@some.host.com
  56.  
  57. ## 18 - nick!*@some.host.com
  58.  
  59. ## 19 - *!*@*.com
  60.  
  61. ## 20 - *!*@some.host.com
  62.  
  63. ## 21 - nick!ident@some.host.com
  64.  
  65. ## 22 - nick*!*ident@some.host.com
  66.  
  67. ## 23 - *nick*!*ident@some.host.com
  68.  
  69. ## 24 - nick!*ident@some.host.com
  70.  
  71. ## 25 - nick*!ident@some.host.com
  72.  
  73. ## 26 - *nick*!ident@some.host.com
  74.  
  75. ## 27 - nick!ident@some.host.com
  76.  
  77. ## 28 - nick*!*ident*@some.host.com
  78.  
  79. ## 29 - *nick*!*ident*@some.host.com
  80.  
  81. ## 30 - nick!*ident*@some.host.com
  82.  
  83. ## 31 - nick*!*ident@*.host.com
  84.  
  85. ## 32 - *nick*!*ident@*.host.com
  86.  
  87. ## 33 - nick!*ident@*.host.com
  88.  
  89. ## 34 - nick*!ident@*.host.com
  90.  
  91. ## 35 - *nick*!ident@*.host.com
  92.  
  93. ## 36 - nick!ident@*.host.com
  94.  
  95. ## 37 - nick*!*ident*@*.host.com
  96.  
  97. ## 38 - *nick*!*ident*@*.host.com
  98.  
  99. ## 39 - nick!*ident*@*.host.com
  100.  
  101. ## 40 - n?c?!*i?e?t@*.host.com
  102.  
  103. ## 41 - n?c?!i?e?t@some.host.com
  104.  
  105. ## 42 - n?c?!*i?e?t@some.host.com
  106.  
  107. ## 43 - n?c?!*ident@*.host.com
  108.  
  109. ## 44 - n?c?!ident@some.host.com
  110.  
  111. ## 45 - n?c?!*ident@some.host.com
  112.  
  113. ## 46 - nick!*i?e?t@*.host.com
  114.  
  115. ## 47 - nick!i?e?t@some.host.com
  116.  
  117. ## 48 - nick!*i?e?t@some.host.com
  118.  
  119.  
  120.  
  121. ## Set this to the words that are forbidden, like b if It sees *b* boom banned!
  122.  
  123. ## ** These words are for all of the things you want to check.
  124.  
  125. ## ** The second var is for a couple of words i.e. "join my ch|part my ch"
  126.  
  127. ## if it sees *join my ch* banned!
  128.  
  129. ## i.e "# www http"
  130.  
  131. set forbidden "#"
  132.  
  133. set whole_forb "#"
  134.  
  135.  
  136.  
  137. ## To ban when a user <B> MESSAGEs </B> me with the word(s). The second is
  138.  
  139. ## for phrases.
  140.  
  141. set msg_forb "#"
  142.  
  143. set whole_msg "#"
  144.  
  145.  
  146.  
  147. ## To ban when a user says <B> PUBLIC </B> the word(s). The second is for
  148.  
  149. ## phrases.
  150.  
  151. set pub_forb "#"
  152.  
  153. set whole_pub "#"
  154.  
  155.  
  156.  
  157.  
  158.  
  159. ## To ban when a user <B> NOTICEs </B> me with the word(s). The second is for
  160.  
  161. ## phrases.
  162.  
  163. set notc_forb "#"
  164.  
  165. set whole_notc "#"
  166.  
  167.  
  168.  
  169. ## To ban when a user <B> QUITs </B> with the word(s). The second is for
  170.  
  171. ## phrases.
  172.  
  173. set quit_forb "#"
  174.  
  175. set whole_quit "#"
  176.  
  177.  
  178.  
  179. ## To ban when a user <B> CTCPs </B> me with the word(s). The second is for
  180.  
  181. ## phrases.
  182.  
  183. set ctcp_forb "#"
  184.  
  185. set whole_ctcp "#"
  186.  
  187.  
  188.  
  189. ## To ban when a user <B> CTCP REPLYs </B> me with the word(s). The second is
  190.  
  191. ## for phrases.
  192.  
  193. set ctcr_forb "#"
  194.  
  195. set whole_ctcr "#"
  196.  
  197.  
  198.  
  199. ## To ban when a user set the <B> TOPIC </B> of a channel to some word(s).
  200.  
  201. ## The second is for phrases.
  202.  
  203. set topc_forb "TakeOver"
  204.  
  205. set whole_topc "Take Over"
  206.  
  207.  
  208.  
  209. ## To ban when a user <B> KICKs </B> someone of a channel with the word(s).
  210.  
  211. ## The second is for phrases.
  212.  
  213. set kick_forb "#"
  214.  
  215. set whole_kick "Take Over"
  216.  
  217.  
  218.  
  219. ## Set this to the reason, why it is kick banned!
  220.  
  221. set reason "of $nick, Reason: Fucking inviter!"
  222.  
  223.  
  224.  
  225. ## Set this to the time that the ban exists. Set to 0,if you want it to be perm.
  226.  
  227. set time 60
  228.  
  229.  
  230.  
  231. ## Do you want to kb, to bk or to kick. Or you want it to don't take actions,
  232.  
  233. ## only to make a global ban. Only one can be 1, the others should be 0.
  234.  
  235. set kb 0
  236.  
  237. set bk 1
  238.  
  239. set k 0
  240.  
  241.  
  242.  
  243. ## Which users will I not ban? When they have flags:
  244.  
  245. set flags "f"
  246.  
  247.  
  248.  
  249. ## /me is still needed to be done!
  250.  
  251. ## You want to check:
  252.  
  253. # /msg
  254.  
  255. set msg 1
  256.  
  257. # public
  258.  
  259. set pub 1
  260.  
  261. # /notice
  262.  
  263. set notc 1
  264.  
  265. # /ctcp
  266.  
  267. set ctcp 1
  268.  
  269. # /ctcp reply
  270.  
  271. set ctcr 1
  272.  
  273. # /quit
  274.  
  275. set quit 0
  276.  
  277. # /topic
  278.  
  279. set invt 0
  280.  
  281. # kick message
  282.  
  283. set invk 1
  284.  
  285. # action on the botnet
  286.  
  287. set dcca 1
  288.  
  289.  
  290.  
  291. ################################################################################
  292.  
  293. #### YOU DO NOT NEED TO CHANGE ANYTHING BELOW, UNLESS YOU REALLY KNOW WHAT  ####
  294.  
  295. #### YOU ARE DOING !!!                                                      ####
  296.  
  297. ################################################################################
  298.  
  299.  
  300.  
  301. # Needed to bind all.
  302.  
  303. if {$msg  == 1} { bind msgm - * invite_msg  }
  304.  
  305. if {$pub  == 1} { bind pubm - * invite_pub  }
  306.  
  307. if {$notc == 1} { bind notc - * invite_notc }
  308.  
  309. if {$ctcp == 1} { bind ctcp - * invite_ctcp }
  310.  
  311. if {$ctcr == 1} { bind ctcr - * invite_ctcr }
  312.  
  313. if {$quit == 1} { bind sign - * invite_quit }
  314.  
  315. if {$invt == 1} { bind topc - * invite_topc }
  316.  
  317. if {$invk == 1} { bind kick - * invite_kick }
  318.  
  319. if {$dcca == 1} { bind act  - * invite_act  }
  320.  
  321.  
  322.  
  323. # Checks if you've edit the invite.tcl right.
  324.  
  325. if {$k  == 1 && $bk == 1} {
  326.  
  327.     die "Error in Configuration file invite.tcl line: 76-78"
  328.  
  329. }
  330.  
  331. if {$k  == 1 && $kb == 1} {
  332.  
  333.     die "Error in Configuration file invite.tcl line: 76-78"
  334.  
  335. }
  336.  
  337. if {$kb == 1 && $bk == 1} {
  338.  
  339.     die "Error in Configuration file invite.tcl line: 76-78"
  340.  
  341. }
  342.  
  343.  
  344.  
  345. # Proc for kick reason.
  346.  
  347. proc invite_kick {nick uhost hand chan targ arg} {
  348.  
  349.     global botnick reason time bk k kb flags forbidden kick_forb whole_kick whole_forb
  350.  
  351.     set arg [strip:all $arg]
  352.  
  353.     if {[matchattr $hand $flags] == 1 || $nick == $botnick || [lindex [split $uhost @] 1] == ""} {
  354.  
  355.     return
  356.  
  357.     }
  358.  
  359.     set goon 0
  360.  
  361.     foreach bind $forbidden {
  362.  
  363.     if {[string match "*$bind*" $arg]} {
  364.  
  365.         set goon 1
  366.  
  367.     }
  368.  
  369.     }
  370.  
  371.     foreach bindk $kick_forb {
  372.  
  373.     if {[string match "*$bindk*" $arg]} {
  374.  
  375.         set goon 1
  376.  
  377.     }
  378.  
  379.     }
  380.  
  381.     foreach wk [split $whole_kick |] {
  382.  
  383.     if {[string match "*$wk*" $arg]} {
  384.  
  385.         set goon 1
  386.  
  387.     }
  388.  
  389.     }
  390.  
  391.     foreach wf [split $whole_forb |] {
  392.  
  393.     if {[string match "*$wf*" $arg]} {
  394.  
  395.         set goon 1
  396.  
  397.     }
  398.  
  399.     }
  400.  
  401.     if {$goon == 1} {
  402.  
  403.         set ban [bancheck $uhost $nick]
  404.  
  405.         newban $ban $botnick $reason $time
  406.  
  407.         foreach chan [channels] {
  408.  
  409.         if {[onchan $nick $chan] == 1} {
  410.  
  411.             if {$kb == 1} { kb $nick $chan $ban }
  412.  
  413.         if {$bk == 1} { bk $nick $chan $ban }
  414.  
  415.         if {$k  == 1} { k  $nick $chan $ban }
  416.  
  417.         }
  418.  
  419.     }
  420.  
  421.     }
  422.  
  423. }
  424.  
  425.  
  426.  
  427.  
  428.  
  429. # Proc for topic change.
  430.  
  431. proc invite_topc {nick uhost hand chan arg} {
  432.  
  433.     global botnick reason time bk k kb flags forbidden topc_forb whole_topc whole_forb
  434.  
  435.     set arg [strip:all $arg]
  436.  
  437.     if {[matchattr $hand $flags] == 1 || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  438.  
  439.     return
  440.  
  441.     }
  442.  
  443.     set goon 0
  444.  
  445.     foreach bind $forbidden {
  446.  
  447.     if {[string match "*$bind*" $arg]} {
  448.  
  449.         set goon 1
  450.  
  451.     }
  452.  
  453.     }
  454.  
  455.     foreach bindtop $topc_forb {
  456.  
  457.     if {[string match "*$bindtop*" $arg]} {
  458.  
  459.         set goon 1
  460.  
  461.     }
  462.  
  463.     }
  464.  
  465.     foreach wt [split $whole_topc |] {
  466.  
  467.     if {[string match "*$wt*" $arg]} {
  468.  
  469.         set goon 1
  470.  
  471.     }
  472.  
  473.     }
  474.  
  475.     foreach wf [split $whole_forb |] {
  476.  
  477.     if {[string match "*$wf*" $arg]} {
  478.  
  479.         set goon 1
  480.  
  481.     }
  482.  
  483.     }
  484.  
  485.     if {$goon == 1} {
  486.  
  487.         set ban [bancheck $uhost $nick]
  488.  
  489.         newban $ban $botnick $reason $time
  490.  
  491.         foreach chan [channels] {
  492.  
  493.         if {[onchan $nick $chan] == 1} {
  494.  
  495.             if {$kb == 1} { kb $nick $chan $ban }
  496.  
  497.         if {$bk == 1} { bk $nick $chan $ban }
  498.  
  499.         if {$k  == 1} { k  $nick $chan $ban }
  500.  
  501.         }
  502.  
  503.     }
  504.  
  505.     }
  506.  
  507.  
  508.  
  509. }
  510.  
  511.  
  512.  
  513. # Proc for msg invites.
  514.  
  515. proc invite_msg {nick uhost hand arg} {
  516.  
  517.     global botnick reason time bk k kb flags forbidden msg_forb whole_msg whole_forb
  518.  
  519.     set arg [strip:all $arg]
  520.  
  521.    
  522.  
  523.     if {[matchattr $hand $flags] == 1  || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  524.  
  525.     return
  526.  
  527.     }
  528.  
  529.     set goon 0
  530.  
  531.     foreach bind $forbidden {
  532.  
  533.     if {[string match "*$bind*" $arg]} {
  534.  
  535.         set goon 1
  536.  
  537.     }
  538.  
  539.     }
  540.  
  541.     foreach bindm $msg_forb {
  542.  
  543.     if {[string match "*$bindm*" $arg]} {
  544.  
  545.         set goon 1
  546.  
  547.     }
  548.  
  549.     }
  550.  
  551.     foreach wm [split $whole_msg |] {
  552.  
  553.     if {[string match "*$wm*" $arg]} {
  554.  
  555.         set goon 1
  556.  
  557.     }
  558.  
  559.     }
  560.  
  561.     foreach wf [split $whole_forb |] {
  562.  
  563.     if {[string match "*$wf*" $arg]} {
  564.  
  565.         set goon 1
  566.  
  567.     }
  568.  
  569.     }
  570.  
  571.     if {$goon == 1} {
  572.  
  573.         set ban [bancheck $uhost $nick]
  574.  
  575.         newban $ban $botnick $reason $time
  576.  
  577.         foreach chan [channels] {
  578.  
  579.         if {[onchan $nick $chan] == 1} {
  580.  
  581.             if {$kb == 1} { kb $nick $chan $ban }
  582.  
  583.         if {$bk == 1} { bk $nick $chan $ban }
  584.  
  585.         if {$k  == 1} { k  $nick $chan $ban }
  586.  
  587.         }
  588.  
  589.     }
  590.  
  591.     }
  592.  
  593. }
  594.  
  595.  
  596.  
  597. # Proc for public invites.
  598.  
  599. proc invite_pub {nick uhost hand chan arg} {
  600.  
  601.     global botnick reason time bk k kb flags forbidden pub_forb whole_pub whole_forb
  602.  
  603.  
  604.  
  605.     set arg [strip:all $arg]
  606.  
  607.     set go 0
  608.  
  609.     if {[matchattr $hand $flags] == 1 || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  610.  
  611.     return
  612.  
  613.     }
  614.  
  615.     foreach bind $forbidden {
  616.  
  617.     if {[string match "*$bind*" $arg]} {
  618.  
  619.         set go 1
  620.  
  621.     }
  622.  
  623.     }
  624.  
  625.     foreach bindp $pub_forb {
  626.  
  627.     if {[string match "*$bindp*" $arg]} {
  628.  
  629.         set go 1
  630.  
  631.     }
  632.  
  633.     }
  634.  
  635.     foreach wp [split $whole_pub |] {
  636.  
  637.     if {[string match "*$wp*" $arg]} {
  638.  
  639.         set go 1
  640.  
  641.     }
  642.  
  643.     }
  644.  
  645.     foreach wf [split $whole_forb |] {
  646.  
  647.     if {[string match "*$wf*" $arg]} {
  648.  
  649.         set go 1
  650.  
  651.     }
  652.  
  653.     }
  654.  
  655.     if {$go == 1} {
  656.  
  657.         set ban [bancheck $uhost $nick]
  658.  
  659.         newban $ban $botnick $reason $time
  660.  
  661.     foreach chan [channels] {
  662.  
  663.         if {[onchan $nick $chan] == 1} {
  664.  
  665.             if {$kb == 1} { kb $nick $chan $ban }
  666.  
  667.             if {$bk == 1} { bk $nick $chan $ban }
  668.  
  669.             if {$k  == 1} { k  $nick $chan $ban }
  670.  
  671.         }
  672.  
  673.     }
  674.  
  675.     }
  676.  
  677. }
  678.  
  679.  
  680.  
  681. # Proc for notice invites.
  682.  
  683. proc invite_notc {nick uhost hand arg dest} {
  684.  
  685.     global botnick reason time bk k kb flags forbidden notc_forb whole_notc whole_forb
  686.  
  687.     set arg [strip:all $arg]
  688.  
  689.    
  690.  
  691.     if {[matchattr $hand $flags] == 1 || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  692.  
  693.     return
  694.  
  695.     }
  696.  
  697.     set goon 0
  698.  
  699.     foreach bind $forbidden {
  700.  
  701.     if {[string match "*$bind*" $arg]} {
  702.  
  703.         set goon 1
  704.  
  705.     }
  706.  
  707.     }
  708.  
  709.     foreach bindn $notc_forb {
  710.  
  711.     if {[string match "*$bindn*" $arg]} {
  712.  
  713.         set goon 1
  714.  
  715.     }
  716.  
  717.     }
  718.  
  719.     foreach wn [split $whole_notc |] {
  720.  
  721.     if {[string match "*$wn*" $arg]} {
  722.  
  723.         set goon 1
  724.  
  725.     }
  726.  
  727.     }
  728.  
  729.     foreach wf [split $whole_forb |] {
  730.  
  731.     if {[string match "*$wf*" $arg]} {
  732.  
  733.         set goon 1
  734.  
  735.     }
  736.  
  737.     }
  738.  
  739.     if {$goon == 1} {
  740.  
  741.         set ban [bancheck $uhost $nick]
  742.  
  743.         newban $ban $botnick $reason $time
  744.  
  745.         foreach chan [channels] {
  746.  
  747.         if {[onchan $nick $chan] == 1} {
  748.  
  749.             if {$kb == 1} { kb $nick $chan $ban }
  750.  
  751.         if {$bk == 1} { bk $nick $chan $ban }
  752.  
  753.         if {$k  == 1} { k  $nick $chan $ban }
  754.  
  755.         }
  756.  
  757.     }
  758.  
  759.     }
  760.  
  761. }
  762.  
  763.  
  764.  
  765. # Proc for CTCP REPLY invites.
  766.  
  767. proc invite_ctcr {nick uhost hand dest keyword args} {
  768.  
  769.     set arg "$keyword [lindex [split [string trimleft $args \{] "\}"] 0]"
  770.  
  771.     global botnick reason time bk k kb flags forbidden ctcr_forb whole_ctcr whole_forb
  772.  
  773.     set arg [strip:all $arg]
  774.  
  775.    
  776.  
  777.     if {[matchattr $hand $flags] == 1 || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  778.  
  779.     return
  780.  
  781.     }
  782.  
  783.     set goon 0
  784.  
  785.     foreach bind $forbidden {
  786.  
  787.     if {[string match "*$bind*" $arg]} {
  788.  
  789.         set goon 1
  790.  
  791.     }
  792.  
  793.     }
  794.  
  795.     foreach bindcp $ctcp_forb {
  796.  
  797.     if {[string match "*$bindcp*" $arg]} {
  798.  
  799.         set goon 1
  800.  
  801.     }
  802.  
  803.     }
  804.  
  805.     foreach wr [split $whole_ctcr |] {
  806.  
  807.     if {[string match "*$wr*" $arg]} {
  808.  
  809.         set goon 1
  810.  
  811.     }
  812.  
  813.     }
  814.  
  815.     foreach wf [split $whole_forb |] {
  816.  
  817.     if {[string match "*$wf*" $arg]} {
  818.  
  819.         set goon 1
  820.  
  821.     }
  822.  
  823.     }
  824.  
  825.     if {$goon == 1} {
  826.  
  827.         set ban [bancheck $uhost $nick]
  828.  
  829.         newban $ban $botnick $reason $time
  830.  
  831.         foreach chan [channels] {
  832.  
  833.         if {[onchan $nick $chan] == 1} {
  834.  
  835.             if {$kb == 1} { kb $nick $chan $ban }
  836.  
  837.         if {$bk == 1} { bk $nick $chan $ban }
  838.  
  839.         if {$k  == 1} { k  $nick $chan $ban }
  840.  
  841.         }
  842.  
  843.     }
  844.  
  845.     }
  846.  
  847. }
  848.  
  849.  
  850.  
  851. # Proc for CTCP invites.
  852.  
  853. proc invite_ctcp {nick uhost hand dest keyword args} {
  854.  
  855.     set arg "$keyword [lindex [split [string trimleft $args \{] "\}"] 0]"
  856.  
  857.     global botnick reason time bk k kb flags forbidden ctcp_forb whole_ctcp whole_forb
  858.  
  859.     set arg [strip:all $arg]
  860.  
  861.    
  862.  
  863.     if {[matchattr $hand $flags] == 1 || [string tolower $nick] == [string tolower $botnick] || [lindex [split $uhost @] 1] == ""} {
  864.  
  865.     return
  866.  
  867.     }
  868.  
  869.     set goon 0
  870.  
  871.     foreach bind $forbidden {
  872.  
  873.     if {[string match "*$bind*" $arg]} {
  874.  
  875.         set goon 1
  876.  
  877.     }
  878.  
  879.     }
  880.  
  881.     foreach bindcr $ctcp_forb {
  882.  
  883.     if {[string match "*$bindcr*" $arg]} {
  884.  
  885.         set goon 1
  886.  
  887.     }
  888.  
  889.     }
  890.  
  891.     foreach wp [split $whole_ctcp |] {
  892.  
  893.     if {[string match "*$wp*" $arg]} {
  894.  
  895.         set goon 1
  896.  
  897.     }
  898.  
  899.     }
  900.  
  901.     foreach wf [split $whole_forb |] {
  902.  
  903.     if {[string match "*$wf*" $arg]} {
  904.  
  905.         set goon 1
  906.  
  907.     }
  908.  
  909.     }
  910.  
  911.     if {$goon == 1} {
  912.  
  913.         set ban [bancheck $uhost $nick]
  914.  
  915.         newban $ban $botnick $reason $time
  916.  
  917.         foreach chan [channels] {
  918.  
  919.         if {[onchan $nick $chan] == 1} {
  920.  
  921.             if {$kb == 1} { kb $nick $chan $ban }
  922.  
  923.         if {$bk == 1} { bk $nick $chan $ban }
  924.  
  925.         if {$k  == 1} { k  $nick $chan $ban }
  926.  
  927.         }
  928.  
  929.     }
  930.  
  931.     }
  932.  
  933. }
  934.  
  935.  
  936.  
  937. # Proc for QUIT invites.
  938.  
  939. proc invite_quit {nick uhost hand chan arg} {
  940.  
  941.     global botnick reason time bk k kb flags forbidden quit_forb whole_quit whole_forb
  942.  
  943.     set arg [strip:all $arg]
  944.  
  945.    
  946.  
  947.     if {[matchattr $hand $flags] == 1 || [lindex [split $uhost @] 1] == ""} {
  948.  
  949.     return
  950.  
  951.     }
  952.  
  953.     set goon 0
  954.  
  955.     foreach bind $forbidden {
  956.  
  957.     if {[string match "*$bind*" $arg]} {
  958.  
  959.         set goon 1
  960.  
  961.     }
  962.  
  963.     }
  964.  
  965.     foreach bindq $quit_forb {
  966.  
  967.     if {[string match "*$bindq*" $arg]} {
  968.  
  969.         set goon 1
  970.  
  971.     }
  972.  
  973.     }
  974.  
  975.     foreach wq [split $whole_quit |] {
  976.  
  977.     if {[string match "*$wq*" $arg]} {
  978.  
  979.         set goon 1
  980.  
  981.     }
  982.  
  983.     }
  984.  
  985.     foreach wf [split $whole_forb |] {
  986.  
  987.     if {[string match "*$wf*" $arg]} {
  988.  
  989.         set goon 1
  990.  
  991.     }
  992.  
  993.     }
  994.  
  995.     if {$goon == 1} {
  996.  
  997.         set ban [bancheck $uhost $nick]
  998.  
  999.         newban $ban $botnick $reason $time
  1000.  
  1001.         foreach chan [channels] {
  1002.  
  1003.         if {[onchan $nick $chan] == 1} {
  1004.  
  1005.             if {$kb == 1} { kb $nick $chan $ban }
  1006.  
  1007.         if {$bk == 1} { bk $nick $chan $ban }
  1008.  
  1009.         if {$k  == 1} { k  $nick $chan $ban }
  1010.  
  1011.         }
  1012.  
  1013.     }
  1014.  
  1015.     }
  1016.  
  1017. }
  1018.  
  1019.  
  1020.  
  1021. # With this proc you can really get your wanted ban!
  1022.  
  1023. proc bancheck {uhost nick } {
  1024.  
  1025.     global type_ban
  1026.  
  1027.     if {$type_ban == 1} {
  1028.  
  1029.     return "$nick!*@*"
  1030.  
  1031.     }
  1032.  
  1033.     if {$type_ban == 2} {
  1034.  
  1035.     return "$nick*!*@*"
  1036.  
  1037.     }
  1038.  
  1039.     if {$type_ban == 3} {
  1040.  
  1041.     return "*$nick*!*@*"
  1042.  
  1043.     }
  1044.  
  1045.     if {$type_ban == 4} {
  1046.  
  1047.     return "*![lindex [split $uhost "@"] 0]@*"
  1048.  
  1049.     }
  1050.  
  1051.     if {$type_ban == 5} {
  1052.  
  1053.         regsub {~} $uhost "" uhost
  1054.  
  1055.     return "*!*[lindex [split $uhost "@"] 0]@*"
  1056.  
  1057.     }
  1058.  
  1059.     if {$type_ban == 6} {
  1060.  
  1061.         regsub {~} $uhost "" uhost
  1062.  
  1063.     return "*!*[lindex [split $uhost "@"] 0]*@*"
  1064.  
  1065.     }
  1066.  
  1067.     if {$type_ban == 7} {
  1068.  
  1069.         regsub {~} $uhost "" uhost
  1070.  
  1071.     return "*!*[lindex [split [maskhost $uhost] "!"] 1]"
  1072.  
  1073.     }
  1074.  
  1075.     if {$type_ban == 8} {
  1076.  
  1077.         regsub {~} $uhost "" uhost
  1078.  
  1079.     return "*!*[lindex [split $uhost "@"] 0]*@*"
  1080.  
  1081.     }
  1082.  
  1083.     if {$type_ban == 9} {
  1084.  
  1085.         regsub {~} $uhost "" uhost
  1086.  
  1087.     return "*!*[lindex [split $uhost "@"] 0]*@[lindex [split [maskhost $uhost] "@"] 1]"
  1088.  
  1089.     }
  1090.  
  1091.     if {$type_ban == 10} {
  1092.  
  1093.     return "*!$uhost"
  1094.  
  1095.     }
  1096.  
  1097.     if {$type_ban == 11} {
  1098.  
  1099.         regsub {~} $uhost "" uhost
  1100.  
  1101.         return "*!*$uhost"
  1102.  
  1103.     }
  1104.  
  1105.     if {$type_ban == 12} {
  1106.  
  1107.         regsub {~} $uhost "" uhost
  1108.  
  1109.     return "*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
  1110.  
  1111.     }
  1112.  
  1113.     if {$type_ban == 13} {
  1114.  
  1115.     return "$nick!*@[lindex [split [maskhost $uhost] "@"] 1]"
  1116.  
  1117.     }
  1118.  
  1119.     if {$type_ban == 14} {
  1120.  
  1121.     return "$nick*!*@[lindex [split [maskhost $uhost] "@"] 1]"
  1122.  
  1123.     }
  1124.  
  1125.     if {$type_ban == 15} {
  1126.  
  1127.     return "*$nick*!*@[lindex [split [maskhost $uhost] "@"] 1]"
  1128.  
  1129.     }
  1130.  
  1131.     if {$type_ban == 16} {
  1132.  
  1133.     return "$nick*!*@[lindex [split $uhost "@"] 1]"
  1134.  
  1135.     }
  1136.  
  1137.     if {$type_ban == 17} {
  1138.  
  1139.     return "*$nick*!*@[lindex [split $uhost "@"] 1]"
  1140.  
  1141.     }
  1142.  
  1143.     if {$type_ban == 18} {
  1144.  
  1145.     return "$nick!*@[lindex [split $uhost "@"] 1]"
  1146.  
  1147.     }
  1148.  
  1149.     if {$type_ban == 19} {
  1150.  
  1151.     return "*!*@[lindex [split [maskhost $uhost] "@"] 1]"
  1152.  
  1153.     }
  1154.  
  1155.     if {$type_ban == 20} {
  1156.  
  1157.     return "*!*@[lindex [split $uhost "@"] 1]"
  1158.  
  1159.     }
  1160.  
  1161.     if {$type_ban == 21} {
  1162.  
  1163.     return "$nick!$uhost"
  1164.  
  1165.     }
  1166.  
  1167.     if {$type_ban == 22} {
  1168.  
  1169.         regsub {~} $uhost "" uhost
  1170.  
  1171.     return "$nick*!*$uhost"
  1172.  
  1173.     }
  1174.  
  1175.     if {$type_ban == 23} {
  1176.  
  1177.         regsub {~} $uhost "" uhost
  1178.  
  1179.     return "*$nick*!*$uhost"
  1180.  
  1181.     }
  1182.  
  1183.     if {$type_ban == 24} {
  1184.  
  1185.         regsub {~} $uhost "" uhost
  1186.  
  1187.     return "$nick!*$uhost"
  1188.  
  1189.     }
  1190.  
  1191.     if {$type_ban == 25} {
  1192.  
  1193.     return "$nick*!$uhost"
  1194.  
  1195.     }
  1196.  
  1197.     if {$type_ban == 26} {
  1198.  
  1199.     return "*$nick*!$uhost"
  1200.  
  1201.     }
  1202.  
  1203.     if {$type_ban == 27} {
  1204.  
  1205.     return "$nick!$uhost"
  1206.  
  1207.     }
  1208.  
  1209.     if {$type_ban == 28} {
  1210.  
  1211.         regsub {~} $uhost "" uhost
  1212.  
  1213.     return "$nick*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
  1214.  
  1215.     }
  1216.  
  1217.     if {$type_ban == 29} {
  1218.  
  1219.         regsub {~} $uhost "" uhost
  1220.  
  1221.     return "*$nick*!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
  1222.  
  1223.     }
  1224.  
  1225.     if {$type_ban == 30} {
  1226.  
  1227.         regsub {~} $uhost "" uhost
  1228.  
  1229.     return "$nick!*[lindex [split $uhost "@"] 0]*@[lindex [split $uhost "@"] 1]"
  1230.  
  1231.     }
  1232.  
  1233.     if {$type_ban == 31} {
  1234.  
  1235.         regsub {~} $uhost "" uhost
  1236.  
  1237.     return "$nick*!*[lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1238.  
  1239.     }
  1240.  
  1241.     if {$type_ban == 32} {
  1242.  
  1243.         regsub {~} $uhost "" uhost
  1244.  
  1245.     return "*$nick*!*[lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1246.  
  1247.     }
  1248.  
  1249.     if {$type_ban == 33} {
  1250.  
  1251.         regsub {~} $uhost "" uhost
  1252.  
  1253.     return "$nick!*[lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1254.  
  1255.     }
  1256.  
  1257.     if {$type_ban == 34} {
  1258.  
  1259.     return "$nick*![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1260.  
  1261.     }
  1262.  
  1263.     if {$type_ban == 35} {
  1264.  
  1265.     return "*$nick*![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1266.  
  1267.     }
  1268.  
  1269.     if {$type_ban == 36} {
  1270.  
  1271.     return "$nick![lindex [split $uhost "@"] 0]@[lindex [split [maskhost $uhost] "@"] 1]"
  1272.  
  1273.     }
  1274.  
  1275.     if {$type_ban == 37} {
  1276.  
  1277.         regsub {~} $uhost "" uhost
  1278.  
  1279.     return "$nick*!*[lindex [split $uhost "@"] 0]*@[lindex [split [maskhost $uhost] "@"] 1]"
  1280.  
  1281.     }
  1282.  
  1283.     if {$type_ban == 38} {
  1284.  
  1285.         regsub {~} $uhost "" uhost
  1286.  
  1287.     return "*$nick*!*[lindex [split $uhost "@"] 0]*@[lindex [split [maskhost $uhost] "@"] 1]"
  1288.  
  1289.     }
  1290.  
  1291.     if {$type_ban == 39} {
  1292.  
  1293.         regsub {~} $uhost "" uhost
  1294.  
  1295.     return "$nick!*[lindex [split $uhost "@"] 0]*@[lindex [split [maskhost $uhost] "@"] 1]"
  1296.  
  1297.     }
  1298.  
  1299.     if {$type_ban == 40} {
  1300.  
  1301.         regsub {~} $uhost "" uhost
  1302.  
  1303.     set all [sh_ban $uhost $nick]
  1304.  
  1305.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1306.  
  1307.     }
  1308.  
  1309.     if {$type_ban == 41} {
  1310.  
  1311.         regsub {~} $uhost "" uhost
  1312.  
  1313.     set all [sh_ban $uhost $nick]
  1314.  
  1315.     return "[lindex $all 0]![lindex $all 1]@[lindex [split $uhost "@"] 1]"
  1316.  
  1317.     }
  1318.  
  1319.     if {$type_ban == 42} {
  1320.  
  1321.         regsub {~} $uhost "" uhost
  1322.  
  1323.     set all [sh_ban $uhost $nick]
  1324.  
  1325.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split $uhost "@"] 1]"
  1326.  
  1327.     }
  1328.  
  1329.     if {$type_ban == 43} {
  1330.  
  1331.         regsub {~} $uhost "" uhost
  1332.  
  1333.     set all [sh_ban $uhost $nick]
  1334.  
  1335.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1336.  
  1337.     }
  1338.  
  1339.     if {$type_ban == 44} {
  1340.  
  1341.         regsub {~} $uhost "" uhost
  1342.  
  1343.     set all [sh_ban $uhost $nick]
  1344.  
  1345.     return "[lindex $all 0]![lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1346.  
  1347.     }
  1348.  
  1349.     if {$type_ban == 45} {
  1350.  
  1351.         regsub {~} $uhost "" uhost
  1352.  
  1353.     set all [sh_ban $uhost $nick]
  1354.  
  1355.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1356.  
  1357.     }
  1358.  
  1359.     if {$type_ban == 46} {
  1360.  
  1361.         regsub {~} $uhost "" uhost
  1362.  
  1363.     set all [sh_ban $uhost $nick]
  1364.  
  1365.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1366.  
  1367.     }
  1368.  
  1369.     if {$type_ban == 47} {
  1370.  
  1371.         regsub {~} $uhost "" uhost
  1372.  
  1373.     set all [sh_ban $uhost $nick]
  1374.  
  1375.     return "[lindex $all 0]![lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1376.  
  1377.     }
  1378.  
  1379.     if {$type_ban == 48} {
  1380.  
  1381.         regsub {~} $uhost "" uhost
  1382.  
  1383.     set all [sh_ban $uhost $nick]
  1384.  
  1385.     return "[lindex $all 0]!*[lindex $all 1]@[lindex [split [maskhost $uhost] "@"] 1]"
  1386.  
  1387.     }
  1388.  
  1389. }
  1390.  
  1391.  
  1392.  
  1393. # Heh, I'm lame to make the n?c? stuff with TCL!:=)) // Not anymore, the jobe
  1394.  
  1395. # is done by TCL, thanks to $myass.
  1396.  
  1397. proc sh_ban {uhost nick} {
  1398.  
  1399.     set send ""
  1400.  
  1401.     set aq 0
  1402.  
  1403.     set all1 ""
  1404.  
  1405.     foreach bau [split $nick ""] {
  1406.  
  1407.         if {$aq == 1} {
  1408.  
  1409.             append all1 "?"
  1410.  
  1411.             set aq 0
  1412.  
  1413.         } else {
  1414.  
  1415.             append all1 "$bau"
  1416.  
  1417.         set aq 1
  1418.  
  1419.         }
  1420.  
  1421.     }
  1422.  
  1423.     append send "$all1"
  1424.  
  1425.     set aq 0
  1426.  
  1427.     set all1 ""
  1428.  
  1429.     foreach baua [split [lindex [split $uhost @] 0] ""] {
  1430.  
  1431.         if {$aq == 1} {
  1432.  
  1433.             append all1 "?"
  1434.  
  1435.             set aq 0
  1436.  
  1437.         } else {
  1438.  
  1439.             append all1 "$baua"
  1440.  
  1441.         set aq 1
  1442.  
  1443.         }
  1444.  
  1445.     }
  1446.  
  1447.     append send " $all1"
  1448.  
  1449.     set aq 0
  1450.  
  1451.     set all1 ""
  1452.  
  1453.     foreach baub [split [lindex [split $uhost @] 1] ""] {
  1454.  
  1455.     if {$baub == "."} {
  1456.  
  1457.         append all1 $baub
  1458.  
  1459.     } else {
  1460.  
  1461.             if {$aq == 1} {
  1462.  
  1463.                 append all1 "?"
  1464.  
  1465.                 set aq 0
  1466.  
  1467.         } else {
  1468.  
  1469.                 append all1 "$baub"
  1470.  
  1471.             set aq 1
  1472.  
  1473.             }
  1474.  
  1475.     }
  1476.  
  1477.     }
  1478.  
  1479.     append send " $all1"
  1480.  
  1481.     return "$send"
  1482.  
  1483. }
  1484.  
  1485.  
  1486.  
  1487. # Kick banning the user.
  1488.  
  1489. proc kb {nick chan ban} {
  1490.  
  1491.     global reason
  1492.  
  1493.     if {[botisop $chan] == 1} {
  1494.  
  1495.         putkick $chan $nick $reason
  1496.  
  1497.         pushmode $chan +b $ban
  1498.  
  1499.     }
  1500.  
  1501. }
  1502.  
  1503.  
  1504.  
  1505. # Ban kicking the user.
  1506.  
  1507. proc bk {nick chan ban} {
  1508.  
  1509.     global reason
  1510.  
  1511.     if {[botisop $chan] == 1} {
  1512.  
  1513.     pushmode $chan +b $ban
  1514.  
  1515.         putkick $chan $nick $reason
  1516.  
  1517.     }
  1518.  
  1519. }
  1520.  
  1521.  
  1522.  
  1523. # Kicking the user.
  1524.  
  1525. proc k {nick chan ban} {
  1526.  
  1527.     global reason
  1528.  
  1529.     if {[botisop $chan] == 1} {
  1530.  
  1531.     putkick $chan $nick $reason
  1532.  
  1533.     }
  1534.  
  1535. }
  1536.  
  1537.  
  1538.  
  1539. proc strip:color {string} {
  1540.  
  1541.   regsub -all \003\[0-9\]{1,2}(,\[0-9\]{1,2})? $string {} string
  1542.  
  1543.   return $string
  1544.  
  1545. }
  1546.  
  1547.  
  1548.  
  1549. proc strip:bold {string} {
  1550.  
  1551.   regsub -all \002 $string {} string
  1552.  
  1553.   return $string
  1554.  
  1555. }
  1556.  
  1557.  
  1558.  
  1559. proc strip:underline {string} {
  1560.  
  1561.   regsub -all \037 $string {} string
  1562.  
  1563.   return $string
  1564.  
  1565. }
  1566.  
  1567.  
  1568.  
  1569. proc strip:all {string} {
  1570.  
  1571.   return [strip:color [strip:bold [strip:underline $string]]]
  1572.  
  1573. }
  1574.  
  1575.  
  1576.  
  1577. putlog "invite.tcl By xAkc LoadeD"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement