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.

Get modes of channel [SOLVED]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

Get modes of channel [SOLVED]

Post by T-Xorcist »

Hi there!

I have a bit of a problem, with the modes on a channel.
I have an IRCbot running on a UnrealIRCD network.

How do I get the modes of the channel? Like, mtnr.

The purpose? I want to check if the channel is registered, else, leave the channel again.

Can anyone explain to me how this is possible?

Thanks in advance.

With kind regards,

T-Xorcist
Last edited by T-Xorcist on Sun Aug 26, 2007 9:27 am, edited 1 time in total.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Code: Select all

[getchanmode #channel]
So if you want to check for the 'r' flag, you can use:

Code: Select all

if {[string match *r* [lindex [getchanmode $var] 0]]} { # r is set } else { # r is not set }

if {[regexp {r} [lindex [getchanmode $var] 0]]} { #r is set } else { #r is not set }
Hope this helps!
r0t3n @ #r0t3n @ Quakenet
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

Post by T-Xorcist »

I'm going to try! Thank you!

Edit: It works perfectly! Really much appreciated!
Post Reply