Sign in to follow this  
Followers 0
Skrip

Another Computer lock program

16 posts in this topic

#1 ·  Posted (edited)

The password is 1-2-5-7-9

It goes over your whole screen, blocks everything until you input the password. Please save it in it's own directory so it can write logs, and you can view them easily. It's an update from my old version. Pretty sure there are no errors :D . Please test and comment :wacko:

Code in post #10
Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ERROR: syntax error
        If $pass = 0 or 1 or 2 or 3 or 4 or Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

ERROR: $WS_CLIPSIBLINGS previously declared as a 'Const'
If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Ran with beta. I let it run with the errors and it still works. :D

Edited by Somniis

Share this post


Link to post
Share on other sites

Weird I don't get that error...

but you can remove this

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

ERROR: syntax error
        If $pass = 0 or 1 or 2 or 3 or 4 or Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

ERROR: $WS_CLIPSIBLINGS previously declared as a 'Const'
If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Ran with beta. I let it run with the errors and it still works. :D

Weird I don't get that error...

but you can remove this

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000
The correct syntax:
If $pass = 0 Or $pass = 1 Or $pass = 3 Or $pass = 4 Then

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

oh ok, i'll fix that.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Shouldn't the pass reset if you get it wrong?

Func a7()
    IF $pass = 3 Then
        $pass = 4
    Else
        $pass = 0
    EndIf
EndFunc
Instead of:
Func a7()
    IF $pass = 3 Then
        $pass = 4
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Yes it should, i'll edit it later...i've been up for like 24 hours...i'm tired.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

pretty nice concept :D

but taskmanager solves this lock.

insert this code in the loop:

If ProcessExists("taskmgr.exe") Then
     ProcessClose("taskmgr.exe")
EndIf

If not WinActive("Password") Then
     WinActivate("Password")
EndIf

Share this post


Link to post
Share on other sites

It was added in...Well...almost. Look at the last func, i'll change it now.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Update:

Images are in this .rar file, the script in it is old though.

http://www.autoitscript.com/forum/index.ph...c=29610&hl=

It's in that thread. Post #1

Extract them to the same dir as this script

