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.

opcheck proc is wrong

Old posts that have not been replied to for several years.
Locked
e
eiSi
Halfop
Posts: 70
Joined: Thu Mar 07, 2002 8:00 pm

opcheck proc is wrong

Post by eiSi »

hi there!

I am coding an opcheck function, which basically worked fine for me:

Code: Select all

### opcheck proc
proc call_opcheck {nick hand chan misc1 misc2} {
        global priv botnick home lbn hub
        set line ""
        set intiv ""
        msg $home "\002Op Check\002 Command Issued, if nothing returned, all ok! "
        foreach channel [channels] {
                set lchannel [string tolower $channel]
                if { [botisop $channel ] == 0 } {
                        msg $home "$channel"
                        msg $channel "\002Warning:\002 I am not opped, please op me, otherwise I'll part."
                        set misc2 "timer 3 call_opcheck2"
                        call_opcheck2 $nick $handle $chan $misc1 $misc2
                }
        }
}

### opcheck2 proc
proc call_opcheck2 {nick hand chan misc1 misc2} {
        killtimer $misc2
        if { [botisop $chan ] == 0 } {
                msg $chan "You still haven't opped me, I'll part now..."
                msg $home "Parting $chan (Opcheck failed)"
                channel remove $chan
        }
}
what isn't working, is the thing with the timer.
I want the bot to start a timer (3 minutes for example) then check again if it is opped. If not, it should part.

what is wrong with my proc? Oh and I am not that good at tcl coding,... yet ;)

thanks for any help!
Locked