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
}
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]
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/channelt No such nick/channel
r No such nick/channel
AutoIT No external channel messages (#AutoIT)
-
n No such nick/channelt 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.
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"
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
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.
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
}
________________________________________________________________________________________
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