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 

Problem where isop always returns true

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
diskman1
Voice


Joined: 12 Jul 2010
Posts: 2

PostPosted: Mon Jul 12, 2010 5:57 pm    Post subject: Problem where isop always returns true Reply with quote

Hi,
I have a small problem with the fallowing invite Script:

Code:

bind raw - INVITE join:invite

proc join:invite {nickname key arg} {
       set channame [lindex [split $arg :] 1]
       if {[validchan $channame] || $channame == "#somechan" || $channame == "#other-chan"} {
          putlog "\[\002Join Request\002\] fehlgeschlagen! Channel \002$channame\002 bereits vorhanden. Anforderung von \002$nickname\002."
          } else {
                 channel add $channame
                 set klnick [split $nickname "!"] ;# hostmask beim ! splitten
                 set nick [lindex $klnick 0]      ;# davon das erste element -> nur der nick
                 utimer 20 [list checkchannel $nick $channame]  ;# 20 sekunden warten bis der bot den channel komplett 'eingelesen' hat
                                                                ;# wird nicht lange genug gewartet gibt in  checkchannel die isop funktion false zurück weil noch keine daten vorhanden
          }
}


proc checkchannel {nickname channame} {
           if {![isop $nickname $channame]} {
           putserv "PRIVMSG $channame :Anforderung fehlgeschlagen. \002$nickname\002 ist kein Operator."
           putserv "NOTICE $nickname :Anforderung fehlgeschlagen. Du bist kein Operator in \002$channame\002."
           channel remove $channame
           putlog "\[\002Join Request\002\] fehlgeschlagen! \002$nickname\002 ist kein Operator in \002$channame\002."
            } else {
                   putserv "PRIVMSG $channame :Anforderung erfolgreich."
                   putlog "\[\002Join Request\002\] erfolgreich von \002$nickname\002 für \002$channame\002."
           }
}


so heres the scenario:
someone invites the bot into his channel (in my network also non-ops can invite somebody)
the bot adds the channel, and joins
after 20 seconds the function checkchannel is called.
checkchannel checks wether the user who invited the bot is channel operator or not.

Heres the Problem.
The bot always stays inside the channel and prints out "Anforderung erfolgreich"

There is also a !part function, which also checks the op status via isop.
This Function can also be called from everyone on the channel. The bot dont cares about the op status.
After the join everyone is recorgnized as operator unless he parts and rejoins the channel.

I tried to let the bot part and check afterwards but nothings changed.
I also tried the resetchan function to re-read the channel ops, but this also changed nothing.

I cant explain why everyone is recorgnized as channel operator... if i manually let the bot part the channel by .dump part #channel the problem seems to go away.
but thats not a solution Smile

Hope anyone can help me... i tried to search the forum for related topics... there is a similar script but it doesnt check for chanops.

Greetings,

diskman
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Thu Jul 15, 2010 10:09 pm    Post subject: Reply with quote

I see that no one has replied yet. Perhaps that is due to all the German... I really don't know. ( I don't speak German either)

I'm not really sure what is wrong, or why the result is always the same.

Just for fun, (and to be sure) I copied a piece of your code, and made only two small changes. You can spot them easily:

Code:

bind pub - "!checkme" checkchannel

proc checkchannel {nickname uhost handle channame text} {
           if {![isop $nickname $channame]} {
           putserv "PRIVMSG $channame :Anforderung fehlgeschlagen. \002$nickname\002 ist kein Operator."
           putserv "NOTICE $nickname :Anforderung fehlgeschlagen. Du bist kein Operator in \002$channame\002."
        #   channel remove $channame
           putlog "\[\002Join Request\002\] fehlgeschlagen! \002$nickname\002 ist kein Operator in \002$channame\002."
            } else {
                   putserv "PRIVMSG $channame :Anforderung erfolgreich."
                   putlog "\[\002Join Request\002\] erfolgreich von \002$nickname\002 für \002$channame\002."
           }
}


I ran the above simple code, and it seemed to work fine. That is, I got
different results, if I was op'd or not op'd, when I sent the public command.
In other words - it works. Try it on yours, just to see if it works on yours.

I wonder if it is possible that it might behave differently on different servers?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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