Jump to content
Sign in to follow this  
wodzuu

recording mouse movement+key pressing

Recommended Posts

wodzuu

Hi!

I want to make script that records my mouse movement, clicking and key pressing (for automated game playing). Is there any function that allows me to 'sniff' key pressing and mouse clicking ?

thanks in advance for your help

Share this post


Link to post
Share on other sites
BigDod

You could try using AU3Record.exe that comes with SciTe. You will find it in the Scriptwriter folder.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
SmOke_N

You could try using AU3Record.exe that comes with SciTe. You will find it in the Scriptwriter folder.

LOL, waiting for the... that's not quite what I mean statement :D

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.

Share this post


Link to post
Share on other sites
wodzuu

You could try using AU3Record.exe that comes with SciTe. You will find it in the Scriptwriter folder.

But it does not have option to track pauses between mouse clicks. I want to make a 'game autoplayer' and those pauses are essential for me.

Share this post


Link to post
Share on other sites
Xenobiologist

HI,

sure. Otherwise you can change the Sleep(...) commands to your needs.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites
wodzuu

HI,

sure. Otherwise you can change the Sleep(...) commands to your needs.

So long,

Mega

But it's hard to messure how many milliseconds i have kept my mouse button pressed :D If i knew how to sniff mouse clicks i could write something like that on my own

Share this post


Link to post
Share on other sites
SmOke_N

While 1
    $LeftClick = _TimeClick('01')
    If $LeftClick Then MsgBox(64, 'Info:', 'Left mouse was held for: ' & StringFormat('%i second(s) or %i millisecond(s)', Mod($LeftClick, 60), $LeftClick * 1000))
    Sleep(10)
WEnd

Func _TimeClick($vKey)
    Local $MouseDownTime
    If _IsPressed($vKey) Then
        $MouseDownTime = TimerInit()
        While _IsPressed($vKey)
            Sleep(10)
        WEnd
        Return TimerDiff($MouseDownTime) / 1000
    EndIf
    Return 0
EndFunc

Func _IsPressed($v_R, $v_dll = 'user32.dll')
    $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R)
    Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1
EndFunc

Edited by SmOke_N

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.