#region -Hotkeys
HotKeySet("1", "a1")
HotKeySet("2", "a2")
HotKeySet("3", "a3")
HotKeySet("4", "a4")
HotKeySet("5", "a5")
HotKeySet("6", "a6")
HotKeySet("7", "a7")
HotKeySet("8", "a8")
HotKeySet("9", "a9")
HotKeySet("{ENTER}", "enter_h")
#endregion -Hotkeys
AdlibEnable("secure")
#region --- GuiBuilder code Start ---
SoundPlay("C:\Windows\media\chord.wav")
#NoTrayIcon
; Script generated by AutoBuilder 0.5 Prototype
#include <File.au3>
#include <GuiConstants.au3>
#include <date.au3>
;~ FileInstall(@ScriptDir & "\images\1.bmp", @ScriptDir & "\images\1.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\2.bmp", @ScriptDir & "\images\2.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\3.bmp", @ScriptDir & "\images\3.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\4.bmp", @ScriptDir & "\images\4.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\5.bmp", @ScriptDir & "\images\5.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\6.bmp", @ScriptDir & "\images\6.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\7.bmp", @ScriptDir & "\images\7.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\8.bmp", @ScriptDir & "\images\8.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\9.bmp", @ScriptDir & "\images\9.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\enter.bmp", @ScriptDir & "\images\enter.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\shutdown.bmp", @ScriptDir & "\images\shutdown.bmp", 1)
;~ FileInstall(@ScriptDir & "\images\clear.bmp", @ScriptDir & "\images\clear.bmp", 1)
$returnvalue = _DateDayOfWeek(@WDAY, 0 )
_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "-------------------")
_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "---Script Activated " & $returnvalue)
_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "-------------------")
_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
AutoItSetOption("GUIResizeMode", 0)
If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("Password", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
Dim $ATTEMPT = 0
$shut = GUICtrlCreateButton("Shutdown", 550, 360, 100, 30, $BS_BITMAP)
$label = GUICtrlCreateLabel("Please enter security password for this computer.", 490, 400)
$Button_1 = GuiCtrlCreateButton("1", 540, 430, 40, 40, $BS_ICON)
$Button_2 = GuiCtrlCreateButton("2", 580, 430, 40, 40, $BS_ICON)
$Button_3 = GuiCtrlCreateButton("3", 620, 430, 40, 40, $BS_ICON)
$Button_4 = GuiCtrlCreateButton("4", 540, 470, 40, 40, $BS_ICON)
$Button_5 = GuiCtrlCreateButton("5", 580, 470, 40, 40, $BS_ICON)
$Button_6 = GuiCtrlCreateButton("6", 620, 470, 40, 40, $BS_ICON)
$Button_7 = GuiCtrlCreateButton("7", 540, 510, 40, 40, $BS_ICON)
$Button_8 = GuiCtrlCreateButton("8", 580, 510, 40, 40, $BS_ICON)
$Button_9 = GuiCtrlCreateButton("9", 620, 510, 40, 40, $BS_ICON)
$Button_10 = GuiCtrlCreateButton("Enter", 540, 550, 120, 30, $BS_BITMAP)
$Date_1 = GuiCtrlCreateDate("Date1", 510, 330, 190, 20)
$pass = 0
$pass2 = 0
$shutdown = 1
GUISetBkColor(0x000000)
WinActivate("Password")
GuiSetState()

GUICtrlSetImage($Button_1, @ScriptDir & "\images\1.bmp")
GUICtrlSetImage($Button_2, @ScriptDir & "\images\2.bmp")
GUICtrlSetImage($Button_3, @ScriptDir & "\images\3.bmp")
GUICtrlSetImage($Button_4, @ScriptDir & "\images\4.bmp")
GUICtrlSetImage($Button_5, @ScriptDir & "\images\5.bmp")
GUICtrlSetImage($Button_6, @ScriptDir & "\images\6.bmp")
GUICtrlSetImage($Button_7, @ScriptDir & "\images\7.bmp")
GUICtrlSetImage($Button_8, @ScriptDir & "\images\8.bmp")
GUICtrlSetImage($Button_9, @ScriptDir & "\images\9.bmp")
GUICtrlSetImage($shut, @ScriptDir & "\images\shutdown.bmp")
GUICtrlSetImage($Button_10, @ScriptDir & "\images\enter.bmp")

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $shut ;shutdown button
        If $shutdown = 1 Then ; only activates once with this added!
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "--Shutdown Key Pressed--" & $ATTEMPT & " -" & $returnvalue)
            GUICtrlSetImage($Button_1, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_2, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_3, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_4, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_5, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_6, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_7, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_8, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_9, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($shut, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_10, @ScriptDir & "\images\clear.bmp")
            GUISetBkColor(0x27408B)
            Sleep(100)
            GUISetBkColor(0x3A5FCD)
            Sleep(100)
            GUISetBkColor(0x436EEE)
            Sleep(100)
            GUISetBkColor(0x4876FF)
            Sleep(100)
            GUISetBkColor(0xffffff)
            Sleep(100)
            GUISetBkColor(0x000000)
            Sleep(1600)
            $shutdown = 0
            Shutdown(13)
        EndIf
    
    Case $msg =  $Button_1
        If $pass = 0 Then
            $pass = 1
        Else
        $pass = 0
        EndIf
    Case $msg = $Button_2
        If $pass = 1 Then
            $pass = 2
        Else
        $pass = 0
        EndIf
    Case $msg = $Button_3
        $pass = 0
    Case $msg = $Button_4
        $pass = 0
    Case $msg = $Button_5
        IF $pass = 2 Then
            $pass = 3
        Else
        $pass = 0
        EndIf
    Case $msg = $Button_6
        $pass = 0
    Case $msg = $Button_7
        IF $pass = 3 Then
            $pass = 4
        Else
        $pass = 0
        EndIf
    Case $msg = $Button_8
        $pass = 0
    Case $msg = $Button_9
        IF $pass = 4 Then
            $pass = 5
        Else
        $pass = 0
        EndIf
    Case $msg = $Button_10; Code -- pass = 5 ;; 1-2-5-7-9
        ; -- ENTER KEY --
        If $pass = 5 Then
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*_-=Pass Accepted=-_* " & $ATTEMPT & " -" & $returnvalue)
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
            SoundPlay("C:\Windows\media\tada.wav")
            GUISetBkColor(0xffffff)
            GUICtrlSetImage($Button_1, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_2, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_3, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_4, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_5, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_6, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_7, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_8, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_9, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($shut, @ScriptDir & "\images\clear.bmp")
            GUICtrlSetImage($Button_10, @ScriptDir & "\images\clear.bmp")
            Sleep(1200)
            Exit
        EndIf
        If $pass = 0 or 1 or 2 or 3 or 4 Then
            $ATTEMPT = $ATTEMPT + 1
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass *** " & $ATTEMPT & " -" & $returnvalue)
            SoundPlay("C:\Windows\media\Windows XP Error.wav")
        EndIf
        
        $pass = 0
        $ATTEMPT = $ATTEMPT + 1
        _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass ***  " & $ATTEMPT & " -" & $returnvalue)
            WinActivate("Password")
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

#region -Shutdown funcs
;;; Text toggles 1-9-enter for the shutdown button
Func GetToggle1($stext)
if $stext = "1" then
return " "
else
return "1"
endif
endfunc
Func GetToggle2($stext)
if $stext = "2" then
return " "
else
return "2"
endif
endfunc
Func GetToggle3($stext)
if $stext = "3" then
return " "
else
return "3"
endif
endfunc
Func GetToggle4($stext)
if $stext = "4" then
return " "
else
return "4"
endif
endfunc
Func GetToggle5($stext)
if $stext = "5" then
return " "
else
return "5"
endif
endfunc
Func GetToggle6($stext)
if $stext = "6" then
return " "
else
return "6"
endif
endfunc
Func GetToggle7($stext)
if $stext = "7" then
return " "
else
return "7"
endif
endfunc
Func GetToggle8($stext)
if $stext = "8" then
return " "
else
return "8"
endif
endfunc
Func GetToggle9($stext)
if $stext = "9" then
return " "
else
return "9"
endif
endfunc
Func GetToggle10($stext)
if $stext = "Enter" then
return "Shuting Down..."
else
return "Enter"
endif
endfunc
Func GetToggle11($stext)
if $stext = "Shutdown" then
return "Denied! This button has been pressed."
else
return "Shutdown"
endif
endfunc
#endregion -Shutdown funcs

#region -HotKey Funcs
Func a1()
    If $pass = 0 Then
        $pass = 1
    Else
        $pass = 0
    EndIf
EndFunc
Func a2()
    If $pass = 1 Then
        $pass = 2
    Else
        $pass = 0
    EndIf
EndFunc
Func a3()
    $pass = 0
EndFunc
Func a4()
    $pass = 0
EndFunc
func a5()
    IF $pass = 2 Then
        $pass = 3
    Else
        $pass = 0
    EndIf
EndFunc
Func a6()
    $pass = 0
EndFunc
Func a7()
    IF $pass = 3 Then
        $pass = 4
    Else
        $pass = 0
    EndIf
EndFunc
Func a8()
    $pass = 0
EndFunc
Func a9()
    IF $pass = 4 Then
        $pass = 5
    Else
        $pass = 0
    EndIf
EndFunc
Func enter_h()
        ; -- ENTER KEY --
        If $pass = 5 Then
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*_-=Pass Accepted=-_* -HotKeyused- " & $ATTEMPT & " -" & $returnvalue)
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")
            SoundPlay("C:\Windows\media\tada.wav")
            GUISetBkColor(0xffffff)
            Sleep(1200)
            Exit
        EndIf
        If $pass = 0 or 1 or 2 or 3 or 4 or Then
            $ATTEMPT = $ATTEMPT + 1
            _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass ***-HotKeyused-  " & $ATTEMPT & " -" & $returnvalue)
            SoundPlay("C:\Windows\media\Windows XP Error.wav")
        EndIf
        $pass = 0
        $ATTEMPT = $ATTEMPT + 1
        _FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass ***-HotKeyused-   " & $ATTEMPT & " -" & $returnvalue)
EndFunc
#endregion -HotKey Funcs

#region -Misc. Funcs
Func SECURE()
    If ProcessExists("taskmgr.exe") Then
        ProcessClose("taskmgr.exe")
    EndIf

    If not WinActive("Password") Then
        WinActivate("Password")
    EndIf
EndFunc  ;==>SECURE
#endregion -Misc. Funcs

;~ Func OnAutoItExit()
;~  FileDelete(@ScriptDir & "\images\1.bmp")
;~  FileDelete(@ScriptDir & "\images\2.bmp")
;~  FileDelete(@ScriptDir & "\images\3.bmp")
;~  FileDelete(@ScriptDir & "\images\4.bmp")
;~  FileDelete(@ScriptDir & "\images\5.bmp")
;~  FileDelete(@ScriptDir & "\images\6.bmp")
;~  FileDelete(@ScriptDir & "\images\7.bmp")
;~  FileDelete(@ScriptDir & "\images\8.bmp")
;~  FileDelete(@ScriptDir & "\images\9.bmp")
;~  FileDelete(@ScriptDir & "\images\enter.bmp")
;~  FileDelete(@ScriptDir & "\images\shutdown.bmp")
;~  FileDelete(@ScriptDir & "\images\clear.bmp")
;~ EndFunc

Edited by Firestorm

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

You still haven't fixed the errors, and arrays would be much nicer... I didn't go through the whole thing because I started going blind staring at $pass

CODE
#region -Hotkeys

For $i = 1 To 9

HotKeySet($i, "a"&$i)

Next

HotKeySet("{ENTER}", "enter_h")

#endregion -Hotkeys

AdlibEnable("secure")

#region --- GuiBuilder code Start ---

SoundPlay("C:\Windows\media\chord.wav")

#NoTrayIcon

; Script generated by AutoBuilder 0.5 Prototype

#include <File.au3>

#include <GuiConstants.au3>

#include <date.au3>

;~ FileInstall(@ScriptDir & "\images\1.bmp", @ScriptDir & "\images\1.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\2.bmp", @ScriptDir & "\images\2.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\3.bmp", @ScriptDir & "\images\3.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\4.bmp", @ScriptDir & "\images\4.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\5.bmp", @ScriptDir & "\images\5.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\6.bmp", @ScriptDir & "\images\6.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\7.bmp", @ScriptDir & "\images\7.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\8.bmp", @ScriptDir & "\images\8.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\9.bmp", @ScriptDir & "\images\9.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\enter.bmp", @ScriptDir & "\images\enter.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\shutdown.bmp", @ScriptDir & "\images\shutdown.bmp", 1)

;~ FileInstall(@ScriptDir & "\images\clear.bmp", @ScriptDir & "\images\clear.bmp", 1)

$returnvalue = _DateDayOfWeek(@WDAY, 0 )

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "-------------------")

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "---Script Activated " & $returnvalue)

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "-------------------")

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

