| View previous topic :: View next topic |
| Author |
Message |
Coixi Voice
Joined: 12 Nov 2006 Posts: 6
|
Posted: Mon Nov 27, 2006 3:33 am Post subject: Script for checking Quakenet channel modes |
|
|
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. |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Nov 27, 2006 4:10 am Post subject: |
|
|
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: | if {[string match *c* [getchanmode $chan]]} {
# mode +c is set
} else {
#mode +c is not set
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Coixi Voice
Joined: 12 Nov 2006 Posts: 6
|
Posted: Mon Nov 27, 2006 5:25 am Post subject: |
|
|
"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! |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon Nov 27, 2006 5:27 pm Post subject: |
|
|
Always use
| Code: | 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. |
|
| Back to top |
|
 |
|