alias con {
var %z
scon -a $(%z = %z $cid,)
return $findtok(%z,$cid,32)
}
on *:text:*:%chan1:{
if ($con == [color:red]N[/color]) {
scon [color:red]M[/color]
msg %chan2 $+(<,$nick,>) $1-
}
}
i included $con as an alias since it can be quite useful

change N to the number of the connection you want to relay from

like if its the fifth open connection, N = 5. similarly, change M to the connection to relay to
%chan1 and %chan2 should be self explanatory

you could replace the $con check with a check for $server if you whane