mIRC Homepage
Posted By: saetji Close channel window - 06/03/04 01:42 PM
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?
Posted By: Collective Re: Close channel window - 06/03/04 01:46 PM
Try /window -c [color:green]#channel[/color].
Posted By: saetji Re: Close channel window - 06/03/04 01:48 PM
tried that too, didn't work - but it doesn't show any error either
Posted By: DeeperID Re: Close channel window - 11/08/04 08:17 PM
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.
Posted By: Coolkill Re: Close channel window - 11/08/04 08:57 PM
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.
Posted By: Coolkill Re: Close channel window - 12/08/04 12:49 PM
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.
Posted By: DeeperID Re: Close channel window - 12/08/04 08:43 PM
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)
Posted By: Coolkill Re: Close channel window - 12/08/04 10:21 PM
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.
© mIRC Discussion Forums