AutoItSetOption("GUIResizeMode", 0)

Global $Button[11]

GUICreate("Password", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)

Dim $ATTEMPT = 0

$shut = GUICtrlCreateButton("Shutdown", 550, 360, 100, 30, $BS_BITMAP)

$label = GUICtrlCreateLabel("Please enter security password for this computer.", 490, 400)

For $i = 1 To 9

$Button[$i] = GUICtrlCreateButton($i, 540 + (($i - 1) * 40), 430, 40, 40, $BS_ICON)

GUICtrlSetImage($Button[1], @ScriptDir & "\images\" & $i & ".bmp")

Next

$Button[10] = GUICtrlCreateButton("Enter", 540, 550, 120, 30, $BS_BITMAP)

$Date_1 = GUICtrlCreateDate("Date1", 510, 330, 190, 20)

$pass = 0

$pass2 = 0

$shutdown = 1

GUISetBkColor(0x000000)

WinActivate("Password")

GUICtrlSetImage($shut, @ScriptDir & "\images\shutdown.bmp")

GUICtrlSetImage($Button[10], @ScriptDir & "\images\enter.bmp")

GUISetState()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $shut ;shutdown button

If $shutdown = 1 Then ; only activates once with this added!

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "--Shutdown Key Pressed--" & $ATTEMPT & " -" & $returnvalue)

