This is a snippet i made that shows all the information of your own nickname and if you have more then one connection of those too!
commands are:
/power
This will echo it.
alias power {
var %a = 1,%nets = 0,%ops = 0,%halfops = 0,%voiced = 0,%normal = 0,%control = 0,%total = 0,%totalchans = 0
while ($scon(0) >= %a) {
scon %a
if ($status == connected) {
inc %nets
var %chans $comchan($me,0)
inc %totalchans %chans
var %b = 1
while (%chans >= %b) {
if ($me isreg $comchan($me,%b)) inc %normal
elseif ($me isop $comchan($me,%b)) inc %ops
elseif ($me ishop $comchan($me,%b)) inc %halfops
elseif ($me isvoice $comchan($me,%b)) inc %voiced
var %c = 1
;nicks in each channel
while (%c <= $nick($comchan($me,%b),%c)) {
inc %total
var %curchan = $comchan($me,%b)
if ($me isreg %curchan) { inc %total $nick($comchan($me,%b),0) | break }
elseif ($nick(%curchan,%c) ishop %curchan) {
if ($!me isop %curchan) inc %control
}
elseif ($nick(%curchan,%c,vor)) && ($nick(%curchan,$me,oh)) inc %control
}
inc %c
}
inc %b
}
}
inc %a
}
scon -r
var %msg = I am currently in $p.c(%totalchans) channels across $p.c(%nets) networks. I am OPed in $p.c(%ops) channels, halfoped in $p.c(%halfops) channels, $&
voiced in $p.c(%voiced) channels, and a regular user in $p.c(%normal) channels. I control $p.c($+(%control,/,%total)) $+ , or $p.c($round($calc(%control / %total *100),2) $+ %) of users.
msg $active $iif(c !isincs $chan($active).mode,%msg,$strip(%msg))
}
alias -l p.c return $+(,$1-,)
[i]concur, those braces are extraneous and accomplish nothing except give people the false impression that only those commands in between the braces are tied to the selected connection.
scon 1
; commands here apply to con 1
scon 2 {
; this command applies to con 2
; so does this
}
; but this command also applies to con 2, it doesn't revert back to con 1.
this happens because the '{' and '}' are simply ignored by mIRC, and '/scon 2', as we know, switches the connection to 2 for the rest of the running process.
adding unnecessary braces can sometimes improve readability though, here's an example:
goto %var {
:my
:labels
:here
}
; rest of code
the indentation created by those braces allows a person to easily see the extent of the scripter's goto labels.
This:
elseif ($nick(%curchan,%c) isvoice %curchan) || ($nick(%curchan,%c) isop %curchan) || ($nick(%curchan,%c) isreg %curchan) {
if ($me isop %curchan) || ($me ishop %curchan) inc %control
Could have been shortened a lot more to:
elseif ($nick(%curchan,%c,vor)) && ($nick(%curchan,$me,oh)) inc %control