Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Simple temporary computer lock with password


  • Please log in to reply
6 replies to this topic
3V0Lu710N
  • Members
  • 11 posts
  • Last active: Mar 31 2013 03:08 PM
  • Joined: 25 Apr 2011
I mainly made this script for my laptop and computer because at home kids like to touch them and mess up things.

Ok what it does is it locks the mouse and requires a password to unlock
here are some pics. After typing the wrong password the script will automaticaly reload and after typing the correct password the script will end

1.
Posted Image

2.
Posted Image

#NoEnv  
SendMode Input  
SetWorkingDir %A_ScriptDir%  

Realpassword = 712151 ; This is the password for the script
BlockInput, MouseMove ; This blocks the mouse movement
InputBox, password, AHK Computer Lock, Computer and Mouse have been Locked`nEnter the password to Unlock`n, hide
IfInString, password, %Realpassword% ; Checks if the password is the same value as in the variable %Realpassword%
{
 Sleep, 200 ; Waits 200 miliseconds
  BlockInput, MouseMoveOff ; Unlocks the mouse after typing correct password
   Sleep, 100 ; Waits 100 miliseconds
    MsgBox, Computer has been unlocked.`nIf you tell the password to anyone it will end up being changed.
     ExitApp ; Closes the script if correct password is typed
}
else ; Otherwise
{
  Reload ; Reloads the script
}
+^!LButton::ExitApp ; Secret hotkey to close the script, shift+ctrl+alt + left click


  • Guests
  • Last active:
  • Joined: --
ctrl-alt-del, start task manager and kill autohotkey will defeat this

3V0Lu710N
  • Members
  • 11 posts
  • Last active: Mar 31 2013 03:08 PM
  • Joined: 25 Apr 2011

ctrl-alt-del, start task manager and kill autohotkey will defeat this


You didn't read the entire post did you?

Jake
  • Guests
  • Last active:
  • Joined: --
BlockInput, MouseMove ; This blocks the mouse movement

This doesn't mean that the arrow keys are blocked. Also, a regular lock of the computer works just as well.

rodfell
  • Members
  • 138 posts
  • Last active: Jun 26 2011 10:02 PM
  • Joined: 05 Oct 2007

You didn't read the entire post did you?


eh??
what part didn't i read

  • Guests
  • Last active:
  • Joined: --
IfInString, password, %Realpassword%
...this means they can type the password "example712151example" & it's still the "correct" password. The %Realpassword% is "InString" of the password they typed.

You should use...

if (password==realpassword)
...1) it tests if they are equal, not just "InString"...2) == instead of = means it's "case sensitive", so if the password wasn't just numbers, they'd need to get the case correct too.

Also, why Reload the script? That means the computer is "unlocked" for a second while the script is Exiting/Reloading. Remove the else & wrap a Loop around it...from the InputBox to the end of the if. Then it will ask again for the password, without Reloading. You could even put a 5-10 min Sleep in there (at the end of the Loop, on a failed password) so they can't try passwords quickly.

Cristi®
  • Members
  • 45 posts
  • Last active: Feb 13 2018 11:57 PM
  • Joined: 29 Nov 2007
maybe someone wants to take a look at my script http://www.autohotke...p=461310#461310
Posted Image