mIRC Home    About    Download    Register    News    Help

Print Thread
A
asdfasdf
asdfasdf
A
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,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
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).

A
asdfasdf
asdfasdf
A
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,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
Yea, that's how you would do it. Perhaps Khaled could add a $chan(#).pos that returns the N value.

A
asdfasdf
asdfasdf
A
Alright, thank you.

Joined: Jan 2003
Posts: 1,057
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,057
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?

A
asdfasdf
asdfasdf
A
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,641
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,641
It would return whatever the N that represents the channel in $chan(N) is. That doesn't include switchbar order AFAIK.


Link Copied to Clipboard