mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
When On Active is triggered by switching away from a DCC Send or Get window (or if window closes because get is finished), then $lactive, $lactivewid are not set.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Can you give more details how to re-create this bug? I went into mirc-options and unchecked the box to close-on-completion for sends and gets, then i sent versions.txt to myself, leaving both the dcc-send and dcc-get windows open. I then created a snippet to trap the ON ACTIVE event:

Code:
on *:ACTIVE:*:{
  echo -s ON ACTIVE lactive $lactive lactivewid $lactivewid
}


When I click to the get window, then click to status window, it displays "Get mynick versions.txt" as the $lactive value and shows a number for the $lactivewid

If I click to a different network than the get/send, it still shows the $lactive window's name, even though that window doesn't exist as far as that network is concerned. There is a difference regarding which network I do:

//echo -a $window(Send $me versions.txt)
or
//echo -a $window(Get $me versions.txt)

This returns the $null string at any network except the network where the send-to-self was made.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Set close on completion and switch to the window when it is downloading and see what you get when the window auto-closes.

(I didn't test this myself with a manual close, but I was also getting the error when switching windows whilst the download was in progress.)

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Actually I get this if I close a channel or custom window too.

It seems to be an issue when you close a window rather than when you switch away from a DCC window.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I'm now seeing what you're talking about, which isn't exactly as you first described. The behavior is happening only when the last-active window no longer exists, either because of close-on-complete or by manually closing the window. It's not happening when you're clicking back-and-forth to/from a dcc window that remains open.

If the last active window no longer exists, $lactive returns $null rather than the name of a window that no longer exists, and $lactivewid returns 0 rather than the WID of a non-existent window.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Originally Posted By: maroon
I'm now seeing what you're talking about, which isn't exactly as you first described. The behavior is happening only when the last-active window no longer exists, either because of close-on-complete or by manually closing the window. It's not happening when you're clicking back-and-forth to/from a dcc window that remains open.

If the last active window no longer exists, $lactive returns $null rather than the name of a window that no longer exists, and $lactivewid returns 0 rather than the WID of a non-existent window.


Yes - apologies for not having described it correctly first time. I can probably code around this bug by using the ON CLOSE event.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127

Code:
on *:CLOSE:*:{ echo -s $scriptline ONCLOSE active $active lactive $lactive lactivewid $lactivewid }


I'm not finding ON CLOSE being triggered by closing a DCC window either manually or close-on-complete. A better check would be if $lactivewid is zero.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
No - ON CLOSE is not called on close of DCC GET window.

Also, I seem to be getting variable experiences on whether ON CLOSE is called on close of the single message window.

I am entirely unsure how to code around this in a manner which will work consistently - except by maintaining my own record of $lactive / $lactivewid in variables.

Last edited by Protopia; 07/08/17 08:41 PM.

Link Copied to Clipboard