Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Mouse Movement & Click Recorder


  • Please log in to reply
55 replies to this topic
specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

1) it did not record my typed letters in the address bar of my browser
2) it did not save my operations as expected


Maybe because it's a "Mouse" recorder.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

azure
  • Members
  • 1216 posts
  • Last active: Mar 18 2015 09:06 AM
  • Joined: 07 Jun 2007
I found out that there are more complete scripts, like "Macro recorder" and "Autoscriptwriter", but the threads are locked

is there any alive thread for these or any similar tool?

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
I'm not sure, you should ask in the help section, someone there could likely point you in the right direction.

I have something similar to an auto script writer but I don't think it's what your looking for. Easy Automation
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

I BlameKarma
  • Members
  • 4 posts
  • Last active: Jan 03 2012 12:12 AM
  • Joined: 02 Jan 2012
Can i switch the Playback hotkeys?

Gumbot
  • Members
  • 3 posts
  • Last active: Jan 28 2012 03:39 PM
  • Joined: 05 Jan 2012
I know this is a pretty old thread, but it comes up high on a lot of Google search results and a lot of people probably still read it. I've been working on a script and have used parts of this code, but a precision based recorder still eludes me.

First I want to thank you for the code, it has proved useful and has helped me jump right into AHK.

For anyone curious how this records and plays back, it's actually quite simple.

while recording {
		MouseGetPos, X, Y
		if (StoredX=X and StoredY=Y)
			script .= "+."
		else {
			script .= X "," Y "."
			StoredX:=X, StoredY:=Y
		}
		Sleep, 10
	}

It loops this while recording, getting the mouse x and y position every 10 milliseconds. Every time it loops, it stores either a mouse event, mouse x,y, or a pause to the script variable between periods. If the mouse is in the same position as the last recording, it will record a "+" plus sign, essentially a pause. Here is the bit that records mouse actions:

{ ; Hotkeys
	Loop, 3 {
		Hotkey, % "~" SubStr("LRM",A_Index,1) "Button", ClickHotkeys
		Hotkey, % "~" SubStr("LRM",A_Index,1) "Button Up", ClickHotkeys
	}
	Hotkey, ~WheelDown, ClickHotkeys
	Hotkey, ~WheelUp, ClickHotkeys	
	^+r:: GoSub, ButtonRecord
	^+s:: GoSub, ButtonStop
	^+p:: GoSub, ButtonPlay

	ClickHotkeys:
		if recording
			script .= SubStr(A_ThisHotkey, 2) (InStr(A_ThisHotkey, " Up")? "":" Down") "."
		return
}

If you scroll your mouse wheel, left or right click, then it will append these actions to the script variable during the recording.

During the playback, it loops this:

Loop, Parse, script, .
	{
		Sleep, -1
		if Not playing
			break
		else if RegExMatch(A_LoopField,"(\d+),(\d+)",p) {
			MouseMove, %p1%, %p2%, 0
			StoredX:=p1, StoredY:=p2
		} else if (A_LoopField = "+")
			MouseMove, %StoredX%, %StoredY%, 0
		else,
			Send, {%A_LoopField%}
	}

Here is an example script of clicking one spot, moving the mouse down a bit, clicking another spot, then moving it back to the first spot and clicking again.

192,612.+.+.+.+.+.+.+.+.+.+.+.+.+.191,612.+.190,612.188,613.184,615.175,617.+.164,620.153,622.146,623.131,624.109,625.100,625.96,625.91,623.87,621.84,618.83,614.83,611.84,606.86,602.86,601.86,600.+.+.+.+.LButton Down.+.+.+.+.LButton Up.+.+.+.+.86,602.85,607.84,613.82,621.82,630.82,639.83,650.84,661.84,672.86,685.88,699.90,706.91,726.91,732.90,748.90,753.90,760.90,766.90,768.+.+.LButton Down.+.+.+.+.LButton Up.89,768.+.+.+.+.89,766.89,764.90,758.91,749.92,732.93,725.93,711.93,698.91,684.89,671.86,659.84,648.84,645.84,639.84,634.84,629.84,625.84,623.+.+.LButton Down.+.+.+.+.LButton Up.+.+.+.+.87,623.94,622.108,622.133,622.141,621.155,619.169,618.182,617.193,616.202,615.208,615.211,614.214,614.216,614.223,613.233,612.237,611.239,611.242,611.243,610.+.+.+.+.LButton Down.244,610.+.+.+.LButton Up

