mIRC Lock

By sercan386 on Feb 18, 2009

A full mIRC lock script. It can lock mIRC after a sudden time of idle-ness and when it's started.
Click right in a channel and then click lock settings to set it up.
The password is 1234 when you first use it. Remember to CHANGE IT! You can lock mirc up any time by clicking right in a channel and clicking "lock mIRC".
Note: This has been updated. This version is UNHALTABLE.

;;;;;;;;;;;;;;;
;;HELLO THERE;;
;;;;;;;;;;;;;;;
on *:input:*: {
  if ( $readini(lock.ini,main,lock) == 1 ) {
    .timerlock off 
    .timerlock -o 1 $readini(lock.ini,main,locktime) mirclock
  }
}
dialog MIRClock {
  title "mIRC Lock"
  size -1 -1 117 84
  option dbu
  button "OK", 1, 3 62 33 12, ok
  button "Close andLock", 2, 39 62 38 12, ok
  button "Cancel", 3, 79 62 32 11
  edit "OLDPASS", 4, 3 2 50 10, pass
  edit "NEWPASS", 5, 3 14 50 10, pass
  edit "TIME_BEFORE_LOCK", 6, 3 25 50 10
  check "Lock mIRC when idle", 7, 3 40 64 9
  text "Old password", 8, 57 2 50 9
  text "New password", 9, 57 14 50 8
  text "Idle time before lock", 10, 57 26 50 9
  check "Lock mIRC when started", 11, 3 50 69 9
  text "mIRC lock made by CAsercan3 AKA sercan386", 12, 3 77 112 8
  box "", 13, 1 34 73 27
  button "Reset", 14, 79 44 32 16
}

on *:dialog:mirclock:sclick:3: {
  dialog -x mirclock mirclock
}
alias locksettings {
  dialog -m mirclock mirclock
  if ( $readini(lock.ini,main,pass) == $null ) writeini lock.ini main pass $md5($md5(1234))
}
on *:dialog:mirclock:sclick:14: {
  did -r mirclock 4,5,6
  did -u mirclock 7,11
}
on *:dialog:mirclock:init:0: {
  did -ra mirclock 6 $readini(lock.ini,main,locktime)
  did -r mirclock 4,5
  did - $+ [ $iif($readini(lock.ini,main,lockstart) == 1,c,u) ] mirclock 11
  did - $+ [ $iif($readini(lock.ini,main,lock) == 1,c,u) ] mirclock 7
}
on *:dialog:mirclock:sclick:1: {
  if ( $md5($md5($did(mirclock,4))) != $readini(lock.ini,main,pass) ) halt
  if ( $did(mirclock,5) != $null ) writeini lock.ini main pass $md5($md5($did(mirclock,5)))
  writeini lock.ini main locktime $did(mirclock,6)
  writeini lock.ini main lock $did(mirclock,7).state
  writeini lock.ini main lockstart $did(mirclock,11).state
  dialog -x mirclock mirclock
}
on *:dialog:mirclock:sclick:2: {
  if ( $md5($md5($did(mirclock,4))) != $readini(lock.ini,main,pass) ) { noop $input(Dude! WRONG PASSWORD!!!,o,ERROR,ERROR,ERROR) | halt }
  if ( $did(mirclock,5) != $null ) writeini lock.ini main pass $md5($md5($did(mirclock,5)))
  if ( $did(mirclock,6) isnum ) writeini lock.ini main locktime $did(mirclock,6)
  else noop $input(Dude! the time in which the lock is activated must be only in NUMBERS!,o,ERROR,ERROR,ERROR)
  writeini lock.ini main lock $did(mirclock,7).state
  writeini lock.ini main lockstart $did(mirclock,11).state
  dialog -x mirclock mirclock
  mirclock
}
alias mirclock {
  :start
  if ( $readini(lock.ini,main,pass) == $null ) { writeini lock.ini main pass $md5($md5(1234)) | locksettings $input(ERROR ERROR ERROR!!! THE LOCK SETTINGS FILE CANNOT BE FOUND! REQUESTING IMMEDIATE SETUP!,owd,ERROR,ERROR,ERROR) }
  showmirc -n
  while $md5($md5($input(mIRC has been locked. Insert your password to unlock it.,wp,mIRC Lock))) != $readini(lock.ini,main,pass) {
    noop
  }
  halt
  :error
  mirclock2
}
alias mirclock2 mirclock
on *:START: {
  if ( $readini(lock.ini,main,lockstart) == 1 ) mirclock
  elseif ( $readini(lock.ini,main,lock) == 1 ) .timerlock -o 1 $readini(lock.ini,main,locktime) mirclock
}
menu channel,status {
  lock mIRC: mirclock
  lock settings: locksettings
}

Comments

Sign in to comment.
Savage_CL   -  Aug 09, 2013

Other than the time-lapse lock, this functionality is built into mIRC. hold control while minimizing, and to do so when starting, under other in options is lock.

 Respond  
eNkIL   -  Feb 12, 2010

