Sign in to follow this  
Followers 0
mike2003

Record Mouse In Client Mode

18 posts in this topic

#1 ·  Posted (edited)

Is it possible to record mouse movement and clicks in "client mode" of coordinates for the window?

for correct work with Opt("MouseCoordMode", 2)

Edited by mike2003

Share this post


Link to post
Share on other sites



Hi, mike2003. Can you explain more about what you're trying to do? I assume you're using the AutoIt Window Info Tool, which should allow you to select the mode under Options>Coord Mode. But we find that 99% of the time there is a much easier way to manipulate the window you're interacting with, so you don't have to resort to MouseClicks, etc.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I need something like Au3Recorder but for local coordinates.

"AutoIt Window Info Tool" have no recorder. its for manual work.

Share this post


Link to post
Share on other sites

My point was, if you explain what you're trying to do, we can probably get you there without having to use the mouse at all. Most windows should support the control commands. A screenshot of the window would be helpful


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

i need mouse

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You are missing the point. We KNOW you want to record mouse movements. For WHAT application will you be recording the mouse movements in?

The name of the application please.

---------------------------------

Edit: To save the trouble, seeing you are new, and odds are you haven't read the forum rules yet, please keep in mind if what you want to do is for a game - PLEASE don't waste our time. Game automation is against forum rules. Second, giving any type of evasive answer instead of being truthful - well we won't like that for it will look like you are trying to get around forum rules in what you really want to do. So far you are being evasive. Not good.

We are not trying to be mean - we are following the rules of the forum.

 

Now if it isn't for a game and within the forum rules, then by all means continue. The name of the application please. Thanks

Edited by DarthCookieMonster

Share this post


Link to post
Share on other sites

any application. alpha code:

#include <Misc.au3>
#include <Timers.au3>

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Local Mouse Record", 393, 344, -1, -1, $GUI_SS_DEFAULT_GUI, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
$Edit1 = GUICtrlCreateEdit("", 32, 72, 329, 257);,$ES_READONLY)
GUICtrlSetState(-1, $GUI_DISABLE)
;~ GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Opt("MouseCoordMode", 2)

$hStarttime = _Timer_Init()
$dll = DllOpen("user32.dll")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{space}", "ClearLog")
$speed = 10
$firstrun = 1

While 1
    If _IsPressed("02", $dll) Then
        While _IsPressed("02", $dll)
            Sleep(50)
        WEnd
;~      RMouse
        MouseLog(02)
    ElseIf _IsPressed("01", $dll) Then
        While _IsPressed("01", $dll)
            Sleep(50)
        WEnd
;~      LMouse
        MouseLog(01)
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Terminate()

    EndSwitch
WEnd

Func Terminate()
    ClipPut(GUICtrlRead($Edit1))
    DllClose($dll)
    Exit 0
EndFunc   ;==>Terminate

Func ClearLog()
    GUICtrlSetData($Edit1, "")
EndFunc   ;==>ClearLog

Func MouseLog($button)
    If $firstrun = 1 Then
        $firstrun = 0
        $hStarttime = _Timer_Init()
        PrintMessage(StringFormat('WinActivate ("%s")', WinGetTitle("[ACTIVE]")))
        PrintMessage('Opt ("MouseCoordMode", 2)'&@CRLF)
    EndIf

    Local $a = MouseGetPos()
    PrintMessage(StringFormat("Sleep (%d)", Int(_Timer_Diff($hStarttime))))
    PrintMessage(StringFormat("MouseMove (%d, %d, %d)", $a[0], $a[1], $speed))
    If $button = 01 Then
        PrintMessage('MouseClick ("left")'&@CRLF)
    ElseIf $button = 02 Then
        PrintMessage('MouseClick ("right")'&@CRLF)
    EndIf
    $hStarttime = _Timer_Init()
EndFunc   ;==>MouseLog

Func PrintMessage($Message)
    GUICtrlSetData($Edit1, $Message & @CRLF, True)
EndFunc   ;==>PrintMessage

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

The name of the application please.

 

very strange questions.

I've dreamed of this function on for several years.

it is useful in 1000 moments!

in many tasks for any application!

and you are fixated on games.

instead of solving problems together, we discuss how it affects the game. then close the entire AU3 project at all. potential candidate because it is dangerous!

I did not ask for anything special! it's all there in au3rekorder! I just need a little differently. nothing new!

Edited by mike2003

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

 

any application. alpha code:

