mIRC Homepage
Posted By: Cougar Particular Channel in Focus - 12/02/10 10:30 PM
I cannot seem to figure out how to have a channel come into focus via a script command. When I connect and join a channel, I'd like to have the channel become the active channel. Does anyone have any ideas? Thanks in advance.
Posted By: Horstl Re: Particular Channel in Focus - 12/02/10 10:52 PM
You can use /window -a, like in
Code:
on me:*:join:#: { window -a $chan }

Posted By: Cougar Re: Particular Channel in Focus - 12/02/10 11:03 PM
That seems as if it is for custom windows only. Either that, or it's my version.
Posted By: Tomao Re: Particular Channel in Focus - 12/02/10 11:06 PM
Try:
Code:
on me:*:join:#:join $chan
to bring the active channel window to focus.
Posted By: Cougar Re: Particular Channel in Focus - 12/02/10 11:27 PM
That did work. Thank you very much. I have not seen this "On me" event before. I'll have to study up on that one, however I cannot seem to find it in the help. Thanks guys, greatly appreciated.
Posted By: Horstl Re: Particular Channel in Focus - 12/02/10 11:31 PM
Hum, /window commands do work on channels for me... confused

Just out of curiosity, is this one working for you?
Code:
on me:*:join:#: {
  bset -t &a 1 $chan
  .timer -m 1 0 window -a $!regsubex( $bvar(&a,1-) ,/(\d+)(?: |$)/g,$chr(\1)) 
}
(a timer to fire the /window -a command after the on join event; the bset-regsubex-thingie to prevent an evaluation of the channel name)

The "me:"-prefix isn't documented in the helpfile smile It's explained e.g. in Undocumented mIRC
Posted By: Cougar Re: Particular Channel in Focus - 12/02/10 11:57 PM
When I used "window -a $chan"
Status window showed "/window: invalid parameters"

When I used

on me:*:join:#: {
bset -t &a 1 $chan
.timer -m 1 0 window -a $!regsubex( $bvar(&a,1-) ,/(\d+)(?: |$)/g,$chr(\1))
}

I received
"/window: insufficient parameters"

Unfortunately, I have to use an older version of MIRC (6.03) so this may be the problem, although looking at help for both v6.03 and v6.35, it says /window is to be used for custom windows only.

Horstl,
Thank you for the undocumented help. That was nice to see.
Posted By: Riamus2 Re: Particular Channel in Focus - 13/02/10 12:10 AM
/window works fine in channels for me on 6.35. Why you're using something MANY years old is beyond me.

Tested using //window -a #channel from edit line.

It also works fine in the on join event. Though I don't know why you need this. Just typing /join #channel will make that channel active.
Posted By: DiMTRX Re: Particular Channel in Focus - 13/02/10 01:00 PM
Will the -a parameter keep one window active and on screen during the loading of other scripted channels ? Was wondering about that cause joining 4 servers with approx 30 channels, and mIRC then focuses them one by one on join. Would be nice if that could be avoided.



Posted By: Horstl Re: Particular Channel in Focus - 13/02/10 01:19 PM
You can issue a "/join -n #".
If the channel window wasn't created as yet (e.g. first connect), the chan will be joined in a minimized window (thus not stealing focus). And if the channel window was already open (e.g. after a a reconnect - requires "keep channels open" ticked in Options:IRC), mIRC won't switch the focus to that window either in the rejoin. Finally, the favorites have a "minimized join" checkbox (Alt-J:Edit) which does the same as the -n switch.
Posted By: Wims Re: Particular Channel in Focus - 13/02/10 01:19 PM
The /join command makes the joined channel the active window, this is by default.The -n switch let you join this channel with a minimized window (more than useful).
mIRC's option also let you choose if you want to join a channel minimized or not.
This could mean you're using a script that join channel minimized whereas you don't want this feature.
Posted By: DiMTRX Re: Particular Channel in Focus - 13/02/10 01:32 PM
Thanks for the info Wims & Horst, will try this out.
Posted By: Tomao Re: Particular Channel in Focus - 13/02/10 06:58 PM
Originally Posted By: Wims
This could mean you're using a script that join channel minimized whereas you don't want this feature.
I agree. Whatever script cougar is running has to be the culprit that stops the channel from being active.
Posted By: chacha Re: Particular Channel in Focus - 14/02/10 01:42 PM
Originally Posted By: Wims
mIRC's option also let you choose if you want to join a channel minimized or not.

i think this option it's only for query windows
© mIRC Discussion Forums