how about 2 tries i think this will help a little bit

alias mirclock {
goto start
:start
; Next line checks to make sure the lock file hasn't been deleted.
if (!$isfile(C:\lock.ini)) { resetme | goto start }
if ($md5($md5($input(mIRC has been locked. Insert your password to unlock it.,wp,mIRC Lock))) != $readini(C:\lock.ini,main,pass)) goto start1
else halt
:start1
if (!$isfile(C:\lock.ini)) { resetme | goto start }
if ($md5($md5($input(Please try again!.,wp,mIRC Lock))) != $readini(C:\lock.ini,main,pass)) goto error
else halt
:error
noop $input(Wrong Password Closing mIRC,o,ERROR,ERROR,ERROR)
exit
halt
}

 Respond  
Keiro   -  Aug 27, 2009

Got an error:

  • /writeini: insufficient parameters (line 50, script15.mrc)
    ————————————————————

on *:dialog:mirclock:sclick:1: {
if ( $md5($md5($did(mirclock,4))) != $readini(lock.ini,main,pass) ) halt
if ( $did(mirclock,5) != $null ) writeini lock.ini main pass $md5($md5($did(mirclock,5)))
writeini lock.ini main locktime $did(mirclock,6)
writeini lock.ini main lock $did(mirclock,7).state
writeini lock.ini main lockstart $did(mirclock,11).state
dialog -x mirclock mirclock
}

Running Invision, on v6.35

 Respond  
SoxFarxAway777   -  Aug 23, 2009

A really nice option would be if you could script it to restrict unlock attempts after a certain amount of failed attempts. Like "You have failed to log in number amount of times, you can not log in for number minutes"

 Respond  
Zmodem   -  Feb 22, 2009

Nice! I like that you cannot halt it with the CTRL+Break. Very, very nice! :)

 Respond  
sercan386   -  Feb 21, 2009

i added some stuff, used input, and made it unhaltable by ctrl+break.

 Respond  
Blitzjager   -  Feb 20, 2009

Zmodem: LoL, yes, true, but doesn't $input() seem more professional? The box is formatted nicer, IMO.

I agree. :P

 Respond  
Firstmate   -  Feb 20, 2009

Good idea, and well scripted, but mIRC already has built-in locking features.

/help /showmirc

/showmirc -mnrstxopl

Manipulates the display of the main mIRC window, where -n = minimize, -r = restore, -s = show, -t = tray, -x = maximize, -o = on top, -p = not on top, -m = minimize according to tray settings.

The -l switch can be used with the -nt switches to lock mIRC.

Couple of things:
-Press control and click minimize IRC it locks and minimizes it.
-In the Options > Display > Options > Tray: Gives options on how mIRC should do on startup
-As well as Options > Other > Lock

 Respond  
Zmodem   -  Feb 20, 2009

LoL, yes, true, but doesn't $input() seem more professional? The box is formatted nicer, IMO.

 Respond  
Blitzjager   -  Feb 20, 2009

@zmodem - Could've just used $?*="" :P

 Respond  
Zmodem   -  Feb 20, 2009

Okay, added a few changes, especially on the actual lock. Instead of $?="", used $input(,wp,mIRC Lock) so that way when they enter a password it's passworded out, like *. Anyways, another change was checking to see if the lock was tampered with, by removing the .ini** file. If so, the default lock is put in place.

;;;;;;;;;;;;;;;
;;HELLO THERE;;
;;;;;;;;;;;;;;;
on *:input:*: {
  if ( $readini(C:\lock.ini,main,lock) == 1 ) {
    .timerlock off 
    .timerlock -o 1 $readini(C:\lock.ini,main,locktime) mirclock
  }
}
dialog MIRClock {
  title "mIRC Lock"
  size -1 -1 117 84
  option dbu
  button "OK", 1, 3 62 33 12, ok
  button "Close andLock", 2, 39 62 38 12, ok
  button "Cancel", 3, 79 62 32 11
  edit "OLDPASS", 4, 3 2 50 10, pass
  edit "NEWPASS", 5, 3 14 50 10, pass
  edit "TIME_BEFORE_LOCK", 6, 3 25 50 10
  check "Lock mIRC when idle", 7, 3 40 64 9
  text "Old password", 8, 57 2 50 9
  text "New password", 9, 57 14 50 8
  text "Idle time before lock", 10, 57 26 50 9
  check "Lock mIRC when started", 11, 3 50 69 9
  text "mIRC lock made by CAsercan3 AKA sercan386", 12, 3 77 112 8
  box "", 13, 1 34 73 27
  button "Reset", 14, 79 44 32 16
}

