Am si eu un tutorial de badnick care apartine probabil lui Real|Dog daca nu ma insel ... in fine nu asta conteaza
Ceea ce conteaza este ca nu da ban cand persoana cu acel nickname intra pe canal ,desi badnick este setat pe canal .
Aici am codul din a&a_22_a_local_n.tcl
Code:
a:command -add badnick pub:badnick 0000 000 |n
proc pub:badnick {hand chan args x mix} {
global settings
set bad(file) "database/badnick/$chan.db" ;# Here, you can set the folder where the files are going to be saved
set opt [lindex $args 0] ;# Option
set word [lindex $args 1] ;# BadNick word
switch -- $opt {
-add {
if {![matchattr $hand -|n $chan]} {puthelp "privmsg $chan :If you want to use this command ( \002!badnick -add\002 ) then you must be a $chan owner. (+n flag)"; return}
if {![file exists $bad(file)]} {
set fh [open $bad(file) w]
puts -nonewline $fh ""
close $fh
}
set fdz [open $bad(file) r]
set conte [read $fdz]
close $fdz
if {[string match -nocase "*$word*" $conte]} {puthelp "privmsg $chan :This word (\002$word\002) already exists in the $chan bad nick database."; return }
set fd [open $bad(file) a+]
puts $fd "$word"
close $fd
puthelp "PRIVMSG $chan :Added bad nick \002$word\002 to the $chan database."
}
-del {
if {![matchattr $hand -|n $chan]} {puthelp "privmsg $chan :If you want to use this command ( \002!badnick -del\002 ) then you must be a $chan owner. (+n flag)"; return}
set fd [open $bad(file) r]
set reads [read $fd]
close $fd
set data ""
if {![string match -nocase "*$word*" $reads]} {puthelp "privmsg $chan :This word (\002$word\002) doesn't exist in the $chan bad nick database."; return }
if {[llength $reads]} {
set fd [open $bad(file) w]
foreach line [split $reads \n] {
if {![string match -nocase *$word* $line]} {
if {[llength $line]} {puts $fd "$line\n"}
}
}
close $fd
puthelp "PRIVMSG $chan :I removed the bad nick word \002$word\002 from the $chan database."
}
}
-check {
if {![matchattr $hand -|- $chan]} {puthelp "privmsg $chan :If you want to use this command ( \002!badnick -check\002 ) then you must be a $chan owner. (+n flag)"; return}
set fd [open $bad(file) r]
set cont [read $fd]
close $fd
if {![string match -nocase "*$word*" $cont]} {puthelp "privmsg $chan :This word (\002$word\002) doesn't exist in the $chan bad nick database."; return }
foreach abuse [split $cont \n] {if {[string match -nocase "*$word*" $abuse]} {
set a1 [lindex $abuse 0]
puthelp "PRIVMSG $chan :The word \002$a1\002 exists in the $chan bad nick database."}
}
}
-list {
if {![matchattr $hand -|N $chan]} {puthelp "privmsg $chan :If you want to use this command ( \002!badnick -list\002 ) then you must be a $chan manager (+N flag)"; return}
set fd [open $bad(file) r]
set cont [read $fd]
close $fd
set listabuse ""
foreach abuse [split $cont \n] {lappend listabuse "\002[lindex $abuse 0]\002"}
puthelp "PRIVMSG $chan :I retrieved the following list from the $chan bad nick database: [join $listabuse]"
}
default {puthelp "privmsg $chan :Usage: !badnick <-add|-del|-check|-list> word"}
}
}
IAr in aux am asa ceva...
Code:
bind join - * check:badnick
proc check:badnick {nick uhost hand chan} {
global settings username
set bad(file) "database/badnick/$chan.db"
if {![channel get $chan badnick] || ![botisop $chan] || [matchattr $hand +v]} { return 0 }
set fd [open $bad(file) r]
set wordlist [read $fd]
close $fd
foreach badnick [string tolower $wordlist] {
set bbanmask "*$badnick*!*@*"
if {[botisop $chan] && ![matchattr $hand -|+v $chan] && [channel get $chan badnick] && [string match *$badnick* [string tolower $nick]]} {
newchanban $chan $bbanmask $username "Before you can join this channel please change your nick because it contains the '\00304$badnick\003' word. Thanks." [channel get $chan ban-time]
}
}
}
Pls spuneti si mie ce tre sa fac ?
Bookmarks