#include <Misc.au3>
#include <Timers.au3>

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Local Mouse Record", 393, 344, -1, -1, $GUI_SS_DEFAULT_GUI, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
$Edit1 = GUICtrlCreateEdit("", 32, 72, 329, 257);,$ES_READONLY)
GUICtrlSetState(-1, $GUI_DISABLE)
;~ GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Opt("MouseCoordMode", 2)

$hStarttime = _Timer_Init()
$dll = DllOpen("user32.dll")
HotKeySet("{ESC}", "Terminate")
HotKeySet("{space}", "ClearLog")
$speed = 10
$firstrun = 1

While 1
    If _IsPressed("02", $dll) Then
        While _IsPressed("02", $dll)
            Sleep(50)
        WEnd
;~      RMouse
        MouseLog(02)
    ElseIf _IsPressed("01", $dll) Then
        While _IsPressed("01", $dll)
            Sleep(50)
        WEnd
;~      LMouse
        MouseLog(01)
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Terminate()

    EndSwitch
WEnd

Func Terminate()
    ClipPut(GUICtrlRead($Edit1))
    DllClose($dll)
    Exit 0
EndFunc   ;==>Terminate

Func ClearLog()
    GUICtrlSetData($Edit1, "")
EndFunc   ;==>ClearLog

Func MouseLog($button)
    If $firstrun = 1 Then
        $firstrun = 0
        $hStarttime = _Timer_Init()
        PrintMessage(StringFormat('WinActivate ("%s")', WinGetTitle("[ACTIVE]")))
        PrintMessage('Opt ("MouseCoordMode", 2)'&@CRLF)
    EndIf

    Local $a = MouseGetPos()
    PrintMessage(StringFormat("Sleep (%d)", Int(_Timer_Diff($hStarttime))))
    PrintMessage(StringFormat("MouseMove (%d, %d, %d)", $a[0], $a[1], $speed))
    If $button = 01 Then
        PrintMessage('MouseClick ("left")'&@CRLF)
    ElseIf $button = 02 Then
        PrintMessage('MouseClick ("right")'&@CRLF)
    EndIf
    $hStarttime = _Timer_Init()
EndFunc   ;==>MouseLog

Func PrintMessage($Message)
    GUICtrlSetData($Edit1, $Message & @CRLF, True)
EndFunc   ;==>PrintMessage

As I thought - you're avoiding the question. Sorry, your doing the same thing many have tried in asking this question in actually avoiding what you are really doing. No I do not believe you. Reporting this to a moderator.

If you need the mouse position in the client window - All you really need to do to get the mouse in the client window is change the setting in the AutoItWindowInfo tool. Saying you have dreamed of this for years - I doubt that. A simple search of the forum would told you what I'm telling you. So, if you have been here for years - you know that searching the forum would have gave you the answer. So.....I call bullcrap on your intent.

And this: '?do=embed' frameborder='0' data-embedContent>>

You are REALLY digging a hole here....

Edited by DarthCookieMonster

Share this post


Link to post
Share on other sites
I do not understand why you shoot me my topics!
it is for flood !?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Your kidding right? Is this a joke? REALLY?

It is for a game and you KNOW that is against forum rules. Are you really going to try to get us to believe it isn't?

Well, you know how to do it. THE NAME OF THE APPLICATION.

PUT UP OR SHUT UP.

Edited by DarthCookieMonster

Share this post


Link to post
Share on other sites
you just flooder!
after effects and cinema have unique GUI.

Share this post


Link to post
Share on other sites

i don want wrote code with AutoIt Win Info with my hands for 1 hour.

i only need 10 sec for record and 10 for play in cycle.

it's so easy to understand!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

And yet....no name of the application.

again....you REFUSE TO TELL US THE NAME OF THE APPLICATION.

You can simply put a end to this and we will believe you  - just give us a screenshot of the application. Otherwise, a moderator will give you a one way ticket to ban-ville. Been there, seen it, got the t-shirt and ate popcorn while the clone like you got banned. 

Edited by DarthCookieMonster

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

.no name of the application.

are u crazy???

 

after effects and cinema have unique GUI.

Edited by mike2003

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

i don want wrote code with AutoIt Win Info with my hands for 1 hour.

i only need 10 sec for record and 10 for play in cycle.

it's so easy to understand!

 

yep...and yet another flag saying it is for a game. You say for any application then list two. Cinema is a smartphone app. Adobe After Effects supports macros so why do you need to use an AutoIt script to do something?

Edited by DarthCookieMonster

Share this post


Link to post
Share on other sites

mike2003,

This thread is going nowhere - you will not provide sensible replies and so no-one will answer you as they are all convinced you are coding for a game. Guess what happens now... :whistle:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0