mIRC Home    About    Download    Register    News    Help

Print Thread
#218403 12/02/10 10:30 PM
Joined: Dec 2002
Posts: 8
C
Cougar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2002
Posts: 8
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.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You can use /window -a, like in
Code:
on me:*:join:#: { window -a $chan }


Joined: Dec 2002
Posts: 8
C
Cougar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2002
Posts: 8
That seems as if it is for custom windows only. Either that, or it's my version.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Try:
Code:
on me:*:join:#:join $chan
to bring the active channel window to focus.

Joined: Dec 2002
Posts: 8
C
Cougar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2002
Posts: 8
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.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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

Last edited by Horstl; 12/02/10 11:36 PM.
Joined: Dec 2002
Posts: 8
C
Cougar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
C
Joined: Dec 2002
Posts: 8
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.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
/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.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 31
Ameglian cow
Offline
Ameglian cow
Joined: Sep 2003
Posts: 31
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.





Active mIRC user since 1998
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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.

Last edited by Horstl; 13/02/10 01:21 PM.
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Sep 2003
Posts: 31
Ameglian cow
Offline
Ameglian cow
Joined: Sep 2003
Posts: 31
Thanks for the info Wims & Horst, will try this out.


Active mIRC user since 1998
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
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


WorldDMT

Link Copied to Clipboard