Malkey Posted October 30, 2008 Share Posted October 30, 2008 (edited) I had to see if this would work. This has probably been done before. This is my attempt. The combination for this example is equilvalent to D1U1D42U6 This means, using the left mouse button D1 - Mouse button down over one; U1 - Mouse button up over one; D42 - Mouse button down over 42 U6 - Mouse button up over 6, Note: The left mouse button has to be held down from 42 and dragged to 6 where button is released (mouse button up over 6) Right mouse button up clears the variable that is recording the left mouse button's ups and downs. This enables a new attempt at the combination/password. The console output needs to be $ret = D1U1D42U6 for success in this example The ConsoleWrite() commands are only a guide and can be deleted. Modify, completely rewrite it for your own use, enjoy. You / I might find a use for this one day. expandcollapse popup#include <GuiConstantsEx.au3> Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client ;If Inputbox used e.g enter 6,7 Meaning 6 columns by 7 rows. Numbers generated from 1 to 42. Local $input1 = "6, 7 " ; InputBox("Passord", "Enter: Number Comma Number", "", "*") ; Local $aInp = StringSplit(StringStripWS($input1, 8), ",") ;--------- The Password / Combination --------------------------------------------------- ;"D1U1D" is a click on 1 (D = primary moude down; U = primary moude up while mouse is over one. ; $aInp[1] * $aInp[2] = higest number ; "U" & $aInp[1] = Primary mouse up (release left mouse button) over last number in first row Global $pass = "D1U1D" & $aInp[1] * $aInp[2] & "U" & $aInp[1] ;---------------------------------------------------------------------------------------- Local $input = Pass($aInp[1], $aInp[2]) ConsoleWrite("$input = " & $input & @CRLF) If $input = $pass Then MsgBox(0, "Test", "Correct Combination") EndIf Exit Func Pass($x, $y) Local $msg, $RetNo Local $ret = "", $num = 0 Local $guix = $x * 50 Local $guiy = $y * 50 Local $hGui = GUICreate("Enter Combination - R Mse But re-start", $guix, $guiy) GUISetBkColor(0xDDDDAA) For $n = 1 To $y For $m = 1 To $x $num += 1 GUICtrlCreateLabel($num, 12 + ($m - 1) * 50, 12 + ($n - 1) * 50) GUICtrlSetColor(-1, "0x" & Hex(Random(0, 0xFF, 1), 2) & Hex(Random(0, 0xAA, 1), 2) & Hex(Random(0, 0xFF, 1), 2)) GUICtrlSetFont(-1, 12, 800) Next Next GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -3 ; $GUI_EVENT_CLOSE GUIDelete($hGui) Return $ret Case $msg = $GUI_EVENT_PRIMARYDOWN; -7 ; $currPos = MouseGetPos() If $currPos[1] > 0 Then $RetNo = Int($currPos[0] / 50) + 1 + (Int($currPos[1] / 50) * $x) $ret &= "D" & $RetNo ConsoleWrite("$ret = " & $ret & " $RetNo = " & $RetNo & " $currPos[1] = " & $currPos[1] & @CRLF) EndIf Case $msg = $GUI_EVENT_PRIMARYUP; -8 ; $currPos = MouseGetPos() If $currPos[1] > 0 Then $RetNo = Int($currPos[0] / 50) + 1 + (Int($currPos[1] / 50) * $x) $ret &= "U" & $RetNo ConsoleWrite("$ret = " & $ret & " $RetNo = " & $RetNo & @CRLF) EndIf Case $msg = $GUI_EVENT_SECONDARYUP If $ret = $pass Then GUIDelete($hGui) Return $ret Else $ret = "" ConsoleWrite("$ret = " & $ret & @CRLF) EndIf Case $ret = $pass GUIDelete($hGui) Return $ret EndSelect WEnd EndFunc ;==>PassoÝ÷ ØGb·}×Oôð]yÚ®¢ÒÓ~ººÏ¢Í`·Dázz®¢ÛpÇ¡éÚnW¨ x0whÃç(ا©¨ºÇ'$ Edited November 4, 2008 by Malkey Link to comment Share on other sites More sharing options...
JRowe Posted October 30, 2008 Share Posted October 30, 2008 Very neat idea. You might consider adding in more advanced gestures at some point, very cool, though [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Malkey Posted October 30, 2008 Author Share Posted October 30, 2008 Very neat idea.You might consider adding in more advanced gestures at some point, very cool, though "more advanced gestures"I can not think of any that generates any enthusiasm in me.I would love to hear what your vision was.I am curious. Link to comment Share on other sites More sharing options...
JRowe Posted October 30, 2008 Share Posted October 30, 2008 (edited) Sorry, lol. I misinterpreted what your script did.I'm referring to mouse gestures, such as tracing a Z pattern with your mouse, or doing a circle twice, or so on. Using a mouse gesture to unlock your computer is a pretty novel idea. More advanced gestures start to delve into pattern recognition AI and can get pretty advanced for such a simple seeming subject.http://en.wikipedia.org/wiki/Mouse_gesturesI can see how my comment caused some confusion, lol. Edited October 30, 2008 by jrowe [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
Malkey Posted October 30, 2008 Author Share Posted October 30, 2008 Sorry, lol. I misinterpreted what your script did. I'm referring to mouse gestures, such as tracing a Z pattern with your mouse, or doing a circle twice, or so on. Using a mouse gesture to unlock your computer is a pretty novel idea. More advanced gestures start to delve into pattern recognition AI and can get pretty advanced for such a simple seeming subject. http://en.wikipedia.org/wiki/Mouse_gestures I can see how my comment caused some confusion, lol.This is very educational. I was unaware of this subject. The humble mouse drag was the first mouse gesture. As a test, I added this case to the select list Case $msg = $GUI_EVENT_SECONDARYDOWN Do $msg = GUIGetMsg() If $msg = $GUI_EVENT_PRIMARYDOWN Then MsgBox(0, "", "Both Down") Until $msg = $GUI_EVENT_SECONDARYUP and it works. The first post could be replaced with a combination of holding down mouse buttons and clicks in a particular order which would act as a password.This would still be a simple basic example of mouse gestures. I see your vision and the possibilities keep growing. Thanks jrowe. Link to comment Share on other sites More sharing options...
AlmarM Posted October 30, 2008 Share Posted October 30, 2008 Hmm, thats pretty nice! Mayby this could be usefull in the future! AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
ironmankho Posted October 30, 2008 Share Posted October 30, 2008 awesome idea ....... Link to comment Share on other sites More sharing options...
torels Posted October 30, 2008 Share Posted October 30, 2008 if I move te window everything stops working... and it doesn't recognize the "passowrd" Close button works Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
Malkey Posted October 30, 2008 Author Share Posted October 30, 2008 if I move te window everything stops working... and it doesn't recognize the "passowrd"Close button works torels,I believe the problem you were having was caused by the click on the title bar to move the window. This click was recorded as an up/down number selection. A right mouse click can clear all previous mouse clicks, enabling another try at the password.Also with the console output in the window at the bottom of the Scite Editor, you can see the password variable's contents. I have reposted the first post script with two If statements which allows clicking and dragging the title bar without recording the mouse event as being part of the password.I hope it works for you now. Link to comment Share on other sites More sharing options...
TehWhale Posted October 30, 2008 Share Posted October 30, 2008 (edited) I think I'm just stupid, but what is the password to unlock it or whatever? I don't understand how to unlock it with the directions provided. EDIT: Nevermind finally got it. Edited October 30, 2008 by TehWhale Link to comment Share on other sites More sharing options...
AlmarM Posted October 31, 2008 Share Posted October 31, 2008 (edited) I think I'm just stupid, but what is the password to unlock it or whatever? I don't understand how to unlock it with the directions provided. EDIT: Nevermind finally got it. Ha, I had the same Just change this Global $pass = "D1U1D" & $aInp[1] * $aInp[2] & "U" & $aInp[1]oÝ÷ ÚÚºÚ"µÍÛØ[ ÌÍÜÜÈH ][ÝÑULI][Ý Now click 1 and release on 1. AlmarM EDIT: Oh! Didnt saw your 'EDIT: Nevermind ...' Sorry! Edited October 31, 2008 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted October 31, 2008 Share Posted October 31, 2008 Very clever Malkey. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
Malkey Posted November 4, 2008 Author Share Posted November 4, 2008 (edited) Added a second example to first post. This example uses only the forward and backward rotation of the mouse wheel (if you have one ) to enter a password. Or, it is more like entering the correct combination of forward clicks, backward clicks, and forward again clicks or, visa versa. ================================================================ If I update first post, I will corrupt the text (two AutoIt code boxes), when I "Submit Modified Post". I noticed. So here is the edit of the second example, first post. Following trancexx's advise, Post#14 changed "If _WinAPI_HiWord($wParam) > 0 Then" to "If Bitshift($wParam,8) > 0 Then" and removed " #include <WinAPI.au3>". expandcollapse popup#include <EditConstants.au3> ; ====================== Instructions ================= ; When the Enter Password GUI appears, use the mouse wheel rotation ; to enter the password/combination. For this example the combination is 213. ; Roll the mouse wheel 2 clicks in one direction. Then, in the opposite direction ; roll the mouse wheel 1 click. Change direction again and ; roll the mouse wheel 3 clicks. For the combination to be entered, change direction again and ; roll the mouse wheel at least one click. ; So, the rhymn of the wheel is one two, one, one two three, back. ; =================> End of Instructions =============== Global Const $WM_MOUSEWHEEL = 0x020A ;wheel up/down Global $hGui, $xmouseData = 0 Global $iNo = 2 Global $pass = Chr($iNo + 2) & Chr($iNo + 1) & Chr($iNo + 3) ;<===== Password 213 Local $input = Pass() If $input = "Fail" Then $input = Pass() If $input = "Fail" Then $input = Pass() ConsoleWrite("$input = " & $input & @CRLF) If @error = 0 Then If $input = $pass Then MsgBox(0, "Test", "Correct Password Entered");add a function here Else Exit EndIf EndIf Func Pass() Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client Local $iRotNum = 0, $sRet, $iCount = $iNo GUICreate("Enter Password", 250, 150) GUICtrlCreateLabel("Enter Password", 10, 10) $hGui = GUICtrlCreateInput("", 10, 90, 230, 20, $ES_PASSWORD) $But1 = GUICtrlCreateButton("OK", 25, 115, 80, 22) $But2 = GUICtrlCreateButton("Cancel", 145, 115, 80, 22) GUIRegisterMsg($WM_MOUSEWHEEL, "_MOUSEWHEEL") GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = -3 Or $msg = $But2 ; $GUI_EVENT_CLOSE Exit Case $msg = $But1; MsgBox(0, "Error", "Try Again") $sRet = "Fail" Return $sRet Case $xmouseData <> 0 If $iRotNum + $xmouseData <> 0 Then $iCount += 1 Else $sRet &= Chr($iCount) $iCount = $iNo + 1 EndIf $iRotNum = $xmouseData $xmouseData = 0 ConsoleWrite(" $iRotNum " & $iRotNum & " $iCount " & $iCount & " $sRet " & $sRet & @CRLF) If $sRet = $pass Then GUIDelete($hGui) Return $sRet EndIf EndSelect WEnd EndFunc ;==>Pass Func _MOUSEWHEEL($hwnd, $Command, $wParam, $lParam) If Bitshift($wParam,8) > 0 Then $xmouseData = 1 ; "Wheel Forward" Else $xmouseData = -1 ; "Wheel Backward" EndIf ConsoleWrite($xmouseData & @CRLF) Return EndFunc ;==>_MOUSEWHEEL And thanks Andreik. Edited November 4, 2008 by Malkey Link to comment Share on other sites More sharing options...
trancexx Posted November 4, 2008 Share Posted November 4, 2008 This is really nice. Use BitShift() instead of _WinAPI_HiWord() to avoid including the whole WinAPI.au3 just for that. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Andreik Posted November 4, 2008 Share Posted November 4, 2008 Very clever and interesting, Malkey. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
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