For $i = 1 To 10

GUICtrlSetImage($Button[$i], @ScriptDir & "\images\clear.bmp")

Next

GUICtrlSetImage($shut, @ScriptDir & "\images\clear.bmp")

Local $iColors[6] = [0x27408B,0x3A5FCD,0x436EEE,0x4876FF,0xffffff,0x000000]

For $i = 0 To 6

GUISetBkColor($iColors[$i])

Sleep(100)

Next

GUISetBkColor(0x000000)

Sleep(1600)

$shutdown = 0

Shutdown(13)

EndIf

Case $msg = $Button[1]

If $pass = 0 Then

$pass = 1

Else

$pass = 0

EndIf

Case $msg = $Button[2]

If $pass = 1 Then

$pass = 2

Else

$pass = 0

EndIf

Case $msg = $Button[3]

$pass = 0

Case $msg = $Button[4]

$pass = 0

Case $msg = $Button[5]

If $pass = 2 Then

$pass = 3

Else

$pass = 0

EndIf

Case $msg = $Button[6]

$pass = 0

Case $msg = $Button[7]

If $pass = 3 Then

$pass = 4

Else

$pass = 0

EndIf

Case $msg = $Button[8]

$pass = 0

Case $msg = $Button[9]

If $pass = 4 Then

$pass = 5