There are a few problems with this script:

1) If you use your mouse with the GUI, it will record the movement of pressing record, stop, etc. Because of this, I recommend using hotkeys instead of the GUI.

2) It doesn't record key presses. Sure, it's a mouse recorder, but if you're looking for keys, you'll have to add that to the hotkey portion where it records mouse events.

3) It's not 100% accurate or precise. I've messed with a lot of mouse recorders with AHK and have even tried writing a few methods of my own. No matter what, none of them are 100% accurate in capturing precise mouse movements.

Here is an example:

Recorded image: <!-- m -->http://imageshar.es/...9a0a0d91800009a<!-- m -->
Playback image: <!-- m -->http://imageshar.es/...9a0a0d91800009d<!-- m -->

The easiest way to compare them is to open them both in two tabs and just tab between them. With the first image, I drew a picture in mspaint with numerous fast mouse movements and jagged lines. During the playback, you can see that it had trouble recording those fast movements precisely.

Due to the nature of the script I am creating that requires 100% precise mouse capturing, this has become a problem that has stunted me for a few days now. Does anyone have recommendations?

quadmaster5
  • Guests
  • Last active:
  • Joined: --
Can you add a loop playback feature that doesn't automatically start playing but waits x amount of time and then plays like you could set the time :) thank you! Or could someone give me the code to do this

Quadmaster5
  • Guests
  • Last active:
  • Joined: --
Also please add a speed feature

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Hi there! For those of you interested in a Macro Recorder, I've built one of my own with more features and options. I'd just like to share. :wink:

Some of the features:
- AHK Commands: Send, SendRaw, ControlSend, ControlSetText, Click, ControlClick, Sleep, MsgBox, Loop, Run and 15 Window commands.
- Records Keyboard, Mouse and Windows.
- Records Relative Mouse Clicks/Drags while holding 'CapsLock'.
- Records precise Mouse Movements (activate Click Down/Up in options menu).
- Easily edit, delete and re-order any command.
- Preview final script anytime, even during record.
- Playback Hotkeys.
- Supports Comments.

Download: Pulover's Macro Creator

I'd be happy if some of you would send me your comments and help me improve it with suggestions and bug reports.

Thanks everyone!

Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer) | Class_LV_Rows - Copy, Cut, Paste and Drag ListViews | Class_Toolbar - Create and modify | Class_Rebar - Adjustable GUI controls

Join the New AutoHotkey Forum!


Kamagi
  • Members
  • 18 posts
  • Last active: Apr 07 2012 09:20 PM
  • Joined: 21 Jun 2011
Awesome! Easy and useful, many thanks.

branuschi
  • Guests
  • Last active:
  • Joined: --
Is it possible to speed up the recorded play?

ed141
  • Members
  • 1 posts
  • Last active: Sep 09 2012 01:20 PM
  • Joined: 09 Sep 2012
hmm one quick question o.o how do i stop it?

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

Is it possible to speed up the recorded play?

Sure - though to truly be accurate, the recording process would have to be rewritten to incorporate this. Even then (depending on the stipulations) it's quite likely you'd loose accuracy - similar to enlarging a digital picture.

hmm one quick question o.o how do i stop it?

Hotkeys:
CTRL+SHIFT+R: Start Recording
CTRL+SHIFT+S: Stop Recording/Playback
CTRL+SHIFT+P: Playback



  • Guests
  • Last active:
  • Joined: --
i see thx man this little app is a wonder any plans in making it with more options?

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Currently no, but I'm open to suggestions.

FrankWA
  • Guests
  • Last active:
  • Joined: --
Hello,
Newbie here...
I have read thru all 44 posts in the thread.
I didn't find a way to save the recorded mouse movement & clicks and then run it from a pair of hotkeys
like ctrl + whatever key wanted
Did I miss it or is it not a current feature?

Thanks