Channel List Info with Mode Definitions

By Jethro on Jul 27, 2010

This is a forum request asked by the user Cheiron. He encourages me that I post this as a public snippet submission so it can reach to other users who find it useful.

Syntax:

!display #ChannelHere

You can add more modes that aren't covered in the script, along with any edit of the defintions that you think suits your liking. Feedback and suggestions are welcome so this script can furthter be refined and improved.

Finally, I would like to give credit to RusselB who contributed his assistance with the while loop part of this script.

-EDIT- Took FordLawnMower's suggestion of adding a trap. I've added gooshie's version of this script so people can choose which one they wish to use.

on *:start:{ makemodes }
on *:connect:{ makemodes }
alias view {
  $iif($group(#md) == off,.enable #md)
  set -u3 %cchan #
  list $$1
}
#md off
raw 321:*:{ haltdef }
raw 322:*:{
  haltdef
  msg %cchan $gettok($2-,1-3,32)
  set -u3 %listmode $remove($gettok($gettok($2-,1-3,32),3-,32),+,[,])
  listmode
}
raw 323:*:{
  haltdef 
  .disable #md
  window -c "Channels List"
}
#md end
on $*:text:/!display (\43\S+)/iS:#:{
  if (!%f) {
    inc -u3 %f
    $view($regml(1))
  }
}
alias -l makemodes {
  if (!$hget(modes)) hmake modes 10
  hadd modes A Admins only Channel:
  hadd modes C No CTCPs allowed in the Channel:
  hadd modes G Censor Bad Language:
  hadd modes M Must be using a registered nick(+r), or have voice access to talk:
  hadd modes K /KNOCK is not allowed:
  hadd modes N No Nickname changes are permitted in the Channel:
  hadd modes O IRC Operator only Channel (settable by IRCops):
  hadd modes Q No Kicks Allowed:
  hadd modes R Only registered(+r) users may join the Channel:
  hadd modes S Strips mIRC color codes:
  hadd modes T No NOTICEs allowed in the Channel:
  hadd modes V /INVITE is not allowed:
  hadd modes f Channel has flood modes applied:
  hadd modes i A user must be invited to join the Channel:
  hadd modes k <key> = Users must specify <key> to join:
  hadd modes l <number of max users> = Channel may hold at most <number> of users:
  hadd modes p Private Channel:
  hadd modes u Auditorium mode (/names and /who only show Channel OPS):
  hadd modes z Only Clients on a Secure Connection (SSL) can join: $!xm(z)
}
alias -l listmode {
  var %a = 1, %b = $len(%listmode)
  while %a <= %b {
    var %mode = $mid(%listmode,%a,1)
    if %mode === s { .msg %cchan $v1 - Secret Channel: }
    elseif %mode === t { .msg %cchan $v1 - Only Ops set topic: }
    elseif %mode === c { .msg %cchan $v1 - Block messages containing mIRC color codes: }
    elseif %mode === m { .msg %cchan $v1 - Moderated Channel(only +vhoaq users may speak): }
    elseif %mode === r { .msg %cchan $v1 - The Channel is registered (settable by Services only): }
    elseif %mode === n { .msg %cchan $v1 - Users outside the Channel can not send PRIVMSGs to the Channel: }
    elseif $hget(modes,%mode) { .msg %cchan %mode - $v1 }
    else { .msg %cchan the mode $+(",%mode,") does not exist! }
    inc %a
  }
}

********************* goooshie's version *********************

on $*:text:/!display (\43\S+)/iS:#:{
  if !%f {
    inc -u3 %f
    set -u3 %cchan #
    list $regml(1)
  }
}
raw 321:*:if %cchan { haltdef }
raw 323:*:if %cchan { haltdef | window -c "Channels List" }
raw 322:*:{
  if %cchan {
    var %m $remove($gettok($gettok($2-,1-3,32),3-,32),+,[,])
    msg %cchan $gettok($2-,1-3,32)
    var %a 0,%b $len(%m)
    while %a < %b {
      inc %a
      .msg %cchan $iif($listmode($mid(%m,%a,1)),$v1,$mid(%m,%a,1) * No mode definition)
    }
  }
}
alias listmode {
  goto $asc($1)
  :65 | return A - Admins only Channel
  :67 | return C - No CTCPs allowed in the Channel
  :71 | return G - Censor Bad Language
  :75 | return K - /KNOCK is not allowed
  :77 | return M - Must be using a registered nick(+r), or have voice access to talk
  :78 | return N - No Nickname changes are permitted in the Channel
  :79 | return O - IRC Operator only Channel (settable by IRCops)
  :81 | return Q - No Kicks Allowed
  :82 | return R - Only registered(+r) users may join the Channel
  :83 | return S - Strips mIRC color codes
  :84 | return T - No NOTICEs allowed in the Channel
  :86 | return V - /INVITE is not allowed
  :99 | return c - Block messages containing mIRC color codes
  :102 | return f - Channel has flood modes applied
  :105 | return i - A user must be invited to join the Channel
  :107 | return k - <key> = Users must specify <key> to join
  :108 | return l - <number of max users> = Channel may hold at most <number> of users
  :109 | return m - Moderated Channel(only +vhoaq users may speak)
  :110 | return n - Users outside the Channel can not send PRIVMSGs to the Channel
  :112 | return p - Private Channel
  :114 | return r - The Channel is registered (settable by Services only)
  :116 | return t - Only Ops set topic
  :117 | return u - Auditorium mode (/names and /who only show Channel OPS)
  :122 | return z - Only Clients on a Secure Connection (SSL) can join
  :error | reseterror
}

