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 

Script for checking Quakenet channel modes

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Coixi
Voice


Joined: 12 Nov 2006
Posts: 6

PostPosted: Mon Nov 27, 2006 3:33 am    Post subject: Script for checking Quakenet channel modes Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Nov 27, 2006 4:10 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Coixi
Voice


Joined: 12 Nov 2006
Posts: 6

PostPosted: Mon Nov 27, 2006 5:25 am    Post subject: Reply with quote

"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 Smile

Thanks!
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon Nov 27, 2006 5:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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