egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Why doesnt it works !!

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Rusher2K
Halfop


Joined: 18 Apr 2003
Posts: 88
Location: Germany

PostPosted: Sun May 11, 2003 8:22 am    Post subject: Why doesnt it works !! Reply with quote

I hade edit Qban tcl to make a Qop tcl
I cann add peoble in list but teh bot didnt op !!!!
the people whrere in teh list when i make .qban list büt white {{nick}}

Code:

set qchan "#emotion-public"

# path to data file
set qfile "./qban.data"



### binds ###
bind join - "$qchan *!*@*" q:join
bind dcc o qop dcc:qban

### CODE - DON'T change yadda yadda ###
set qver "1.0"

proc dcc:qban {hand idx args} {
    set args [lindex $args 0]
    set mode [lindex $args 0]
    if {$mode == "add"} {
   q:ban:add $idx [lindex $args 1]
    }
    if {$mode == "del"} {
   q:ban:del $idx [lindex $args 1]
    }
    if {$mode == "list"} {
   q:ban:list $idx
    }
    if {$mode == "help"} {
   q:help $idx
    }
    if {$mode == ""} {
   q:help $idx
    }
}

proc q:ban:list {qidx} {
    global qfile
    set qlist ""

    set openchange [open $qfile r]
    while {![eof $openchange]} {
   set dlinhalt [gets $openchange]
        if {$dlinhalt != ""} {
       set dlinhalt "$dlinhalt "
       set dlinhalt [lrange $dlinhalt 0 end]
       set qlist [lappend qlist $dlinhalt]
   }
    }
    close $openchange
    putidx $qidx "\002QOP::\002 Added qops: \002$qlist\002"
}

proc q:ban:del {qidx args} {
    global qfile
    set args [lindex $args 0]
    set qwho [lindex $args 0]

    set openchange [open $qfile r]
    set zahler "0"
    set notzahler "0"

    while {![eof $openchange]} {
   set dlinhalt [gets $openchange]
        if {$dlinhalt != ""} {
       incr zahler +1
           set putfile($zahler) "$dlinhalt"
       set test [lindex $dlinhalt 0]
       if {$test == $qwho} {
      set notzahler "$zahler"
       }
   }
    }

    close $openchange
    if {$notzahler != "0"} {
   if ![catch {open $qfile w} filelog] {
       for {set i 1} {$i <= $zahler} {incr i 1} {
      if {$i != $notzahler} {
          puts $filelog "$putfile($i)"
      }
       }
   close $filelog
   putidx $qidx "\002QOP::\002 Succesfully removed \002$qwho\002 from the qop list"
   } else {
       putlog "\002QOP::\002 ERROR! File not found !!!"
   }
    }
}

proc q:help {qidx} {
    putidx $qidx "\002QOP::\002 .qop add <authname> <-- adds a new auth to ban list"
    putidx $qidx "\002QOP::\002 .qop del <authname> <-- removes given auth from the ban list"
    putidx $qidx "\002QOP::\002 .qop list <-- shows a list of auths that are banned"
    putidx $qidx "\002QOP::\002 .qop \[help\] <-- shows this"
}

proc q:ban:add {qidx args} {
    set args [lindex $args 0]
    global qfile
    if ![catch {open $qfile a+} filelog] {
   puts $filelog "$args"
   close $filelog
   putidx $qidx "\002QOP::\002 Added \002$args\002 to qop list"
    }
}

proc q:join {nick uhost hand chan} {
    global qnick qchann
    set qnick "$nick"
    set qchann "$chan"
    qbind
    putserv "whois $nick"
}

proc raw:q330 {from key arg} {
    global qfile qchan qnick qchann qstick qtime qkick
    set amessage [string trimleft [join [lrange [split $arg] 2 end]] :]
    set amessage [lindex $amessage 3]
    set qfiles [open $qfile r]
    while {![eof $qfiles]} {
   set dlinhalt [gets $qfiles]
   set q_auth [lindex $dlinhalt 0]
   if {$q_auth == $amessage} {
       putlog "\002QOP\002 :: $qnick matched a Q auth qop: $q_auth"
       putserv "MODE $qchann +o $qnick "
   }
    }
    close $qfiles
    qunbind
}

proc qbind { } {
    bind raw - 330 raw:q330
}

proc qunbind { } {
    unbind raw - 330 raw:q330
}
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber