mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
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
Joined: Jul 2006
Posts: 4,185
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,185
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...


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
but, the window will still close regardless.. check the topic in the script help


This is not the signature you are looking for
Joined: Jul 2007
Posts: 32
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
You could just post a link to the topic ¬.¬

Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Jul 2006
Posts: 4,185
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,185
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
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

Link Copied to Clipboard