Sign in to follow this  
Followers 0
slightly_abnormal

Notify Or Do Something When Mouse Was Moved?

10 posts in this topic

#1 ·  Posted (edited)

How can i get this to notify me, or run a program when the mouse of moved?

if Mousemove( ) then
Msgbox(64,"Warning:","You moved the mouse.",5)
endif

while 1
sleep(800)
wend
Edited by slightly_abnormal

Share this post


Link to post
Share on other sites



maybe

$pos = MouseGetPos()
While 1
    
        $pos1 = MouseGetPos()
        If $pos1[0] <> $pos[0] Then
            MsgBox(0,'',"You moved  ")
            ExitLoop
        EndIf
        
    Sleep(20)
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Global $XronikoOrio=4000
Global $x,$Y,$FoundMovement=0,$Terminate
GUICreate ( @ScriptName )

Global $Tote=TimerInit()

$MouseInfo=GUIGetCursorInfo()
$X=$MouseInfo[0]
$Y=$MouseInfo[1]
Do
    Sleep(50)
    $MouseInfo=GUIGetCursorInfo()
    Select
    case $FoundMovement=1
         $Tote=TimerInit(); Midenise Xronometrith
         MsgBox(0,"","Mouse moved")
         $FoundMovement=0
    case $MouseInfo[2]=1 or $MouseInfo[3]=1;Mouse Click
         $FoundMovement=1
    ;MsgBox(0,"","Mouse Click")
    case $X<>$MouseInfo[0] or $Y<>$MouseInfo[1];Mouse Movement
          $FoundMovement=1
          $X=$MouseInfo[0]
          $Y=$MouseInfo[1]
    case TimerDiff($Tote)>$XronikoOrio;Mouse not moved for too long!
             MsgBox(0,"","Mouse not moved last "&$XronikoOrio/1000&" secs!")
             $Tote=TimerInit()
    EndSelect
Until $Terminate
Exit

Edited by Amen

Share this post


Link to post
Share on other sites

thanks.. for the simple and more advanced way of doing this :)

Share this post


Link to post
Share on other sites

Along the same lines as Val:

Global $i_Saved_MPos = MouseGetPos()
While 1
    If _TrackMousePos(MouseGetPos()) Then; If Mouse Movement = True Then Do something
        Beep(1000, 500); Replace Beep() function with whatever you want
    EndIf
    Sleep(10)
WEnd

Func _TrackMousePos($i_Current_MPos)
    If $i_Current_MPos[0] <> $i_Saved_MPos[0] Or $i_Current_MPos[1] <> $i_Saved_MPos[1] Then
        $i_Saved_MPos[0] = $i_Current_MPos[0]
        $i_Saved_MPos[1] = $i_Current_MPos[1]
        Return 1
    EndIf
EndFunc
Except it's a function, and you can input it where ever.


[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

#6 ·  Posted (edited)

Along the same lines as Val:

Global $i_Saved_MPos = MouseGetPos()
While 1
    If _TrackMousePos(MouseGetPos()) Then; If Mouse Movement = True Then Do something
        Beep(1000, 500); Replace Beep() function with whatever you want
    EndIf
    Sleep(10)
WEnd

Func _TrackMousePos($i_Current_MPos)
    If $i_Current_MPos[0] <> $i_Saved_MPos[0] Or $i_Current_MPos[1] <> $i_Saved_MPos[1] Then
        $i_Saved_MPos[0] = $i_Current_MPos[0]
        $i_Saved_MPos[1] = $i_Current_MPos[1]
        Return 1
    EndIf
EndFunc
Except it's a function, and you can input it where ever.
hey, thats cool smoke_n, I remember one script where it would do the same thing beap but the pitch would go higher or lower depending on possition of mouse, i forgot where i saw it :) Edited by slightly_abnormal

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

lol! that's not it but that is cool!

here it found it with vaulaters searcher thingie

#include <misc.au3>
#NoTrayIcon
$P=1
While 1
    if (_IsPressed ("01") and _IsPressed ("02") and _IsPressed ("04")) or $P Then;to exit script you have to hold the buttons half a second
        Sleep (500)
        if _IsPressed ("01") or _IsPressed ("02") Then $P=0;if left/rigth mousebutton is klicked start beepthing
        if _IsPressed ("01") and _IsPressed ("02") and _IsPressed ("04") Then Exit;if left+right+third mousebutton is klicked exit script
    Else
        $Mouse = MouseGetPos()
        $Frequenz =($Mouse[0]/18+10)*($Mouse[1]/18+10);different sounds for mouse coords
        if _IsPressed ("01") then $Frequenz +=100
        if _IsPressed ("02") then $Frequenz +=200;higher sound if left/right mousebutton clicked
        Beep($Frequenz, 50)
    Endif
WEnd
Edited by slightly_abnormal

Share this post


Link to post
Share on other sites

Ah yes I have seen that one too. People come up with some pretty creative scripts.

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