Sign in to follow this  
Followers 0
Skrip

_CursorActivate

10 posts in this topic

#1 ·  Posted (edited)

Activates the message after a combination of cursor changes.

In this given example move the mouse change to an IBeam, then Arrow, then repeat.

$pass = 1
While 1
    $1 = MouseGetCursor()
    _CursorActivate(0, 5);5 = IBeam
    _CursorActivate(1, 2);2 = Arrow
    _CursorActivate(2, 5)
    _CursorActivate(3, 2)
    _CursorActivate(4, 5)
    _CursorActivate(5, 2)
    _CursorActivate(6, 5)
    _CursorActivate(7, 2, 7, "Works!")
WEnd

Func _CursorActivate($pass_number, $cursor, $done=0, $done_message="")
; Description:          _CursorActivate
; Parameter(s):     $pass_number = The function number.
;                   $cursor = Cursor number you want to find.
;                   $done = If this is the last part to activate the done message.
;                   $done_message = Message to display if done is activated.
;
; Requirement:      Must have a $1 varible for MouseGetCursor()
;                   Must have a varible $pass = 1
;                   Best used within While.
;
; User CallTip:     _CursorActivate($pass_number, $cursor, [$done=0, [$done_message="")
; Author(s):        Firestorm
; Notes:            Check the help file for cursor numbers.

;~  ToolTip($pass, 1, 1)
    If $pass = $pass_number Then
        If $done = 0 Then
            If $1 = $cursor Then
                $pass = $pass_number + 1
            EndIf
        EndIf
            If $pass = $done Then
                    MsgBox(0, "", $done_message)
                    $pass = 0
            EndIf
    EndIf
EndFunc

Very simple. But useful.

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



Activates the message after a combination of cursor changes.

Very simple. But useful.

It's not obvious to me how this is useful. Can you give an example of where it would be used?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Maybe increased security for a password program. That's what I'd use it for.


[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

#4 ·  Posted (edited)

I don't want to sound insulting, but in my opinion, that whole block of code is garbage.

The only thing the code will actually do is show a MsgBox when two variables are equal. You don't have any sort of loop for detection of the cursor, you only check once at the very beginning, so what good does it really do? Also, $1 doesn't make any sense. Why would you use a number as a variable name? Does that even work?

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

The only thing the code will actually do is show a MsgBox when two variables are equal.

Not that hard to make it a function..

Why would you use a number as a variable name?

I guess I wasn't thinking too well at the time.

Does that even work?

Why wouldn't it work?

[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

#6 ·  Posted (edited)

Hmm, very neat idea. Could you further your explanation on how this would help the security of a password program, Firestorm?

Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Obviously what I said didn't get through. The code has no real usage. The idea is sound, but you didn't implement it properly.

Edited by Richard Robertson

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hmm, very neat idea. Could you further your explanation on how this would help the security of a password program, Firestorm?

Okay. Let's say you have a GUI box. You have 2 things, a button ("Confirm"), and an input ("Enter password"). Then you type in your password. And (from remembering what to do) to must move your mouse to the input box (changing the cursor to an IBeam). Then press tab, highlighting the Confirm button, and press enter.

Example!

#include <GUIConstants.au3>
$pass = 1
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 354, 125, 193, 115)
$Input1 = GUICtrlCreateInput("Enter Password..", 16, 32, 321, 21)
$Button1 = GUICtrlCreateButton("Confirm", 72, 72, 195, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $read = GUICtrlRead($Input1)
            $1 = MouseGetCursor()
            _CursorActivate(1, 5)
            _CursorActivate(2, 5, 2)
    EndSwitch
WEnd

Func check()
    If $read = "test" Then
        MsgBox(0, "", "Win!")
    EndIf
EndFunc

Func _CursorActivate($pass_number, $cursor, $done=0, $done_message="")
; Description:          _CursorActivate
; Parameter(s):     $pass_number = The function number.
;                   $cursor = Cursor number you want to find.
;                   $done = If this is the last part to activate the done message.
;                   $done_message = Message to display if done is activated.
;
; Requirement:      Must have a $1 varible for MouseGetCursor()
;                   Must have a varible $pass = 1
;                   Best used within While.
;
; User CallTip:     _CursorActivate($pass_number, $cursor, [$done=0, [$done_message="")
; Author(s):        Firestorm
; Notes:            Check the help file for cursor numbers.

;~  ToolTip($pass, 1, 1)
    If $pass = $pass_number Then
        If $done = 0 Then
            If $1 = $cursor Then
                $pass = $pass_number + 1
            EndIf
        EndIf
            If $pass = $done Then
                    check(); MINOR modifcation.
                    $pass = 0
            EndIf
    EndIf
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

It would be much more secure if you used valuater's hover function so that the mouse had to be over that control as opposed to being an I beam anywhere. Aside from all of this, thanks for sharing your ideas and examples, keep up the great work!


- Dan [Website]

Share this post


Link to post
Share on other sites

sweet thing :whistle:

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