Else

$pass = 0

EndIf

Case $msg = $Button[10]; Code -- pass = 5 ;; 1-2-5-7-9

; -- ENTER KEY --

If $pass = 5 Then

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*_-=Pass Accepted=-_* " & $ATTEMPT & " -" & $returnvalue)

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

SoundPlay("C:\Windows\media\tada.wav")

GUISetBkColor(0xffffff)

For $i = 1 To 10

GUICtrlSetImage($Button[$i], @ScriptDir & "\images\clear.bmp")

Next

GUICtrlSetImage($shut, @ScriptDir & "\images\clear.bmp")

Sleep(1200)

Exit

EndIf

If $pass = 0 Or 1 Or 2 Or 3 Or 4 Then

$ATTEMPT = $ATTEMPT + 1

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass *** " & $ATTEMPT & " -" & $returnvalue)

SoundPlay("C:\Windows\media\Windows XP Error.wav")

EndIf

$pass = 0

$ATTEMPT = $ATTEMPT + 1

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass *** " & $ATTEMPT & " -" & $returnvalue)

WinActivate("Password")

EndSelect

WEnd

Exit

#endregion --- GuiBuilder generated code End ---

#region -Shutdown funcs

;;; Text toggles 1-9-enter for the shutdown button

Func GetToggle1($stext)

If $stext = "1" Then

Return " "

Else

Return "1"

EndIf

EndFunc ;==>GetToggle1

Func GetToggle2($stext)

