Using 3 is going to break in no time, as andy points out.
Here's a little alias that I use that might be of interest for you:
$getcid(<network|server> [,#channel])[.server] - $getcid(network) returns the $cid of the specified network if you're on it
- $getcid(network,#channel) returns the $cid of that network, but only if you are on the specified channel
- $getcid(server).server returns the $cid of the server (handy in cases where the $network name doesn't exist or isn't filled)
- $getcid(server,#channel).server returns the $cid of the server but only if you are in the specified channel there
alias getcid {
if $prop && !$istok(server network,$prop,32) { echo -ac info * $!getcid: Invalid property | return }
var %cid
scon -at1 if ($ $+ $iif($prop,$prop,network) == $1) $iif( $2,&& ( $2 ischan)) $(%cid = $cid,)
return %cid
}
Some specific examples:
//echo -a $getcid(rizon) * $getcid(rizon,#kustomskripts) * $getcid(irc.dal.net).server * $getcid(irc.efnet.net,#efnet).server * $getcid(undernet)
It's important to realize that if you do not specify the .server property, that the first parameter in the $getcid is taken as a network. If you do specify the .server property, the alias assumes the first param $1 is a server. You can also use the .network property, but that's obsolete, since it defaults to that. So $getcid(somenetwork).network is the same as $getcid(somenetwork)
In your case you'll have to do something like:
if $getcid(thenetwork,#mp3spam) {
scid $v1
msg #mp3spam my message
}
Btw it is very important for you to realize that using the scid/scon commands comes with great danger for exploits. As you may or may not know, parameters passed to a scon/scid command are evaluated 2 times. Once when sent to the command, and once at the target connection. Think of it as using a timer. When you set a timer, the parameters passed to the timer are evaluated now, and when the timer triggers.
Therefore you should either do:
--
scid $v1 | msg #chan $1-
--
scid $v1
msg #chan $1-
--
var %msg = $1-
scid $v1 msg #chan % $+ msg or $(%msg,)
--
Greets