on *:dialog:mirclock:sclick:3: {
  dialog -x mirclock mirclock
}
alias locksettings {
  dialog -m mirclock mirclock
  if ( $readini(C:\lock.ini,main,pass) == $null ) writeini C:\lock.ini main pass $md5($md5(1234))
}
on *:dialog:mirclock:sclick:14: {
  did -r mirclock 4
  did -r mirclock 5
  did -r mirclock 6
  did -u mirclock 7
  did -u mirclock 11
}
on *:dialog:mirclock:init:0: {
  did -ra mirclock 6 $readini(C:\lock.ini,main,locktime)
  did -r mirclock 4
  did -r mirclock 5
  did - $+ [ $iif($readini(C:\lock.ini,main,lockstart) == 1,c,u) ] mirclock 11
  did - $+ [ $iif($readini(C:\lock.ini,main,lock) == 1,c,u) ] mirclock 7
}
on *:dialog:mirclock:sclick:1: {
  if ( $md5($md5($did(mirclock,4))) != $readini(C:\lock.ini,main,pass) ) halt
  if ( $did(mirclock,5) != $null ) writeini C:\lock.ini main pass $md5($md5($did(mirclock,5)))
  writeini C:\lock.ini main locktime $did(mirclock,6)
  writeini C:\lock.ini main lock $did(mirclock,7).state
  writeini C:\lock.ini main lockstart $did(mirclock,11).state
  dialog -x mirclock mirclock
}
on *:dialog:mirclock:sclick:2: {
  if ( $md5($md5($did(mirclock,4))) != $readini(C:\lock.ini,main,pass) ) { noop $input(Dude! WRONG PASSWORD!!!,o,ERROR,ERROR,ERROR) | halt }
  if ( $did(mirclock,5) != $null ) writeini C:\lock.ini main pass $md5($md5($did(mirclock,5)))
  if ( $did(mirclock,6) isnum ) writeini C:\lock.ini main locktime $did(mirclock,6)
  else noop $input(Dude! the time in which the lock is activated must be only in NUMBERS!,o,ERROR,ERROR,ERROR)
  writeini C:\lock.ini main lock $did(mirclock,7).state
  writeini C:\lock.ini main lockstart $did(mirclock,11).state
  dialog -x mirclock mirclock
  mirclock
}

;;; Resetme Alias
;;; - Added to reset to the default '1234' password
;;; if the original ini file is tampered with
alias resetme { writeini C:\lock.ini main pass $md5($md5(1234)) | writeini C:\lock.ini main lock 0 | writeini C:\lock.ini main lockstart 1 | .timerinput $+ $ctime 1 1 return $input(mIRC's lock has been tampered with. The default lock has been re-issued.,wo,Lock Tampered!) }
;;;

alias mirclock {
  goto start
  :start
  ; Next line checks to make sure the lock file hasn't been deleted.
  if (!$isfile(C:\lock.ini)) { resetme | goto start }
  if ($md5($md5($input(mIRC has been locked. Insert your password to unlock it.,wp,mIRC Lock))) != $readini(C:\lock.ini,main,pass)) goto start
  else halt
  :error
  goto start
}
on *:START: {
  ; Next line checks to make sure the lock file has not been deleted.
  if (!$isfile(C:\lock.ini)) { resetme | mirclock }
  if ( $readini(C:\lock.ini,main,lockstart) == 1 ) mirclock
  elseif ( $readini(C:\lock.ini,main,lock) == 1 ) .timerlock -o 1 $readini(C:\lock.ini,main,locktime) mirclock
}
menu channel,status {
  lock mIRC: mirclock
  lock settings: locksettings
}
 Respond  
Zmodem   -  Feb 20, 2009

sercan386: Yes, I've tried it. If you press it over and over again it just halts it, finally.

Oh, I also agree with AlienDK, it would be nice to have it 'minimize on lock' or something.

 Respond  
AlienDK   -  Feb 20, 2009

Very nice script! 8/10

EDIT: Make it possible to minimize mirc when its locked.

 Respond  
sercan386   -  Feb 20, 2009

ZModem have you tried the pause/break trick yet? i had added a protection against that already!!

 Respond  
Zmodem   -  Feb 19, 2009

This is actually cool, for people who aren't tech-savvy, this will actually come in handy. Of course the easiest way of disabling this is when it asks for a password, just hold CTRL and tap the Pause/Break key on your keyboard a couple of times and it will halt the script. Also, removing C:\lock.ini will also disable it.

However, as I've said, nice script!

 Respond  
sercan386   -  Feb 19, 2009

punktured, that old pass is there so mIRC can confirm it's you. otherwise your little brother could sneak in and disable the lock xD
but thanks for those tips i'll try it

 Respond  
PuNkTuReD   -  Feb 19, 2009

handy little snippet
my suggestions tho

-when i open it it doesnt show my old password(would be handy if it did, so i dont have to input it every time)
-when i input a wrong password it doesnt tell me ive input a wrong password

another 8/10 from me

edit:
the first goto start isnt needed

  goto start
  :start

and

  did -r mirclock 4
  did -r mirclock 5
  did -r mirclock 6
  did -u mirclock 7
  did -u mirclock 11

can be

  did -r mirclock 4,5,6
  did -u mirclock 7,11
 Respond  
Pepsi_Man0077   -  Feb 18, 2009

Wow, im impressed. Good job man. 8/10

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.