If $stext = "2" Then

Return " "

Else

Return "2"

EndIf

EndFunc ;==>GetToggle2

Func GetToggle3($stext)

If $stext = "3" Then

Return " "

Else

Return "3"

EndIf

EndFunc ;==>GetToggle3

Func GetToggle4($stext)

If $stext = "4" Then

Return " "

Else

Return "4"

EndIf

EndFunc ;==>GetToggle4

Func GetToggle5($stext)

If $stext = "5" Then

Return " "

Else

Return "5"

EndIf

EndFunc ;==>GetToggle5

Func GetToggle6($stext)

If $stext = "6" Then

Return " "

Else

Return "6"

EndIf

EndFunc ;==>GetToggle6

Func GetToggle7($stext)

If $stext = "7" Then

Return " "

Else

Return "7"

EndIf

EndFunc ;==>GetToggle7

Func GetToggle8($stext)

If $stext = "8" Then

Return " "

Else

Return "8"

EndIf

EndFunc ;==>GetToggle8

Func GetToggle9($stext)

If $stext = "9" Then

Return " "

Else

Return "9"

EndIf

EndFunc ;==>GetToggle9

Func GetToggle10($stext)

If $stext = "Enter" Then

Return "Shuting Down..."

Else

Return "Enter"

EndIf

EndFunc ;==>GetToggle10

Func GetToggle11($stext)

If $stext = "Shutdown" Then

Return "Denied! This button has been pressed."

Else

Return "Shutdown"

EndIf

EndFunc ;==>GetToggle11

#endregion -Shutdown funcs

#region -HotKey Funcs

Func a1()

If $pass = 0 Then

$pass = 1

Else

$pass = 0

EndIf

EndFunc ;==>a1

Func a2()

If $pass = 1 Then

$pass = 2

Else

$pass = 0

EndIf

EndFunc ;==>a2

Func a3()

$pass = 0

EndFunc ;==>a3

Func a4()

$pass = 0

EndFunc ;==>a4

Func a5()

If $pass = 2 Then

$pass = 3

Else

$pass = 0

EndIf

EndFunc ;==>a5

Func a6()

$pass = 0

EndFunc ;==>a6

Func a7()

If $pass = 3 Then

$pass = 4

Else

$pass = 0

EndIf

EndFunc ;==>a7

Func a8()

$pass = 0

EndFunc ;==>a8

Func a9()

If $pass = 4 Then

$pass = 5

Else

$pass = 0

EndIf

EndFunc ;==>a9

Func enter_h()

; -- ENTER KEY --

If $pass = 5 Then

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*_-=Pass Accepted=-_* -HotKeyused- " & $ATTEMPT & " -" & $returnvalue)

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", " ")

SoundPlay("C:\Windows\media\tada.wav")

GUISetBkColor(0xffffff)

Sleep(1200)

Exit

EndIf

If $pass = 0 Or $pass = 1 Or $pass = 2 Or $pass = 3 Or $pass = 4 Then

$ATTEMPT = $ATTEMPT + 1

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass ***-HotKeyused- " & $ATTEMPT & " -" & $returnvalue)

SoundPlay("C:\Windows\media\Windows XP Error.wav")

EndIf

$pass = 0

$ATTEMPT = $ATTEMPT + 1

_FileWriteLog(@ScriptDir & "\Logs\Log_Pass.dat", "*** Invalid Pass ***-HotKeyused- " & $ATTEMPT & " -" & $returnvalue)

EndFunc ;==>enter_h

#endregion -HotKey Funcs

#region -Misc. Funcs

Func SECURE()

If ProcessExists("taskmgr.exe") Then

ProcessClose("taskmgr.exe")

EndIf

If Not WinActive("Password") Then

WinActivate("Password")

EndIf

EndFunc ;==>SECURE

#endregion -Misc. Funcs

;~ Func OnAutoItExit()

