mIRC Homepage
Posted By: Hrung /lock command or something - 02/09/04 01:55 AM
I would like a way to make mirc minimize and lock with a command. This way, it would be possible to make it automatically lock within an auto-away script, for example. It might also be useful to have an option to always lock on minimize.
Posted By: NightCrawler8283 Re: /lock command or something - 02/09/04 02:15 AM
this is a great idea. kinda like window locking. and when u try to maximize or unlock it prompts for a password. something along those lines.

*Great Idea smile
Posted By: Sigh Re: /lock command or something - 02/09/04 08:48 AM
This would be a very useful feature, perhaps in the form of an extra /showmirc switch
Posted By: dr_Eamer Re: /lock command or something - 02/09/04 12:48 PM
It's cool!
I had once tried to code it myself with an alias. It minimized all windows and mIRC itself. Then it used $?* to ask for a password. The dialog won't let you do anything else while you're at it! Wrong password minimizes mIRC again. It was working quite well before I accidentally deleted it and abandoned the mini-project...

It would be really cool to have it!
Posted By: Coolkill Re: /lock command or something - 02/09/04 01:31 PM
You could use something, like this;

alias showmirc {
if (l isin $1) {
; Checks if 'l' switch isin $1 (mIRC uses, mnrstxop)
if ((!$2) && (!%md5p)) { echo -a ERROR: INSUFFICENT PARAMETERS | return }
; Checks if a passwd is already stored, if not, you need to specify one.
if ($2) { set %md5p $md5($2) }
; Stores your pass in variable %md5p, as an MD5, not plain-text
}
; ends if statement
!showmirc $+(-,$remove($1,-,l))
; performs default showmirc commands.
}

on 1:APPACTIVE:{
; triggers when appstate changes.
if ($appactive == $false) && ($window(-2).state == tray) { set %md5pr $true }
; if mIRC isnt active, and its state is 'in the tray' set a variable so we know.
elseif (($appactive == $true) && (%md5pr)) {
; otherwise, if mIRC is active, and %md5pr is true, then mIRC must have just
[/color]; returned from the tray
while (%md5imp != %md5p) {
; while %md5imp isnt the same as your stored password, keep looping.
var %md5imp = $md5($input("What is the Password?",poqga,Password Request))
; in the loop we set %md5imp to the password your asked to type in, if
[/color]; its wrong, loop again, and again, if not end loop.
}
; end of while loop
unset %md5pr
; unset the %md5pr so next time mIRC isnt active and isnt in the tray it wont
[/color]; ask for the pass
}
; end if statement
}


Syntax; i.e. /showmirc -t[color:red]l passwd[/color]

You just add the 'l' parameter, once you have specified a password once you dont need to include it ever again, unless you /unset it manually or wish to change the password.

Hope this helps.

Eamonn.
Posted By: dr_Eamer Re: /lock command or something - 02/09/04 02:37 PM
Seems cool!
I had the same ideas but without overriding showmirc (I used a custom alias).
I also minimized all windows (so that noone else could even see a portion of what you were doing). Pretty easy to add to what you wrote here.
In addition I'd put a cancel option to the password input box so that in minimizes mIRC again. In this way, if someone restored it by mistake and didn't know the password, he could minimize it again without problem.

I'm still too lazy to rewrite this even though it's just a minor addition to what you've already written...

It would still be great to have it built-in!
Perhaps there is a way around this we haven't thought of?
Posted By: Doqnach Re: /lock command or something - 03/09/04 12:16 PM
problem with doing this scriptwise is that it's to easely removed...
Posted By: Coolkill Re: /lock command or something - 03/09/04 12:18 PM
Very true, however it would need to be saved somewhere, by mIRC, and some kind of retrieval system if the password is lost, in which case, anyone can 'retrieve' the password.. so it'd take alot of workaround.

Eamonn.
© mIRC Discussion Forums