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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
-
Coixi
- Voice
- Posts: 6
- Joined: Sun Nov 12, 2006 4:34 am
Post
by Coixi »
Hi,
I'd like if someone could tell me how to check if +c is on in Quakenet channel.
I've tried getchanmode <channel> and channel get <name> <setting> so far - without any luck.
What i've understood after reading this forum quite a bit is that Quakenet doesn't follow RFC and won't report /WHO nor channel modes in right format.
I tried to seach for hardcoded and bind raw but you really couldn't understood them.
I need a script which checks if +c is on in $channel. If not, do thing A, if it is on do thing B.
-
r0t3n
- Owner
- Posts: 507
- Joined: Tue May 31, 2005 6:56 pm
- Location: UK
Post
by r0t3n »
You got half of it right with the getchanmode, but you need to use string match to find it within the returned string of modes.
Code: Select all
if {[string match *c* [getchanmode $chan]]} {
# mode +c is set
} else {
#mode +c is not set
}
r0t3n @ #r0t3n @ Quakenet
-
Coixi
- Voice
- Posts: 6
- Joined: Sun Nov 12, 2006 4:34 am
Post
by Coixi »
"WTF" is what i wanna say now.
I can't even count how many different 'variations' of getchanmode + string match check i tried and none of them worked. This one does
Thanks!
-
metroid
- Owner
- Posts: 771
- Joined: Wed Jun 16, 2004 2:46 am
Post
by metroid »
Always use
Code: Select all
if {[string match *c* [lindex [getchanmode $chan] 0]]} {
# mode +c is set
} else {
#mode +c is not set
}
Or it will report that +c is set when the key contains the letter c.