This is kind of a spammy script.. But it will show you the Network's connected to with Nicks, Server's, Channels and if you are away. and will hide all channels with +s/+p/+O/+A in channel modes
Syntax:
/nets n (Show's just Network name and your nick)
/nets c (Show's Network Name, Channels and your nick)
/nets a (Show's network name, your nick and if you're marked away on the network)
/nets s (Show's Network name, your nick and the server you are connected too)
UPDATE: I have added /nets o into the script as well.. Just show's what Oline status you have on each network or "No IRC Status" if it's null.
alias nets {
if ($$1 == n) {
var %ctr = 0 | var %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr | msg $active 12[15Connected To12]15: $scon(%ctr).network 12[15As12]15:4 $scon(%ctr).me
}
}
elseif ($$1 == c) {
var %ctr = 0 | var %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr | msg $active 12[15Connected To12]15: $scon(%ctr).network 12[15In12]15: $scon(%ctr).chanz 12[15As12]15: $scon(%ctr).me
}
}
elseif ($$1 == a) {
var %ctr = 0 | var %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr | msg $active 12[15Connected To12]15: $scon(%ctr).network 12[15As12]15: $scon(%ctr).me 12[15And Marked As12]15: $iif($scon(%ctr).away == $true,Away,Here)
}
}
elseif ($$1 == S) {
var %ctr = 0 | var %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr | msg $active 12[15Connected To12]15: $scon(%ctr).server 12[15As12]15: $scon(%ctr).me
}
}
elseif ($$1 == o) {
var %ctr = 0 | var %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr | msg $active 12[15Connected To12]15: $scon(%ctr).network 12[15As12]15: $scon(%ctr).me 12[15Oline Status12]15: $scon(%ctr).oline
}
}
}
alias -l chanz {
var %channelcounter = 1
while (%channelcounter <= $chan(0)) {
if (s isincs $chan(%channelcounter).mode) || (O isincs $chan(%channelcounter).mode) || (A isincs $chan(%channelcounter).mode) || (p isincs $chan(%channelcounter).mode) { inc %channelcounter 1 }
else { var %channeltotal = %channeltotal $iif($istok(~|&|@|%|+,$left($nick($chan(%channelcounter),$me).pnick,1),124),$left($nick($chan(%channelcounter),$me).pnick,1) $+ $chan(%channelcounter) $+ $chr(32),$chan(%channelcounter) $+ $chr(32)) | inc %channelcounter 1 }
}
return %channeltotal
}
alias -l oline {
if (N isincs $usermode) { return Network Admin. | HALT }
if (A isincs $usermode) { return Server Admin. | HALT }
if (a isincs $usermode) { return Services Admin. | HALT }
if (O isincs $usermode) { return Local IRC Operator. | HALT }
if (o isincs $usermode) { return Global IRC Operator. | HALT }
if (!$istokcs(N|A|a|O|o,$usermode,124)) { return No IRC Status. | HALT }
}
$istokcs(A B C, $X, 32) checks if ($X === A) || ($X === B) || ($X === C), that's not the same as what he has. what he has is this:
if ($countcs($chan(%channelcounter).mode, s, O, A, p)) {
try to use $gettok($chan( ).mode, 1, 32) wherever you can, $chan( ).mode can include things like channel keys which may contain the modes you're checking for :P
For the chanz alias, if you already know about the $istok(), why not take advantage of the $istokcs(), the case sensitive version for this line:> if (s isincs $chan(%channelcounter).mode) || (O isincs $chan(%channelcounter).mode) || (A isincs $chan(%channelcounter).mode) || (p isincs $chan(%channelcounter).mode) {It can be shortened to this:
if ($istokcs(s O A p,$chan(%channelcounter).mode,32)) {
Why did you make several while loops when one will do:
alias nets {
var %ctr = 0, %tot = $scon(0)
while (%ctr < %tot) {
inc %ctr
}
if ($$1 == n) {
msg $active 3*14 7Connected To:4 $scon(%ctr).network 7As:4 $scon(%ctr).me $+
}
elseif ($$1 == c) {
msg $active 3*14 7Connected To:4 $scon(%ctr).network 8( $+ 7In14 $scon(%ctr).chanz $+ 8) 7As:4 $scon(%ctr).me $+
}
elseif ($$1 == a) {
msg $active 3*14 7Connected To:4 $scon(%ctr).network 7As:4 $scon(%ctr).me 7and marked as:4 $iif($scon(%ctr).away == $true,Away,$iif($scon(%ctr).away == $false,Here)) $+
}
elseif ($$1 == S) {
msg $active 3*14 7Connected To:4 $scon(%ctr).server 7As:4 $scon(%ctr).me $+
}
}
Saves you 248 bytes, excluding the chanz alias.