Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 10th, 2010 | Syntax: None | Size: 6.86 KB | Hits: 56 | Expires: Never
Copy text to clipboard
  1. set wordlist "wordlist"
  2. set canal "#ubuntu"
  3. set indice "!"
  4.  
  5. bind msgm -|- * privados
  6. bind pub  m|- ${indice}addword addword
  7. bind pub  m|- ${indice}addnicks addnicks
  8. bind pub  m|- ${indice}delword delword
  9. bind pub  m|- ${indice}delban delban
  10. bind join - * entrada
  11. bind time - "* * * * *" mensaje
  12. bind time - "59 23 * * *" rmban
  13.  
  14. proc rmban {min hor day mes año} { if {[file exists bans]} { file delete bans } }
  15.  
  16. proc mensaje {min hor day mes año} {
  17.     global canal
  18.     global botnick
  19.     global owner
  20.     if {[botisop $canal] == 1} {putserv "MODE $canal -o $botnick"}
  21.     set nicks [chanlist $canal]
  22.     set nnicks [llength $nicks]
  23.     set find 0
  24.     set nuevos ""
  25.     if {[file exists avisados]} {
  26.         for {set p 0} {$p < $nnicks} {incr p} {
  27.             set mask [lindex [split [getchanhost [lindex $nicks $p] $canal] @] end]
  28.             set nick [lindex $nicks $p]
  29.            
  30.             set f [open avisados r]
  31.             while {[gets $f lineae] != -1} {
  32.                 if {[string match -nocase "*$nick*" "$lineae"] == 1} {
  33.                     unset find
  34.                     set find 1
  35.                     break
  36.                 }
  37.             }
  38.             close $f
  39.            
  40.             if {$find == 0} {
  41.                 if {[string match -nocase "*NeO-GeO*" $nick] == 0} {
  42.                     lappend nuevos $nick
  43.                     if {[isop $nick $canal] == 0 && [matchattr "*$nick*" +h] == 0 && [isvoice $nick $canal] == 0} {                
  44.                         if {[string match -nocase "*$nick*" $botnick] == 0 && [string match -nocase "*$nick*" $owner] == 0 } {
  45.                             putserv "PRIVMSG $nick :- Prueba AntiSpam - (No responder)" -next
  46.                         }
  47.                     }
  48.                 }
  49.             }
  50.             unset find
  51.             unset mask
  52.             unset lineae
  53.             unset nick
  54.             set find 0
  55.         }
  56.  
  57.         if {[llength $nuevos] > 0} {
  58.             set fu [open avisados a]
  59.             for {set z 0} {$z < [llength $nuevos]} {incr z} {
  60.                 puts $fu [lindex $nuevos $z]
  61.             }
  62.             close $fu
  63.         }
  64.     } else {
  65.         set fa [open avisados a]
  66.         for {set i 0} {$i < $nnicks} {incr i} {
  67.             set mask [lindex [split [getchanhost [lindex $nicks $i] $canal] @] end]
  68.             set nick [lindex $nicks $i]
  69.             if {[isop $nick $canal] == 0 && [matchattr $nick +h] == 0 && [isvoice $nick $canal] == 0} {            
  70.                 putserv "PRIVMSG $nick :hi" -next
  71.             }
  72.             puts $fa $nick
  73.         }
  74.         close $fa    
  75.     }
  76. }
  77.  
  78. proc entrada {nick host hand chan} {
  79.     global canal
  80.     global botnick
  81.     set ipv [lindex [split $host @] end]    
  82.     if {[file exists bans]} {
  83.         set fb [open bans r]
  84.         while {[gets $fb lineaa] != -1} {
  85.             if {[string match -nocase "*$ipv*" $lineaa] == 1} {
  86.                 if {[botonchan $canal] == 1} {
  87.                     if {[onchan $nick $canal] == 1} {
  88.                         if {[isop $nick $canal] == 0 && [matchattr $nick +h] == 0 && [isvoice $nick $canal] == 0} {            
  89.                             putserv "MODE $canal +b *!*@$ipv"
  90.                             putserv "KICK $canal $nick Bot Spam"
  91.                         }
  92.                     }
  93.                 }                
  94.             }
  95.         }
  96.         close $fb        
  97.     }    
  98. }
  99.  
  100. proc addnicks {nick host hand chan text} {
  101.     global canal
  102.     set name [lrange $text 0 end]
  103.     set nicks [chanlist $canal]
  104.     set nnicks [llength $nicks]
  105.     set fc [open avisados a]
  106.    
  107.     if {$name == ""} {
  108.         for {set i 0} {$i < $nnicks} {incr i} {
  109.             puts $fc [lindex $nicks $i]
  110.         }
  111.     } else {
  112.         for {set i 0} {$i < [llength $name]} {incr i} {        
  113.             puts $fc [lindex $name $i]
  114.         }
  115.     }
  116.     close $fc
  117. }
  118.  
  119. proc delban {nick host hand chan text} {
  120.     global owner
  121.     global wordlist
  122.     global canal
  123.     set word [lrange $text 0 end]    
  124.     set fd [open bans r]
  125.     set ff [open backup a]        
  126.     while {[gets $fd lineac] != -1} {    
  127.         if {[string match -nocase $word $lineac] == 0} {        
  128.             puts $ff $lineac
  129.         } else { putquick "MODE $canal -b *!*@$lineac" }
  130.     }
  131.     close $fd
  132.     close $ff
  133.     file delete bans
  134.     file rename backup bans
  135.     putquick "NOTICE $owner :\"$word\" borrado"    
  136. }
  137.  
  138. proc addword {nick host hand chan text} {
  139.     global owner
  140.     global wordlist
  141.     set word [lrange $text 0 end]
  142.     set fe [open $wordlist a]                
  143.     puts $fe $word
  144.     close $fe
  145.     putquick "NOTICE $owner :\"$word\" añadido al archivo $wordlist"
  146. }
  147.  
  148. proc delword {nick host hand chan text} {
  149.     global owner
  150.     global wordlist
  151.     set word [lrange $text 0 end]    
  152.     set fg [open $wordlist r]
  153.     set fff [open backup a]        
  154.     while {[gets $fg linead] != -1} {    
  155.         if {[string match -nocase $word $linead] == 0} {        
  156.             puts $fff $linead
  157.         }
  158.     }
  159.     close $fg
  160.     close $fff
  161.     file delete $wordlist
  162.     file rename backup $wordlist
  163.     putquick "NOTICE $owner :\"$word\" borrada del archivo $wordlist"    
  164. }
  165.  
  166. proc privados {nick host hand text} {
  167.     global wordlist
  168.     global canal
  169.     global botnick
  170.     set ipv [lindex [split $host @] end]
  171.     putserv "privmsg $nick :¿ Que hay ?, soy un bot"
  172.     if {[isop $nick $canal] == 0 && [matchattr $hand +h] == 0 && [isvoice $nick $canal] == 0} {                
  173.         if {[file exists $wordlist]} {
  174.             set fh [open $wordlist r]
  175.             set fff [open bans a]        
  176.             while {[gets $fh lineaf] != -1} {
  177.                 if {[string match -nocase $lineaf $text] == 1} {
  178.                     if {[botonchan $canal] == 1} {
  179.                         if {[onchan $nick $canal] == 1} {
  180.                             putserv "PRIVMSG CHaN :op $canal $botnick"
  181.                             putserv "MODE $canal +b *!*@$ipv"
  182.                             putserv "KICK $canal $nick Bot Spam"
  183.                            
  184.                         }
  185.                     }
  186.                     puts $fff $ipv
  187.                     close $fff
  188.                     close $fh                                        
  189.                     set fk [open avisados r]
  190.                     set ffff [open backup a]        
  191.                     while {[gets $fk lineag] != -1} {    
  192.                         if {[string match -nocase "*$nick*" $lineag] == 0} {        
  193.                             puts $ffff $lineag
  194.                         }
  195.                     }
  196.                     close $fk
  197.                     close $ffff
  198.                     file delete avisados
  199.                     file rename backup avisados                    
  200.                     break
  201.                 }
  202.             }
  203.         }
  204.     }
  205. }    
  206.  
  207. putlog "\00304Cargado AntiBots en $canal\00300"
  208.  
  209. return