mIRC Homepage
Posted By: foshizzle ability to halt an event.... - 28/02/08 04:09 PM
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
Posted By: Wims Re: ability to halt an event.... - 28/02/08 06:42 PM
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...
Posted By: foshizzle Re: ability to halt an event.... - 29/02/08 03:15 AM
but, the window will still close regardless.. check the topic in the script help
Posted By: Sh4d0w191 Re: ability to halt an event.... - 29/02/08 10:18 AM
You could just post a link to the topic ¬.¬
Posted By: qwerty Re: ability to halt an event.... - 29/02/08 10:30 AM
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...
Posted By: Wims Re: ability to halt an event.... - 29/02/08 02:09 PM
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
Posted By: foshizzle Re: ability to halt an event.... - 01/03/08 02:39 AM
dont comment on my vars, because they are pre-defined grin .. note: this is an excerpt from a game im making
© mIRC Discussion Forums