mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2008
Posts: 95
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
I'm not sure whether to post this in the "Bug Reports" or "Feature Suggestions" section,
please excuse me if it doesn't belong here.

I'm wondering if $chan(#chan) can be changed to return the number of the given channel instead of just "#chan".

$nick(#chan,asdfasdf) returns "3" if asdfasdf is the third nick,
but $chan(#chan) just returns "#chan" instead of #chan's number, say "5".

And in $chan()'s help I can't find a property or way to find out the given channel's number either.

Thanks!

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Probably not anymore, since it would break a lot of scripts that rely on this behaviour.

Also this behaviour exists so that you can do things like "//msg $$chan($1) hello" and have it fail gracefully/halt if $1 is not a channel you are on (because $chan(#chan) can return $null).


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2008
Posts: 95
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
Hmm, true, good points.

So I take it the only way to get a channel's number is by looping through $chan(%i) and checking for the given channel yourself?
A $chan() property for this might be neat.

Also, posting this in the "Bug Reports" rather than in the "Scripts & Popups" section probably was a bad idea after all.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Yea, that's how you would do it. Perhaps Khaled could add a $chan(#).pos that returns the N value.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Dec 2008
Posts: 95
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
Alright, thank you.

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
but what order would it use? because there is the 'alphabetic order' aswell as the 'joined order'.

should it be consistant over the two by choosing just one? and which one would that be? the currently active sorting method or always alphabetic?


If it ain't broken, don't fix it!
Joined: Dec 2008
Posts: 95
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
It would use the same order as you use and see in your switch-/treebar, depending on your alt + o -> Display -> Sort buttons setting.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It would return whatever the N that represents the channel in $chan(N) is. That doesn't include switchbar order AFAIK.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard