Skrip Posted April 14, 2008 Posted April 14, 2008 (edited) Hey, this is the second version of my TimeLock script. I can't find a link to version one, so..yeah. This will have to do. Must be constantly called to work correctly. I designed this for iTunes, because...reasons...but change the varible $win to your window title. expandcollapse popup#NoTrayIcon $win = "iTunes" $winl = "Locked. Enter Password" $lock = 1 While 1 If $lock = 1 Then If WinActive($win) = 1 or WinActive($winl) = 1 Then WinSetTitle($win, "", $winl) WinSetState($winl, "", @SW_RESTORE) WinSetState($winl, "", @SW_MINIMIZE) WinSetState($winl, "", @SW_DISABLE) $pass = InputBox("Please enter the password for this window!", "Please enter the password to view this window!", "", "*") _time_pass() EndIf EndIf WEnd Func _go() $time = TimerInit() While 1 If TimerDiff($time) > 1000*60*30 Then $lock = 1 ExitLoop EndIf WEnd EndFunc ;==>_go Func _time_pass() If @HOUR > 12 Then $hour = @HOUR - 12 EndIf $min = StringRight(@MIN, 1) $time_12 = $hour * $hour + $min If $pass = $time_12 Then WinSetTitle($winl, "", $win) WinSetState($win, "", @SW_RESTORE) WinSetState($win, "", @SW_ENABLE) $lock = 0 _go() Else MsgBox(0, "", "Wrong.") EndIf EndFunc This is useful because it rotates the password. It is never the same, it's always different at every minute of the day. To calculate the password, you do <hour> * <hour> + <first digit of the minutes> Example: The time is 9:41. You do, 9 * 9 + 1, so the password is 82. Edited April 14, 2008 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]
JustinReno Posted April 14, 2008 Posted April 14, 2008 Your multiplication is wrong in your password (83) Its 82! Good script!
Skrip Posted April 14, 2008 Author Posted April 14, 2008 Thank you! And my bad. How'd I type that wrong? lol... [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]
Jango Posted April 15, 2008 Posted April 15, 2008 I Like! Very nice and simple script!I like, neat, effective and simple
Skrip Posted April 22, 2008 Author Posted April 22, 2008 Thanks. [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]
AU3Newbie Posted April 22, 2008 Posted April 22, 2008 (edited) Thanks.If the windows opened by users twice,how can it lock?Thank you,you give us a very good idea.I like play games,it's useful. Edited April 23, 2008 by AU3Newbie
AU3Newbie Posted April 22, 2008 Posted April 22, 2008 2.If the windows opened by users twice,how can it lock?It only lock the Window once.{Newly Edit:Never exit the loop can do nothing.} Thank you,you give us a very good idea.I like play games,it's useful.About my 2nd question,I insert code into Func _time_pass(),I can open another windows,too. And I cannot input the password now. Do WinClose($win) Until $pass = $time_12
James Posted April 22, 2008 Posted April 22, 2008 That is a neat password idea Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Skrip Posted April 22, 2008 Author Posted April 22, 2008 Thanks guys. And Au3Newbie...I only understood like...half of what you said..What exactly is your question? [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]
AU3Newbie Posted April 23, 2008 Posted April 23, 2008 Thanks guys. And Au3Newbie...I only understood like...half of what you said..What exactly is your question?Sorry.I edit the topic above.But if the windows "iTunes" was locked,why not open another?Wish a good solution.Thank you very much.
Skrip Posted April 23, 2008 Author Posted April 23, 2008 Ohh..I see what you mean. I'll edit my script when I have some time to prevent this. Thanks for pointing 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]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now