I was quite bored because my mp3 announce system didn't want to send info on all servers I'm on, but just on the currently active one.
So I've got an idea, how to extend usage of ame command.
Later on, I've added global amsg option too, it can be handy too.
usage is simmilar as ame and amsg commands, I named new ones as gme and gmsg to keep the analogy and g instead of a to point it's global :D
So,
/gme Beware I is in da house !!!
should result something like this
Those are three my nicks on three different servers.
alias gme {
set %scid $scid(0)
while ( %scid > 0 ) {
if ($network != $null) { scon %scid ame $1- }
dec %scid
}
}
alias gmsg {
set %scid $scid(0)
while ( %scid > 0 ) {
if ($network != $null) { scon %scid amsg $1- }
dec %scid
}
}
Nice, this is useful. I adapted this to a /gecho command for an alert system but had to add a $cid check.
alias gecho {
set %scid $scid(0)
while ( %scid > 0 ) {
if ($network != $null && $cid !isin %gecho) { set %gecho $addtok(%gecho,$cid,32) | scon %scid echo 4 -a Alert Stuff Here! }
dec %scid
}
unset %gecho
}
That's what you would logically think. However in practice the script would always echo the output into the last active channel on the network in which the script would activate. In this case used as a highlight script for a torrent tracker announce channel, it would never echo into the active channel of the active network in which i was chatting.
Okay, but just note that since $scid(0) counts only opened serv er windows, any server windows you have open that aren\'t connected result in an error and halts the script. I know that since I used to use a similar method to what you have.
Therefore, I recommend you add some sort of checking to the script like if ($network != $null) { amsg } or something of that sort.
/scon
with/echo -a
is mostly pointless. Your active window is active.