mIRC Home    About    Download    Register    News    Help

Print Thread
#195621 28/02/08 02:14 AM
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
Code:
on ^*:CLOSE:@Warp: { window -u @Warp | if ($input(Are you sure you want to quit?,wydv,Quit?) == $no) {
    window -o @Warp | halt
  }
  else { 
    if ($hget(Warp)) { hfree Warp }
    unset %w* | unset %t* | unset %star* | unset %m* | unset %ticks 
  }
}

im not very good with the ^ prefix, so why doesnt this work?


This is not the signature you are looking for
Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi

The even´t on close will trigger when the windows is already closing.
The action off closing can´t be stoped.
Now you can always open i again when closing it.

Note: I don´t know if is ther any other command that can prevent a window to close.

Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
i tried opening up the window again, but it didnt


This is not the signature you are looking for
Joined: Aug 2003
Posts: 144
M
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
query $target for a private
join $target for a channel

by

Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
if u noticed... im using a custom window


This is not the signature you are looking for
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
How are you closing the window?

ON CLOSE doesn't get launched if you /close it (I think it's /window -c @window).

Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
i know


This is not the signature you are looking for
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
.. so how are you closing the window ?

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Officially on ^*:Close is not even suppose to trigger before closing:
Quote:

The ^ event prefix currently works only on the following types of events: ACTION, BAN, CHAT, DEHELP, DEOP, DEVOICE, HELP, INVITE, JOIN, KICK, MODE, NICK, NOTICE, OP, OPEN, PART, PING, TEXT, UNBAN, USERMODE, VOICE, QUIT, SERV, SERVERMODE, SERVEROP, SNOTICE, TABCOMP, TOPIC, WALLOPS.


The fact it does is a bug. You could request this as a feature request.


$maybe
Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
I have used this code and it works fine.
Code:
on ^*:CLOSE:@:$iif($target == @mywindow, myalias)
I suspect that custom windows are the exception to the ^ prefix not working with the CLOSE event.

However, while I don't have a v6.31 installed, I couldn't find anything in
versions.txt that would indicate that we can now use $input inside an event.

Try aliasing out the bulk of the event and just calling the alias from the event.

Last edited by LonDart; 04/03/08 09:54 AM.

LonDart
Joined: Jul 2006
Posts: 107
L
Vogon poet
Offline
Vogon poet
L
Joined: Jul 2006
Posts: 107
Oh, nevermind. Miguel_A is right; you can't stop the window from closing.
The alias i was using merely ensured that the @window contents were saved.

I should test before I post, eh? blush


LonDart

Link Copied to Clipboard