Results 1 to 3 of 3

Thread: badnick script

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    41
    Rep Power
    0

    Default badnick script

    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 ?

  2. #2
    Administrator

    aka aqwzsx

    Join Date
    Jun 2004
    Posts
    853
    Blog Entries
    130
    Rep Power
    3

    Default

    1. Adauga cateva nick`uri in blacklist cu comanda !badnick -add.
    2. Verifica ca in fisier, unde bot`ul pastreaza aceasta informatie, sa fie aceste nick`uri (in database/badnick/$chan.db).
    3. In aux foloseste scriptul corectat, care il gasesti pe mai jos.
    4. Cineva sa intre pe canal cu nick bad, care ai setat tu.
    5. Si nu mai folosi asa tutoriale sau script`uri :)
    Code:
     
    bind join - * check:badnick
    proc check:badnick {nick uhost hand chan} {
     global username
     
     set db "database/badnick/${chan}.db"
     if {![channel get $chan badnick] || ![botisop $chan] || [matchattr $hand +vlf|+vlf $chan] || ![file exists $db]} { return 0 }
     set fd [open $db r]
     set wordlist [split [read $fd]]
     close $fd
     foreach badnick $wordlist {
      if {[string match -nocase *${badnick}* $nick]}   {
          newchanban $chan *${badnick}*!*@* $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]
          break
        }
          }
    }

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    41
    Rep Power
    0

    Default

    yep merge , multumesc mult universalia :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •