mIRC Home    About    Download    Register    News    Help

Print Thread
#74025 06/03/04 01:42 PM
Joined: May 2003
Posts: 6
S
saetji Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: May 2003
Posts: 6
Im writing a new script for my bouncer, but I had a problem with closing the channel window...

If im connected to a server via a bouncer, and the bouncer gets disconnected from the server, i wanted a way of closing the channel windows:

the /close function doesn't support channel windows and the /part function wont work because it says im not on the channel even though the window is open.

any suggestions?

#74026 06/03/04 01:46 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Try /window -c [color:green]#channel[/color].

#74027 06/03/04 01:48 PM
Joined: May 2003
Posts: 6
S
saetji Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: May 2003
Posts: 6
tried that too, didn't work - but it doesn't show any error either

#74028 11/08/04 08:17 PM
Joined: Apr 2004
Posts: 51
Babel fish
Offline
Babel fish
Joined: Apr 2004
Posts: 51
I have a similiar need to close channel windows where I am unable to get the part message from the IRC server. When not actually in the channel but connected to IRC I only get "your not on that channel" instead of it sending a part message which will then automatically cause mirc to close the channel window. It obviously isn't difficult to close the channel manually with a click but this would help in other remote areas like bots and such if I were able to /window -c #channel or something like that. Though the help file does say /window is to "allows you to create and manipulate custom windows" I wish there was something that could be done here.

#74029 11/08/04 08:57 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Good suggestion, I dont think there is a command to close the channel window without it directly coming from the server, for obvious reasons, but maybe there should be.

You could try something like:


raw *:*:{
if (($chan($4)) && (($numeric == 442) || ($numeric == 403))) {
.window -h $4
}
}


Which checks if the numerics are 442 (not on channel), or 403 (channel doesnt exist), and then checks if the window for that channel is actually open, if it is, it will hide the window from the switchbar.


On me:*:join:#:{
if ($window($chan).state == hidden) {
window -w $chan
}
}


Which makes the channel "visible" when you join it again.

Eamonn.

#74030 12/08/04 12:49 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
In the above, there was a slight bug in the fact that.

.window -h $4 Should have been .window -h $iif($numeric == 403,$2,$4)

However, another not so wonderful but working, method would be..

Using, band.dll and the following:


alias band.dll return $+(",band.dll,")
alias bdll { var %d = $band.dll | if ($isid) return $dll(%d,$$1,$$2-) | dll %d $$1 $$2- }

raw *:*:{
if (($chan($4)) && (($numeric == 442) || ($numeric == 403))) {
window -a $iif($numeric == 403,$2,$4)
bdll menu 61536
}
}


Alternatively, you might be able to use sendkey.dll.

Eamonn.

#74031 12/08/04 08:43 PM
Joined: Apr 2004
Posts: 51
Babel fish
Offline
Babel fish
Joined: Apr 2004
Posts: 51
Ahh, well that would solve my problems however it doesn't trick $chan(0) into giving the amount of channels on the switchbar. If on the channel or banned from it and the channel is open somewhere it still shows the same $chan(0)

#74032 12/08/04 10:21 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Yeah well thats because the workaround merely hides it from the switchbar, doesnt really close the window, however the above one using the band.dll, actually closes the window.

Eamonn.


Link Copied to Clipboard