;~ FileDelete(@ScriptDir & "\images\1.bmp")

;~ FileDelete(@ScriptDir & "\images\2.bmp")

;~ FileDelete(@ScriptDir & "\images\3.bmp")

;~ FileDelete(@ScriptDir & "\images\4.bmp")

;~ FileDelete(@ScriptDir & "\images\5.bmp")

;~ FileDelete(@ScriptDir & "\images\6.bmp")

;~ FileDelete(@ScriptDir & "\images\7.bmp")

;~ FileDelete(@ScriptDir & "\images\8.bmp")

;~ FileDelete(@ScriptDir & "\images\9.bmp")

;~ FileDelete(@ScriptDir & "\images\enter.bmp")

;~ FileDelete(@ScriptDir & "\images\shutdown.bmp")

;~ FileDelete(@ScriptDir & "\images\clear.bmp")

;~ EndFunc

The arrays I did do took off 50 lines of code and is actually easier to manage if you ask me... You might want to see what you can do with the rest of them.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

works well... but if i hit the escape key i get my desktop back.

Share this post


Link to post
Share on other sites

Hmm i dunna why, can anybody figure that out?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hmm i dunna why, can anybody figure that out?

insert

AutoItSetOption("GUICloseOnESC", 0)

and it wont close itself anymore when ESC is pressed :whistle:

edit: i made a similiar lock program:

The Code is 1-3-3-7

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
Opt("TrayIconHide", 1)
Opt("GUICloseOnESC", 0)

Global $security_code = "1337"
Global $entered_code = ""

HotkeySet("{NUMPAD1}", "_one")
HotkeySet("{NUMPAD2}", "_two")
HotkeySet("{NUMPAD3}", "_three")
HotkeySet("{NUMPAD4}", "_four")
HotkeySet("{NUMPAD5}", "_five")
HotkeySet("{NUMPAD6}", "_six")
HotkeySet("{NUMPAD7}", "_seven")
HotkeySet("{NUMPAD8}", "_eight")
HotkeySet("{NUMPAD9}", "_nine")
HotkeySet("{ENTER}", "_verify")
HotkeySet("{BACKSPACE}", "_reset")

$gui = GUICreate("Lock", @DesktopWidth, @DesktopHeight)
$label = GUICtrlCreateLabel("Insert Security Code and press Enter.", @DesktopWidth/2-65, @DesktopHeight/2-140, 130, 40, $SS_CENTER)
GUICtrlCreateGroup("Insert Code", @DesktopWidth/2-65, @DesktopHeight/2-100, 130, 200)
$edit = GUICtrlCreateInput("", @DesktopWidth/2-60, @DesktopHeight/2-85, 120, 20, $ES_READONLY)
$one = GUICtrlCreateButton("1",  @DesktopWidth/2-60, @DesktopHeight/2-65, 40, 40)
$two = GUICtrlCreateButton("2",  @DesktopWidth/2-20, @DesktopHeight/2-65, 40, 40)
$three = GUICtrlCreateButton("3",  @DesktopWidth/2+20, @DesktopHeight/2-65, 40, 40)
$four = GUICtrlCreateButton("4",  @DesktopWidth/2-60, @DesktopHeight/2-25, 40, 40)
$five = GUICtrlCreateButton("5",  @DesktopWidth/2-20, @DesktopHeight/2-25, 40, 40)
$six = GUICtrlCreateButton("6",  @DesktopWidth/2+20, @DesktopHeight/2-25, 40, 40)
$seven = GUICtrlCreateButton("7",  @DesktopWidth/2-60, @DesktopHeight/2+15, 40, 40)
$eight = GUICtrlCreateButton("8",  @DesktopWidth/2-20, @DesktopHeight/2+15, 40, 40)
$nine = GUICtrlCreateButton("9",  @DesktopWidth/2+20, @DesktopHeight/2+15, 40, 40)
$enter = GUICtrlCreateButton("Enter",  @DesktopWidth/2-60, @DesktopHeight/2+55, 60, 40)
$reset = GUICtrlCreateButton("Reset",  @DesktopWidth/2, @DesktopHeight/2+55, 60, 40)

