Jump to content

recording mouse movement+key pressing


Recommended Posts

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

Link to comment
Share on other sites

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


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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...