mIRC Home    About    Download    Register    News    Help

Print Thread
why doesnt this work #195621 28/02/08 02:14 AM
Joined: Aug 2007
Posts: 334
foshizzle Offline OP
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
Re: why doesnt this work [Re: foshizzle] #195623 28/02/08 03:01 AM
Joined: Aug 2003
Posts: 144
M
Miguel_A Offline
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.

Re: why doesnt this work [Re: Miguel_A] #195625 28/02/08 03:21 AM
Joined: Aug 2007
Posts: 334
foshizzle Offline OP
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
Re: why doesnt this work [Re: foshizzle] #195626 28/02/08 03:23 AM
Joined: Aug 2003
Posts: 144
M
Miguel_A Offline
Vogon poet
Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
query $target for a private
join $target for a channel

by

Re: why doesnt this work [Re: Miguel_A] #195628 28/02/08 03:42 AM
Joined: Aug 2007
Posts: 334
foshizzle Offline OP
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
Re: why doesnt this work [Re: foshizzle] #195629 28/02/08 04:11 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
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).

Re: why doesnt this work [Re: Bekar] #195630 28/02/08 05:09 AM
Joined: Aug 2007
Posts: 334
foshizzle Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
i know


This is not the signature you are looking for
Re: why doesnt this work [Re: foshizzle] #195632 28/02/08 08:37 AM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
.. so how are you closing the window ?

Re: why doesnt this work [Re: foshizzle] #195637 28/02/08 12:08 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
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
Re: why doesnt this work [Re: foshizzle] #195870 04/03/08 09:06 AM
Joined: Jul 2006
Posts: 107
L
LonDart Offline
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
Re: why doesnt this work [Re: LonDart] #195873 04/03/08 06:24 PM
Joined: Jul 2006
Posts: 107
L
LonDart Offline
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