mIRC Home    About    Download    Register    News    Help

Print Thread
channels list in mult network #107985 15/01/05 09:56 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
Is there a better/faster/shorter way to do this?

Code:
alias _mchan {
  var %a = 1,%c = 1
  while ($scon(%a)) {
    while ($chan(%c)) {
      echo -a $v1
      inc %c
    }    
    inc %a
  }
}

Re: channels list in mult network #107986 15/01/05 10:25 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
only lists the channels of the active connection if i test it ?

Re: channels list in mult network #107987 15/01/05 10:36 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
yes

Re: channels list in mult network #107988 15/01/05 11:51 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
What exactly do you want this alias to do? Like how should it display the channel list, etc..

Re: channels list in mult network #107989 16/01/05 12:30 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
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.


New username: hixxy
Re: channels list in mult network #107990 16/01/05 12:53 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Last edited by DaveC; 16/01/05 12:56 AM.
Re: channels list in mult network #107991 16/01/05 01:23 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 16/01/05 03:06 AM.

Gone.
Re: channels list in mult network #107992 16/01/05 07:14 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 smile

Code:
alias _mchan scon -at1 $replace(    var %a = 1 | while $chan(%a) { echo -a $v1 | inc %a }   , $chr(160), $chr(32))

Re: channels list in mult network #107993 16/01/05 07:18 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 16/01/05 07:19 AM.

Gone.
Re: channels list in mult network #107994 16/01/05 07:35 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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