mIRC Home    About    Download    Register    News    Help

Print Thread
ability to halt an event.... #195657 28/02/08 04:09 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
I had asked about this in the script help forum and they suggested i request it.
i want the ^ prefix to be able to halt an event before it happens... like if i want to close a window
Code:
on ^:CLOSE:@Window:$iif($input(Are you sure?,yvd,Close?) == $yes, , halt)

if its true let it do nothing to close.. otherwise halt.. or use '/continue' to close it

Last edited by foshizzle; 28/02/08 04:10 PM.

This is not the signature you are looking for
Re: ability to halt an event.... [Re: foshizzle] #195672 28/02/08 06:42 PM
Joined: Jul 2006
Posts: 3,568
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,568
If you request on ^*:close have this behavior with /halt or /haltdef, on ^*:open could behave the same way.
/continue is already used in while loops and there is no need to have a command like that,if you don't use /halt or /haltdef, mirc would consider it as a on *:close...


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: ability to halt an event.... [Re: Wims] #195697 29/02/08 03:15 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
but, the window will still close regardless.. check the topic in the script help


This is not the signature you are looking for
Re: ability to halt an event.... [Re: foshizzle] #195705 29/02/08 10:18 AM
Joined: Jul 2007
Posts: 32
S
Sh4d0w191 Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
You could just post a link to the topic .

Re: ability to halt an event.... [Re: Sh4d0w191] #195708 29/02/08 10:30 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Indeed, especially since his topic in Scripts&Popups has the unhelpful title why doesnt this work. Yet another instance of foshizzle not bothering with providing information...


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: ability to halt an event.... [Re: foshizzle] #195719 29/02/08 02:09 PM
Joined: Jul 2006
Posts: 3,568
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,568
Imo, this suggestion is nice, it could be really useful to stop window opening or closing.
At the end of the on close event, your window will be closed so you have to use timer in your code :

on *:CLOSE:@Warp: {
window -u @Warp
if ($input(Are you sure you want to quit?,wydv,Quit?) == $no) {
;here put an alias that re-open the window
;The problem is that you loose the window data
}
elseif ($hget(Warp)) { hfree Warp }
unset %w* %t* %star* %m* }
}

%variable can be /unset with only one command and unset %ticks after %t* is useless smile


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: ability to halt an event.... [Re: Wims] #195749 01/03/08 02:39 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
dont comment on my vars, because they are pre-defined grin .. note: this is an excerpt from a game im making

Last edited by foshizzle; 01/03/08 02:40 AM.

This is not the signature you are looking for