Comments

Sign in to comment.
[85]   -  Nov 15, 2011

thanks for sharing this snippet, i like idea... woud be nice if also show channel modes on join channels

on *:join:#: 

[b]ex:
[14:55'pm] [»] Joined #entrance channel on: (15th - November - Tuesday - year 2011)

[14:55'pm] [#] Channel users: (Total users: 773 - Operators: 16 - Voices: 3 - Regular: 754)
[14:55'pm] [#] #entrance: recognized as channel owner (+qo)[/b]

 Respond  
Jethro   -  Jul 31, 2010

Thanks Ford, I added the #group to be enabled or disabled. I also added gooshie's version of this script so people can make a choice of which it's working best for him or her.

 Respond  
FordLawnmower   -  Jul 31, 2010

Hmm. I was just looking at this script and I noticed there is no trap on the raw you used Jethro_.
I don't think it's a good idea to halt raw events, especially if you didn't bind them to your event with a trap line.(A #group or a variable) This script is pretty fried. I just loaded it and typed /list

Listing channels

-> #Test 5 [+ntr]

-> #AutoIT 1 [+nt]

-> #Atomreactor 5 [+ntr]

End of /List

Test No external channel messages (#Test)

-
n No such nick/channel

t No such nick/channel

r No such nick/channel

AutoIT No external channel messages (#AutoIT)

-
n No such nick/channel

t No such nick/channel

n No such nick/channel

t No such nick/channel

n No such nick/channel
etc, etc, etc...............

The raw needs to be trapped with a #group ON/Off or a variable set/unset.

 Respond  
K33D4Y   -  Jul 31, 2010

Haha Thanks For the Script Jethro_ :)
Btw,Have you ever been on peers? O.o

 Respond  
FordLawnmower   -  Jul 31, 2010

Good info jaytea :) I'll look into v7.x now. I've been waiting for this since I started using mIRC.

Edit
I should of paid more attention to this version update. It would have saved me a lot of work ;/
I can probably just trash the new UPnP script that I was getting ready to post.
"In addition to being converted to Unicode, there are a few other notable changes:"
"UPnP support"

 Respond  
jaytea   -  Jul 31, 2010

a stable version (7.1) was just released today :P

$chr() and $asc() still reflect the range of characters mIRC uses internally except instead of the 256 code point range of old (or 255 if you discard CHR 0) they now support a 65536 character range. Unicode outside of this range are formed using pairs of these characters, so $asc() and $chr() cannot comfortably handle them

 Respond  
gooshie   -  Jul 31, 2010

Jethro,
The goto labels are not case sensitive so that is the only way to do it with goto.
I prefer keeping list of things like this in one lump with whatever method I store it.
I was able to close the list window but unable to keep it from opening which I would prefer.
I don't think it's possible to keep it from opening probably because it is not an 'on event' like 'on text' etc.
As far as having it respond only for unreald it should be possible to store that from raw 005 on connect.
I wonder what will become of $asc and $chr in the next mIRC version 7 since its supposed to be unicode. Btw, there is a beta for it now. I have not used it yet.

 Respond  
Jethro   -  Jul 30, 2010

Wow gee, thanks much gooshie for your time showing your way of going about this...much appreciated. That is a very nice idea using mIRC $chrs. Thanks again for giving me a valuable lesson. :P

 Respond  
gooshie   -  Jul 30, 2010
on $*:text:/!display (\43\S+)/iS:#:{
  if !%f {
    inc -u3 %f
    set -u3 %cchan #
    list $regml(1)
  }
}

raw 321:*:if %cchan { haltdef }
raw 323:*:if %cchan { haltdef | window -c "Channels List" }
raw 322:*:{
  if %cchan {
    var %m $remove($gettok($gettok($2-,1-3,32),3-,32),+,[,])
    msg %cchan $gettok($2-,1-3,32)
    var %a 0,%b $len(%m)
    while %a < %b {
      inc %a
      .msg %cchan $iif($listmode($mid(%m,%a,1)),$v1,$mid(%m,%a,1) * No mode definition)
    }
  }
}

alias listmode {
  goto $asc($1)
  :65 | return A - Admins only Channel
  :67 | return C - No CTCPs allowed in the Channel
  :71 | return G - Censor Bad Language
  :75 | return K - /KNOCK is not allowed
  :77 | return M - Must be using a registered nick(+r), or have voice access to talk
  :78 | return N - No Nickname changes are permitted in the Channel
  :79 | return O - IRC Operator only Channel (settable by IRCops)
  :81 | return Q - No Kicks Allowed
  :82 | return R - Only registered(+r) users may join the Channel
  :83 | return S - Strips mIRC color codes
  :84 | return T - No NOTICEs allowed in the Channel
  :86 | return V - /INVITE is not allowed
  :99 | return c - Block messages containing mIRC color codes
  :102 | return f - Channel has flood modes applied
  :105 | return i - A user must be invited to join the Channel
  :107 | return k - <key> = Users must specify <key> to join
  :108 | return l - <number of max users> = Channel may hold at most <number> of users
  :109 | return m - Moderated Channel(only +vhoaq users may speak)
  :110 | return n - Users outside the Channel can not send PRIVMSGs to the Channel
  :112 | return p - Private Channel
  :114 | return r - The Channel is registered (settable by Services only)
  :116 | return t - Only Ops set topic
  :117 | return u - Auditorium mode (/names and /who only show Channel OPS)
  :122 | return z - Only Clients on a Secure Connection (SSL) can join
  :error | reseterror
}
________________________________________________________________________________________
 Respond  
Jethro   -  Jul 28, 2010

Yes, Teen, but I'm sure it can be modified to fit the profile of other networks.

 Respond  
_Teen_   -  Jul 28, 2010

u need to identify that this script just works for UnrealIRCd or another elese that uses the same modes... there is networks that this same Flags are different like flags +J +j +p and +x and many others

 Respond  
Jethro   -  Jul 27, 2010

Ford, that is a good idea, but the problem is, if I have the output emitted via raw 323, the channel info will go to the bottom and the mode definitions go on top, which will become the opposite of what the original output is supposed to be.

 Respond  
FordLawnmower   -  Jul 27, 2010

I think you need to trap 323 also and send an error message when the channel doesn't exist.

 Respond  
Jethro   -  Jul 27, 2010

Plus I don't see how raw 322 will check the "whole list" when it only returns the channel info you've specified.

 Respond  
Jethro   -  Jul 27, 2010

napa182, give me your best suggestion so I can learn from it. I'm sure there is a way to keep the list window closed upon the trigger of this script.

 Respond  
Cheiron   -  Jul 27, 2010

the bot gets the modes direct from /list command and just strips the description away before listing what the modes are in use.
granted some modes are missing .. ie j and 0 (throttle and oper only) but they are not really used for "general" users channels. obviously this is unrealircd based script also

 Respond  
napa182   -  Jul 27, 2010

eh why check the whole list when you are looking up 1 chan also hate the chan window still being open.

 Respond  
Jethro   -  Jul 27, 2010

napa182, this script is to check for all the channels within a server.

 Respond  
napa182   -  Jul 27, 2010

why didn't you use $chan(#).mode to get the channel modes?

 Respond  
Cheiron   -  Jul 27, 2010

many thanks Jethro_ for this and it has helped out the staff on 2 different servers i work on to no end after they freely admitted they dont know what half the channel modes are or what they do.

gets a nice thumping like and a 10 from me.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.