AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

block the computer from siblings

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
PeaceL
Guest





PostPosted: Sun Feb 15, 2009 2:41 am    Post subject: block the computer from siblings Reply with quote

when in a hurry, a simple double click will do the job

u can just copy paste the script and run it directly, its all explained:

###WARNING the answer is 379, if u want to try the script



***************************** START OF SCRIPT


Code:
Sleep, 2000

SetKeyDelay -1
SetMouseDelay -1

Run, notepad.exe
WinWait, Untitled - Notepad
WinMaximize

Send {Enter 4}{Space 50}{# 10}{Space}THE COMPUTER IS NOW BLOCKED{!}{!}{!}{Space}{# 10}{Enter 5}As you approach the door, you notice that someone has scrawled a message on it with a pencil:{Enter}{Enter}"BEWARE: One of the guards always tells the truth, one of them always lies, one of them alternates between the two,{Enter}{Enter}and one craves the taste of human flesh!" Ominous.{Enter}{Enter}Hesitantly, you push the door open and enter a small room.{Enter}{Enter}You find four guards seated at a round table, playing bridge.{Enter}{Enter}You grab your weapon and prepare for a fight, but they just look up at you and nod amicably.{Enter}{Enter}"Hello," says the guard playing North.{Enter}{Enter}"Er, hi," you say. "Um, don't mind me, I was just passing through."{Enter}{Enter}The guard playing South says, "I suppose you want the combination to the other door, then? I'm getting really tired of people asking about that."{Enter}{Enter}"He's lying," says North.{Enter}{Enter}"No," says East, "you're the one lying."{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}"Great," you sigh. "What's the code, then?"{Enter}{Enter}"Well," says South, "the first digit is 8."{Enter}{Enter}"No it isn't," says East. "It's 3."{Enter}{Enter}North shakes his head. "They're both lying -- it's 1."{Enter}{Enter}"The second digit now -- that's 7," says South.{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}"It's 4, in fact," says North.{Enter}{Enter}East grumbles, "It's definitely more than that."{Enter}{Enter}"Sorry, I meant to say 5," replies North. "And the last digit is 2."{Enter}{Enter}"Don't listen to him," says East. "It's 9."{Enter}{Enter}"No, it is 2, I'm sure of it," says South.{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}You roll your eyes. "Great. Thanks a lot, guys."{Enter 4}{Space 157}{Enter}{Space 32}Type in the 3 digit answer (using the numbers on top of the letters) to unlock the computer...{Space 31}{Enter}{Space 157}{Shift Down}{Left 475}{Shift Up}

MouseMove, 2000, 2000
Sleep, 50
MouseMove, 2001, 2000
Sleep, 50
Sleep, 1000


BlockInput, MouseMove

Loop
{
Input, s, L1, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{!}{#}{+}{^}{{}{}}{Enter}{Esc}{Space}{Tab}{BS}{Del}{Ins}{Up}{Down}{Left}{Right}{Home}{End}{PgUp}{PgDn}{CapsLock}{ScrollLock}{NumLock}{Ctrl}{LCtrl}{RCtrl}{Alt}{LAlt}{RAlt}{Shift}{LShift}{RShift}{LWin}{RWin}{AppsKey}{Sleep}{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}{NumpadDot}{NumpadEnter}{NumpadMult}{NumpadDiv}{NumpadAdd}{NumpadSub}{NumpadDel}{NumpadIns}{NumpadClear}{NumpadUp}{NumpadDown}{NumpadLeft}{NumpadRight}{NumpadHome}{NumpadEnd}{NumpadPgUp}{NumpadPgDn}{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}{Browser_Favorites}{Browser_Home}{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}{Media_Stop}{Media_Play_Pause}{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}{PrintScreen}{CtrlBreak}{Pause}
IfEqual, s, 3
   break
else
   Sleep, 0
}

Loop
{
Input, s, L1, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{!}{#}{+}{^}{{}{}}{Enter}{Esc}{Space}{Tab}{BS}{Del}{Ins}{Up}{Down}{Left}{Right}{Home}{End}{PgUp}{PgDn}{CapsLock}{ScrollLock}{NumLock}{Ctrl}{LCtrl}{RCtrl}{Alt}{LAlt}{RAlt}{Shift}{LShift}{RShift}{LWin}{RWin}{AppsKey}{Sleep}{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}{NumpadDot}{NumpadEnter}{NumpadMult}{NumpadDiv}{NumpadAdd}{NumpadSub}{NumpadDel}{NumpadIns}{NumpadClear}{NumpadUp}{NumpadDown}{NumpadLeft}{NumpadRight}{NumpadHome}{NumpadEnd}{NumpadPgUp}{NumpadPgDn}{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}{Browser_Favorites}{Browser_Home}{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}{Media_Stop}{Media_Play_Pause}{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}{PrintScreen}{CtrlBreak}{Pause}
IfEqual, s, 7
   break
else
   Sleep, 0
}

Loop
{
Input, s, L1, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{!}{#}{+}{^}{{}{}}{Enter}{Esc}{Space}{Tab}{BS}{Del}{Ins}{Up}{Down}{Left}{Right}{Home}{End}{PgUp}{PgDn}{CapsLock}{ScrollLock}{NumLock}{Ctrl}{LCtrl}{RCtrl}{Alt}{LAlt}{RAlt}{Shift}{LShift}{RShift}{LWin}{RWin}{AppsKey}{Sleep}{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}{NumpadDot}{NumpadEnter}{NumpadMult}{NumpadDiv}{NumpadAdd}{NumpadSub}{NumpadDel}{NumpadIns}{NumpadClear}{NumpadUp}{NumpadDown}{NumpadLeft}{NumpadRight}{NumpadHome}{NumpadEnd}{NumpadPgUp}{NumpadPgDn}{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}{Browser_Favorites}{Browser_Home}{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}{Media_Stop}{Media_Play_Pause}{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}{PrintScreen}{CtrlBreak}{Pause}
IfEqual, s, 9
   break
else
   Sleep, 0
}

BlockInput, MouseMoveOff

ExitApp



***************************** END



of course, any feedback on these long lines is welcome Very Happy
Back to top
PeaceL
Guest





PostPosted: Sun Feb 15, 2009 2:43 am    Post subject: forgot Reply with quote

it looks good in 1280x1024, i dont know about smaller sizes....
Back to top
james062



Joined: 05 Oct 2009
Posts: 66
Location: southampton UK

PostPosted: Thu Oct 08, 2009 6:51 pm    Post subject: Reply with quote

Laughing VERY NICE , This will keep the kids of pc , Thanks
_________________
All`s well that ends well Smile
I will not appreciate sarcastic or personal insults in reply s to my posts . Those are the acts of cowards being brave from afar .If you cant be productive don't be destructive .
Back to top
View user's profile Send private message MSN Messenger
Jex



Joined: 01 Aug 2008
Posts: 101

PostPosted: Fri Oct 09, 2009 3:21 am    Post subject: Reply with quote

if you had it check all input at once it would be harder to get into, instead of 1 key at a time... the current method could be spammed with keys, and as long as i press the keys 379 in that order, with any keys in between i would unlock it.


Code:
Input, s, L3,

and then
Code:
IfEqual, s, 379


You don't want the cat to unlock your computer Smile
_________________
Woot.

Please read forum etiquette
Back to top
View user's profile Send private message
james062



Joined: 05 Oct 2009
Posts: 66
Location: southampton UK

PostPosted: Fri Oct 09, 2009 6:39 pm    Post subject: Strugling Reply with quote

NOPE Cant get it right , Keep locking myself out of my PC LOL
Please post the complete script with the above changes so I can see how its done please . Tired of restarting my pc . lol . It works if I enter the 379 first time , but when I try other keys first , I get locked out completely and 379 don't work any more .
Thanks
_________________
All`s well that ends well Smile
I will not appreciate sarcastic or personal insults in reply s to my posts . Those are the acts of cowards being brave from afar .If you cant be productive don't be destructive .
Back to top
View user's profile Send private message MSN Messenger
Jex



Joined: 01 Aug 2008
Posts: 101

PostPosted: Sun Oct 11, 2009 8:24 pm    Post subject: Reply with quote

here's the full example...i havn't tested it.

Code:
Sleep, 2000

SetKeyDelay -1
SetMouseDelay -1

Run, notepad.exe
WinWait, Untitled - Notepad
WinMaximize

Send {Enter 4}{Space 50}{# 10}{Space}THE COMPUTER IS NOW BLOCKED{!}{!}{!}{Space}{# 10}{Enter 5}As you approach the door, you notice that someone has scrawled a message on it with a pencil:{Enter}{Enter}"BEWARE: One of the guards always tells the truth, one of them always lies, one of them alternates between the two,{Enter}{Enter}and one craves the taste of human flesh!" Ominous.{Enter}{Enter}Hesitantly, you push the door open and enter a small room.{Enter}{Enter}You find four guards seated at a round table, playing bridge.{Enter}{Enter}You grab your weapon and prepare for a fight, but they just look up at you and nod amicably.{Enter}{Enter}"Hello," says the guard playing North.{Enter}{Enter}"Er, hi," you say. "Um, don't mind me, I was just passing through."{Enter}{Enter}The guard playing South says, "I suppose you want the combination to the other door, then? I'm getting really tired of people asking about that."{Enter}{Enter}"He's lying," says North.{Enter}{Enter}"No," says East, "you're the one lying."{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}"Great," you sigh. "What's the code, then?"{Enter}{Enter}"Well," says South, "the first digit is 8."{Enter}{Enter}"No it isn't," says East. "It's 3."{Enter}{Enter}North shakes his head. "They're both lying -- it's 1."{Enter}{Enter}"The second digit now -- that's 7," says South.{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}"It's 4, in fact," says North.{Enter}{Enter}East grumbles, "It's definitely more than that."{Enter}{Enter}"Sorry, I meant to say 5," replies North. "And the last digit is 2."{Enter}{Enter}"Don't listen to him," says East. "It's 9."{Enter}{Enter}"No, it is 2, I'm sure of it," says South.{Enter}{Enter}"Graaaaagh," says West.{Enter}{Enter}You roll your eyes. "Great. Thanks a lot, guys."{Enter 4}{Space 157}{Enter}{Space 32}Type in the 3 digit answer (using the numbers on top of the letters) to unlock the computer...{Space 31}{Enter}{Space 157}{Shift Down}{Left 475}{Shift Up}

MouseMove, 2000, 2000
Sleep, 50
MouseMove, 2001, 2000
Sleep, 50
Sleep, 1000


BlockInput, MouseMove

Loop
{
;here --\/
Input, s, L3, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{!}{#}{+}{^}{{}{}}{Enter}{Esc}{Space}{Tab}{BS}{Del}{Ins}{Up}{Down}{Left}{Right}{Home}{End}{PgUp}{PgDn}{CapsLock}{ScrollLock}{NumLock}{Ctrl}{LCtrl}{RCtrl}{Alt}{LAlt}{RAlt}{Shift}{LShift}{RShift}{LWin}{RWin}{AppsKey}{Sleep}{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}{NumpadDot}{NumpadEnter}{NumpadMult}{NumpadDiv}{NumpadAdd}{NumpadSub}{NumpadDel}{NumpadIns}{NumpadClear}{NumpadUp}{NumpadDown}{NumpadLeft}{NumpadRight}{NumpadHome}{NumpadEnd}{NumpadPgUp}{NumpadPgDn}{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}{Browser_Favorites}{Browser_Home}{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}{Media_Stop}{Media_Play_Pause}{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}{PrintScreen}{CtrlBreak}{Pause}

;here--\/
IfEqual, s, 379
   break
else
   Sleep, 0
}



BlockInput, MouseMoveOff

ExitApp

+Esc::
   ExitApp


I've included Shift-Escape as a close key so you don't need to restart everytime you get locked out.

One of the few downsides with this method is that if you type a single character, and then forget you need to retry a few times so that you can get the whole string in properly.

ex:
Typed: 037 937 903 790 379
String: 037|937|903|790|379

To get around this you could increase the size of the keys captured and then look at using IfContains and not IfEquals.
_________________
Woot.

Please read forum etiquette
Back to top
View user's profile Send private message
MasterFocus



Joined: 08 Apr 2009
Posts: 3035
Location: Rio de Janeiro - RJ - Brasil

PostPosted: Tue Oct 13, 2009 9:01 pm    Post subject: Reply with quote

Wouldn't a hotstring do the job? (untested)
Code:
; autoexec stuff ...
; autoexec stuff ...
Return

:?*:379:  ;  <-- whatever you "code" is
; Insert "BlockInput Off" and ExitApp and whatever here

_________________
"Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried.
"

Antonio França
My stuff: Google Profile
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group