Is there a better/faster/shorter way to do this?
alias _mchan {
var %a = 1,%c = 1
while ($scon(%a)) {
while ($chan(%c)) {
echo -a $v1
inc %c
}
inc %a
}
}
only lists the channels of the active connection if i test it ?
What exactly do you want this alias to do? Like how should it display the channel list, etc..
alias listchans { scon -at1 _listchans }
alias _listchans {
var %i = 1
while ($chan(%i)) {
echo -a $v1
inc %i
}
}
/_listchans - list channels on the active connection.
/listchans - list channels on all connections.
alias _mchan { scon -a var % $+ c = 1 $chr(124) while ($chan(%c)) $chr(123) echo -a $!v1 $chr(124) inc % $+ c $chr(125) }
if u want to reduce the code size.
Hehe, I couldn't resist :tongue:
alias _mchan scon -at1 var $(%a = 1 |,) while $!chan(%a) $({ echo -a $v1,) $(| inc %a },)
But I must say, what you win in "less code" you lose in "readability".
This could also work:
alias _mchan tokenize 32 $dde($ddename,channels) | echo -a $*
However :
Not preferable as stated in the mIRC helpfile, and dde must be enabled of course. Another thing is, it displays ALL channels, including those where you are disconnected, and are still open.
Btw, I thought the DDE used to not work properly (spaces removed) on multiple connections, but after being on 3 diff networks at the same time, and in several channels, it still gave me the channels nicely, delimited by spaces.
I think what tidy gave would be best.
Greets
lol this relates directly to a post i just made to u infact.
In that one i uses _ not $chr(160)
Readability it is then
alias _mchan scon -at1 $replace( var %a = 1 | while $chan(%a) { echo -a $v1 | inc %a } , $chr(160), $chr(32))
Yeah,
that was the reason why I made that suggestion actually.
If I have to be honest, I think $chr(160) is even worse than _, because people who copy the code (and don't know how it works exactly), might just think that the copying put extra spaces. The moment they remove one of those hard spaces, the code fails.
Btw I didn't remove spaces, and I already get invalid format replace :tongue:
Greets
lol thats what i get for being a smartypants using 160's,
$replace( _var_%a_=_1_|_while_$chan(%a)_{_echo_-a_$v1_|_inc_%a_} ,_,$chr(32))
worked
Actually i just checked my code, its the message board, it converted the 160's to spaces i think.
Yes i agree 160's are bound to cause lifes little horrors
I remember mine i was comparing text and couldnt work out why AB C != AB C