http://www.hawkee.com/snippet/7003/ - This is Gooshies network alias with some things i added on.
This is just an edit of gooshies network alias that i use that has $network(1).id so it tells you the con id, great for multi server messaging etc and i use it in many scripts. This is 95% gooshies and 5% mine, i do not claim any credit for this other than the edit :P.
Use: //echo -a $network(1) - returns first network
Use: //echo -a $network(1).id - returns first networks connection id
Use: //echo -a $network(0) - returns total number of networks.
Use: //echo -a $network(0).list - Returns a list of networks that you are on seperated by $chr(32)
alias network {
var %i 1, %n
while $scon(%i) {
scid $v1
if ($status = connected) { %n = $addtok(%n,$network,32) }
inc %i
}
if ($prop == id) && ($1 != 0) { return $conid($1) }
if ($1 = 0) && ($prop != list) return $scon(0)
elseif ($1 isnum 1- $scon(0)) %n = $gettok(%n,$1,32)
elseif ($1 != list) && ($prop != list) %n = ""
return %n
}
alias conid {
if ($network($1)) {
var %x $scon(0)
while (%x) {
var %b $scon(%x)
scid %b
var %n [ $+ [ %x ] ] $network
if (%x == $1) return $cid
dec %x
}
return %n3
}
else return $!null
}
C'mon dude, don't be dramatic. I wasn't implying that to you, but to gooshie who's been scripting for many years and he knows quite a bit in scripting. I basically pointed out that it's beneficial to learn from those who know something that you (or we) don't. There're lots to gain and nothing to lose.
P.S. I'm not trying to be sarcastic or competitive either. Experienced or not, I believe we're all learning...and it's a never-ending process.