AutoHotkey Community

It is currently May 27th, 2012, 11:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: November 4th, 2010, 6:26 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
>>>Download Mouse Recorder.exe<<<

Image
**VIEW SOURCE**

AutoHotkey_L and AHK Basic compatible

I thought something like this would be nice for those who just want to create mouse movement & clicking macros. Mouse Recorder will will record the Pressing & Releasing of the Left, Middle, & Right Click Buttons, along with Scrolling Up & Down.

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

Loop Playback:
Once you have recorded a script, you can play it back continuously by selecting Playback>>Loop. You can then stop this Playback by using the Stop Hotkey (CTRL+SHIFT+S).

Running .SMR Files (Script - Mouse Recorder) from AHK:
  • Command Line:
    You can run a .SMR File with Command Line by using the .SMR File as the parameter. Here is an example in AHK:
    Code:
    RunWait, Mouse Recorder.exe "MyScript.smr"
  • PlaySMR() Function:
    This function allows you to execute Mouse Recorder Code in your AHK Script. You could either specify the SMR File Path as the function parameter, or copy & paste the Mouse Recorder Code into your AHK script with the Copy menu item.
    Code:
    PlaySMR(script, relative="") {
       batchLines:=A_BatchLines,x:=y:=0
       SetBatchLines, -1
       if FileExist(script)
          FileRead, script, %script%
       if relative
          WinGetPos, x, y, , , A         
       Loop, Parse, script, .
       {
          if RegExMatch(A_LoopField,"(\d+),(\d+)",p) {
             DllCall("SetCursorPos", "Int",x+p1, "Int",y+p2)
             StoredX:=p1, StoredY:=p2
          } else if (A_LoopField = "+")
             DllCall("SetCursorPos", "Int",StoredX, "Int",StoredY)
          else,
             Send, {%A_LoopField%}
          Sleep, 10
       }
       SetBatchLines, %batchLines%
    }
    ; NOTE: set the second Parameter as true to make the Mouse Movements relative to the active window

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Last edited by jethrow on April 10th, 2011, 7:32 pm, edited 5 times in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 6th, 2011, 7:02 pm 
I like this idea, but is there some way to save the scripts that are created as well as playing them back?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2011, 4:12 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
I was wondering if anyone would ever take an interest in this ... I updated the original post.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 9:37 am 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
I like your solution.
Once ago, I did a Mouse-Recorder, too.
But yours is more handsome.

Best regards,
Garath


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 9th, 2011, 10:18 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
jethrow wrote:
I was wondering if anyone would ever take an interest in this ... I updated the original post.


I though this was great, the movement is very smooth. I made it into a module for a large script I'm working on, feel fee to take a look at a pre release. Just read the quick start pdf to learn how it works.
http://www.autohotkey.net/~specter333/EasyAuto/EasyAuto%20V1.zip


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2011, 12:23 pm 
This is amazing

But I was wondering, can you get it to record holding down too?

That would be awesome to draw pictures in paint or photoshop, and then erase them and watch it go!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 20th, 2011, 12:34 pm 
also, how about the ability to set a loop for the recorded action?


Report this post
Top
  
Reply with quote  
PostPosted: February 11th, 2011, 8:00 am 
Offline

Joined: February 10th, 2011, 9:35 am
Posts: 2
Location: SG
Can we set the mouse actions to play it continuously when a situation happens or a specific clipboard text is copied in clipboard? Am a newbie.. but this script works great....thanks...jethrow


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 7:59 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
EverythingInane wrote:
... can you get it to record holding down too?
Done.
EverythingInane wrote:
also, how about the ability to set a loop for the recorded action?
KULA wrote:
Can we set the mouse actions to play it continuously when a situation happens or a specific clipboard text is copied in clipboard?
I have no intentions of turning this into a AHK Script creating tool, but I did add command line support & a PlaySMR() function (see the original post). You could use either of these to execute your mouse movements from an AHK script.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 3:31 pm 
Offline

Joined: February 17th, 2008, 8:52 pm
Posts: 314
How about adding a Help menu item noting what the short cut keys are and a link to your post here.

If someone did want to loop what was already recorded, would you just put your function in a loop command.

How about a convert function. Takes the smr file and writes it in ahk syntax for ease of copy and pasting to other scripts. My use case for this is sharing with colleges that don't have the ahk chops to understand the function.

This script is awesome thanks for sharing.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2011, 8:23 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
vahju wrote:
If someone did want to loop what was already recorded, would you just put your function in a loop command.
Have you tried?

Quote:
How about a convert function. Takes the smr file and writes it in ahk syntax for ease of copy and pasting to other scripts.
You can already hit the Copy menu item to put the script on the clipboard & paste it where you want.

Quote:
My use case for this is sharing with colleges that don't have the ahk chops to understand the function.
Then what good would it be to put any of the script in an AHK script? They don't need to understand the function:
Code:
FileRead, script, MyScript.smr
PlaySMR(script)

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2011, 3:55 am 
Just an idea...

Could you make it so that your screen "resets" when you press "Stop" ?

Like making windows return to the state as they were before recording.

Would make this script awesome for creating macros.


Report this post
Top
  
Reply with quote  
PostPosted: March 26th, 2011, 6:06 pm 
well I did find a few flaws in this compared to http://www.autohotkey.com/forum/viewtopic.php?t=16473.
This has this nice GUI but I found that it can't record middle clicks or mouse scrolls.

So I would suggest looking at hes code then adding in recording for those aswell. because (to me anyway) thats a huge advange which I somewhat would need.


Report this post
Top
  
Reply with quote  
PostPosted: March 26th, 2011, 6:39 pm 
Oh yeah, also a good add to this is if you made a loop option.
like on the GUI add a checkbox that says "loop?".

and have it stop with Ctrl+Shift+S or something.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 26th, 2011, 8:04 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Quote:
... it can't record middle clicks or mouse scrolls.
Easily Fixed.
Quote:
... a loop option.
Good idea - I'll think about how I want to implement it.

If anyone wants to submit an icon, I'm open to using one. Also, I updated the PlaySMR() function to accept & play an SMR file if the path is specified in the Script Param.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], notsoobvious, rrhuffy and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group