mIRC Homepage
Posted By: nataliad undo - 12/09/07 12:29 PM
hello

can you please make a script that with a hotkey (eg ctrl+z) will open the last closed window (query or channel mainly)

thanks
Posted By: Thrull Re: undo - 12/09/07 12:48 PM
Well, we can't hotkey anything to cntr-z using just Mirc. We'd need a dll for that.

Asside from that, someone can write a script that does what you want.

Here's a very quick script that allows you to do that if you hit Control-F2

Code:
on 1:Part:#: {
  if $nick == $me { %LastWin = $chan }
}

on 1:CLOSE:?:{
  %LastWin = $target 
}

Alias CF2 {
  if $chr(35) isin %LastWin { join %LastWin }
  elseif $chr(35) !isin %LastWin { query %Lastwin }
  else { echo -ag Sorry, I don't know which window you mean. }
}


The above works, but hasn't been tested very well. It also only works on channels and queries, not DCC sends, DCC gets, or DCC Chats.

You can load logs into the window as well, but that'd take a bit more scripting and I'm too tired to do it. this assumes you keep logs of course. smile
Posted By: nataliad Re: undo - 14/09/07 11:25 AM
I get this
Code:
* /query: insufficient parameters (line 849, script.ini)
Posted By: Thrull Re: undo - 14/09/07 12:51 PM
Worked fine for me. Did you open a query Window and then close it? If not, then the variable will be $null and you'll get the exact error you got.
Posted By: SladeKraven Re: undo - 14/09/07 01:16 PM
The code Thrull posted works fine for me too, here's a shortened code which does the exact same thing:


Code:
on me:*:Part:#: { %LastWin = $chan }
on *:CLOSE:?:{ %LastWin = $target }

alias CF2 {
  $iif(%LastWin,$iif(#* iswm %LastWin,join,query)) %LastWin
}
Posted By: RusselB Re: undo - 14/09/07 11:00 PM
Try putting the script into a new remote file.
© mIRC Discussion Forums