This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Why doesnt it works !!

Old posts that have not been replied to for several years.
Locked
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Why doesnt it works !!

Post by Rusher2K »

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: Select all

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
}
Locked