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.

Problem with reading out Numbers of users.

Old posts that have not been replied to for several years.
Locked
D
DeLiRiUm

Problem with reading out Numbers of users.

Post by DeLiRiUm »

Code: Select all

bind pub - !Q Q:target

proc Q:target {nick uhost hand chan arg} {
set qchan "[lindex [lindex $arg 0] 0]"
set quser "[lrange [split $arg] 1 end]"
 if { ([llength [chanlist $qchan]]<5) && ([isop $quser $qchan]=0) } then {
        putserv "PRIVMSG #request :$qchan hat weniger als 5 User oder $quser hast kein Op. Request abgelehnt! "
        return 0
        }
putserv "PRIVMSG Q :addchan $qchan nt #$quser clan"
putserv "PRIVMSG #request :Adde $qchan mit Owner $quser zur Datenbank"
}
That's what the script should do: Adding the Q Bot to a Channel if a User on #request types '!Q #chan Nick', but only if at least 5 Users are on the Channel and the User has Op on it.

That's what the script actually does: It adds Q, neither depending on wether the Channel has more than 5 Users nor the User is op.

Any suggestions?
Thx in advance..
DeLiRiUm
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Problem with reading out Nubers of users.

Post by CrazyCat »

DeLiRiUm wrote:

Code: Select all

if { ([llength [chanlist $qchan]]<5) && ([isop $quser $qchan]=0) }
Are you sure of what you want?
I'll better use:

Code: Select all

if {([llength [chanlist $qchan]]>=5) && [isop $quser $chan]} {
Locked