mIRC Home    About    Download    Register    News    Help

Print Thread
#273866 23/03/26 11:35 PM
Joined: Jul 2014
Posts: 324
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 324
Hi guys,

Is there a way to close custom windows only on the active connection?

Imagine, I have 4 connections and all of them have several custom windows, and I only want to close the custom windows on the network where I'm running the command. Is that possible?

I tried with the command `/close -@`, but it closes all custom windows on all networks.

I appreciate anyone who can help wink


TECO
irc.PTirc.org (Co-Admin)
TECO #273867 24/03/26 09:38 AM
Joined: Sep 2005
Posts: 126
Vogon poet
Offline
Vogon poet
Joined: Sep 2005
Posts: 126
Use $cid in the name of each window, for example at the end of the name (/window @name. $+ $cid).

on *:close:status window:close -@ @name. $+ $cid


when no one watching us
we are invisible
TECO #273868 24/03/26 10:55 AM
Joined: Jan 2012
Posts: 384
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 384
Try using this script code:
Code
alias close_wins {
  var %i $window(0) | while (%i) {
    if ($window(%i).cid == $activecid) { window -c $window(%i) }
    dec %i
  }
}

Enter the command in the active window: /close_wins


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Epic #273869 24/03/26 03:39 PM
Joined: Jul 2014
Posts: 324
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 324
Thank you Epic

This is perfect wink


TECO
irc.PTirc.org (Co-Admin)
Epic #273877 29/03/26 08:56 PM
Joined: Jul 2006
Posts: 4,045
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,045
You can close a windows based on its CID, '/window -c @ $+ $activecid' would do the job here, no need for a while loop

Last edited by Wims; 30/03/26 04:39 PM. Reason: that's just incorrect

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273878 30/03/26 12:37 AM
Joined: Sep 2003
Posts: 44
O
Ook Offline
Ameglian cow
Offline
Ameglian cow
O
Joined: Sep 2003
Posts: 44
Sorry to have to correct you Wims but...
That may work by happenstance if you only have a single window open and it's wid happens to match the cid, but not for multiple windows.
The command syntax is "/window -c @wid" so it only closes the matching window with that wid (tested on v7.83).

Ook #273879 30/03/26 04:37 PM
Joined: Jul 2006
Posts: 4,045
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,045
Oops, guess my mind tried to make sense of eveything, between devilbat's answer and the way the question was titled/phrased, I misread it was about closing all windows of a given CID


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #273881 31/03/26 10:26 PM
Joined: Jul 2014
Posts: 324
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 324
Originally Posted by Wims
Oops, guess my mind tried to make sense of eveything, between devilbat's answer and the way the question was titled/phrased, I misread it was about closing all windows of a given CID

Hi Wims,

No problem, my friend. Epic provided a good solution.

It shows up on IRC.

Best regards wink


TECO
irc.PTirc.org (Co-Admin)
TECO #273883 01/04/26 03:40 PM
Joined: Jan 2012
Posts: 384
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 384
Originally Posted by TECO
This is perfect ... code!
     [Linked Image from i.ibb.co] [Linked Image from i.ibb.co]



🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples

Link Copied to Clipboard