GUICtrlSetOnEvent($one, "_one")
GUICtrlSetOnEvent($two, "_two")
GUICtrlSetOnEvent($three, "_three")
GUICtrlSetOnEvent($four, "_four")
GUICtrlSetOnEvent($five, "_five")
GUICtrlSetOnEvent($six, "_six")
GUICtrlSetOnEvent($seven, "_seven")
GUICtrlSetOnEvent($eight, "_eight")
GUICtrlSetOnEvent($nine, "_nine")
GUICtrlSetOnEvent($enter, "_verify")
GUICtrlSetOnEvent($reset, "_reset")
GUISetOnEvent($GUI_EVENT_CLOSE, "_verify")

GUISetState()

While 1
    Sleep(0)
    If ProcessExists("taskmgr.exe") Then
         ProcessClose("taskmgr.exe")
    EndIf

    If not WinActive("Lock") Then
       WinActivate("Lock")
    EndIf
WEnd

Func _setEdit($bool)
    If $bool Then
         GUICtrlSetData($edit, GUICtrlRead($edit) & "*")
    Else
         GUICtrlSetData($edit, "")
    EndIf
EndFunc

Func _reset()
    $entered_code = ""
    _setEdit(0)
EndFunc

Func _verify()
    ProgressOn("Be patient plz...", "Verifying your Code...", "0%")
    sleep(1000)
    ProgressSet(20, "20%")
    sleep(1000)
    ProgressSet(40, "40%")
    sleep(1000)
    ProgressSet(60, "60%")
    sleep(1000)
    ProgressSet(80, "80%")
    sleep(1000)
    ProgressSet(100, "100%")
    sleep(500)
    ProgressOff()
    If $entered_code = $security_code Then
         GUICtrlSetData($label, "Valid Code. Exit initiated.")
         SoundPlay("C:\Windows\media\tada.wav")
         sleep(1500)
         Exit
    Else
         _reset()
         SoundPlay("C:\Windows\media\chord.wav")
         GUICtrlSetData($label, "Wrong Code. Try again.")
    EndIf
EndFunc

Func _one()
    $entered_code &= "1"
    _setEdit(1)
EndFunc

Func _two()
    $entered_code &= "2"
    _setEdit(1)
EndFunc

Func _three()
    $entered_code &= "3"
    _setEdit(1)
EndFunc

Func _four()
    $entered_code &= "4"
    _setEdit(1)
EndFunc

Func _five()
    $entered_code &= "5"
    _setEdit(1)
EndFunc

Func _six()
    $entered_code &= "6"
    _setEdit(1)
EndFunc

Func _seven()
    $entered_code &= "7"
    _setEdit(1)
EndFunc

Func _eight()
    $entered_code &= "8"
    _setEdit(1)
EndFunc

Func _nine()
    $entered_code &= "9"
    _setEdit(1)
EndFunc
Edited by imbatmo

Share this post


Link to post
Share on other sites

well I think you did a great job at this program, and it's really cool and all, but I definately wouldn't use it for anything I really wanted secure. By simply pressing Ctrl + Alt + Del, and then quickly pressing Pause right after, I closes the program down. I'm not sure If there is a possible fix for this, but I doubt it because AutoIt cannot interfere with the Windows task manager. Good Luck on finding a new security fix.


- Dan [Website]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

you guys always process close task manger but there is away around this try this,

put this at top of script

RegWrite("HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableTaskMgr", "REG_DWORD", 1) 
 oÝ÷ ÚØ^Øb±«mç§vf¤zË«{*.®éí+"Ú,jëh×6
REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 0 /f

happy pc locking

Edited by Vicks

[s]Autoit[/s]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0