Join a lot of channels then
Syntax is //echo -a $chans
Will return all your channels you are currently in
alias chans {
%xx = 1
while (%xx <= $chan(0)) { set -u1 %chans $chan(%xx) $+ , $+ %chans | inc %xx }
return %chans
}
Nice regsubex sunslayer :)
I call that the WorldDMT trick cause that's where I learned it.
If someone doesn't understand how it works, a string of .(dots) is created based on the number of channels. So if there are 7 channels it's like this -->> .......
You use /./g to make it find all matches of the .(dot)
Each time it finds a .(dot) it will do a substitution, so you can use \n inside of $chan() - ie $chan(\n) to return each channel because \n will return the number of the current match or .(dot)
It's a sweet shortcut that can save lots of time and replace a lot of code.
For a space deliminated channel list:
alias Chans {
var %c,%i = 1
while $chan(%i) {
%c = %c $v1
inc %i
}
if $isid { return %c }
else { echo -a %c }
}
For a comma deliminated channel list:
alias Chans {
var %c,%i = 1
while $chan(%i) {
%c = $addtok(%c,$v1,44)
inc %i
}
if $isid { return %c }
else { echo -a %c }
}
@independentt: Your code will only return one channel. It won't return all the channels where you are. You should correct it and make it as such:
alias chans {
var %xx = 1
while (%xx <= $chan(0)) {
var %yy = %yy $chan(%xx)
inc %xx
}
return %yy
}
@blackvenomm666, the trigger is: //echo -a $chans
You can change
return %yy
to
echo # %yy
so that you can just use /chans to trigger the script and have all your channels echoed to you where you submit the alias.