Jump to content

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

Macro Creator v4.1.2 - Automation Tool (Recorder & Writer)


  • Please log in to reply
670 replies to this topic
kbanny
  • Members
  • 2 posts
  • Last active: Apr 30 2012 09:41 PM
  • Joined: 30 Apr 2012

Thanks for trying it, kbanny!

I understand what you want, it deals with Flow of Control. I plan to add shortcuts for If commands soon, but it's already possible to use these commands in Text window selecting the Script option. Although it will not work in Playback mode, I'll show you how use it to create the script.
By the way, I fixed an issue with the Run command, so please download it again to update.

I made a save file with a working example: RunExplorer.pmc - You just have to edit it to open the Window you want:
- Double-Click the Run command in Row 2 to choose the window you want (works just like windows Run, you can use folders or url too).
- You need to get the name or class of the window: Click the Window button, you don't have to select a command, just select between Title or Class and click the Get button. Open the window of your choice and right-click anywhere to get title/class, then copy the text. Now close the window.
- Edit and change the text "ahk_class CabinetWClass" in rows 2 and 3 with the copied text.
- Now click Export and change the key in Hotkey box to a valid mouse button (LButton, RButton, MButton, X1 or X2). You can set up an Abort Hotkey to exit the script. Also you can use a Tilde to keep the button normal function if you need (i.e. ~MButton).
- Select destination and click Export.

Now you can execute the exported AHK file and it will check if the window exists, if it doesn't the run command will execute, if it does the window will be closed.

The final script will look like this:

Hotkey, MButton, Start, On
Hotkey, F8, Abort, On
return

Start:
Loop, 1
{
IfWinNotExist, ahk_class CabinetWClass
Run, C:\Windows\explorer.exe
IfWinExist, ahk_class CabinetWClass
WinClose
}
return

Abort:
ExitApp
return
If you need to know more about the commands just check the AHK documentation. And feel free to leave any questions or comments!


Wow thanks for that. I didn't expect a response so fast.

I probably should have said what my exact intentions were. I was hoping by stating mouse only I could remove any keyboard shortcut responses but overlooked scripts. Which, I obviously don't know :(I apologize, I figured I could take whatever was suggested and change it to fit the needs but "IfWinNotExist". Would not help as I do not think there is a Ifvariable that can account for what I would need without hooking into the game in some way. Which I'm against.

I'll try to explain better.

I am attempting to create a weapon swap macro in a game. You see the macro currently swaps weapons perfectly as I used the record feature. However, the game will not always put the weapons in the same spot on the screen. It will go from inventory rows 1 and 2 to rows 2 and 3 then back to 1 and 2 and so on. So when I hit the macro again it doesn't work. Well it does, but not correctly.

What I've done is created 2 macros to account for this and it's working, but I'd rather not hit 2 different hotkeys. I just wasn't sure if there was a way to alternate separate macros with the same hotkey. I figured if there was some sort of sequence system, that I could just have - on press 1 execute the first part and on press 2 the second part.. repeat etc.



I do greatly appreciate your response and efforts! I'll continue to search for a way to tie them together :)

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
I think you can achive that using KeyWait. You'll need to put the 2 macros in sequence with 2 KeyWait commands with the chosen button in between. The first will wait for the button to be released, then the second will wait for you to push it again to continue the script.
Follow this example, it sends Down 3 times when you push the Right Button, and sends Right 5 times when you push it again, then restarts.

Hotkey, RButton, Start, On
return

Start:
Send, {Down 3}
KeyWait, RButton
KeyWait, RButton, D
Send, {Right 5}
return
That should do to create the sequenced macro, but if it fails there's also GetKeyState that can help in some cases.

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!


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Updated to version 1.5!

Changes
- Added Join option in Export window: it can append the current macro to another with different hotkeys.
- Added Record Controls Options.
- Added Playback Speed Control: Fast Forward / Slow Down.
- Added Find/Replace function in Edit Menu (Ctrl+F will open it too if Capture is off).
- Added Hotkeys to move rows: PageUp/PageDown can be used to move rows when Capture is off.
- Changed 'Duplicate' behavior: Selected rows will now be duplicated right after the last selected row.
- Fixed some issues.

Record Control will be used when available, still it can't always detect when focus has changed (i.e. menus), so wouldn't recommend to use it everytime.

Any suggestions/requests?

:D

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!


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
New Updates:

- Playback Speed Control: Fast Forward & Slow Down keys.
- It now supports Hotstrings for exported scripts.
- Creates Context Sensitive Hotkeys/Hotstrings.

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!


Eve
  • Guests
  • Last active:
  • Joined: --
hum nice script but my issue w/ it is that when using the record function, the delays are inaccurate. I'd like to see something more novice user friendly. Like we can press record, do what we need to do once, and then be able to go back and make little adjustments.

nothing
  • Members
  • 129 posts
  • Last active: Oct 03 2014 04:51 AM
  • Joined: 09 Jan 2010
there is another one too: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=2&t=53196">viewtopic.php?f=2&t=53196</a><!-- l -->
(it's stopped developing)
nothing is impossible with ahk (_L).
Excuse my bad English.
Busy

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

hum nice script but my issue w/ it is that when using the record function, the delays are inaccurate. I'd like to see something more novice user friendly. Like we can press record, do what we need to do once, and then be able to go back and make little adjustments.

Hi, Eve. Thanks for the comment!

My goal is to make it simple to use but adjustable to different users. That's why I need feedback to know what I need to do to make it better. Could you help me describing the issues you have?
If you are talking about Time delays and Mouse movements, they are disabled on first run. Have you entered options to enable them? If not, try clicking the options button and checking the options 'Mouse Moves' and 'Timed Intervals' and set minimun interval of both to 10 or less. And if you need to use it for drawing check the option 'Use Click Down/Up'.

Please, let me know if this solves your problem or if it's something else.
Maybe I should change default options, what do you think?

Edit: I have tested the recorder a little more and found an issue playingback mouse moves, I think it may be what you are talking about. The mouse won't move the same way it was recorded. I'm working on a solution and will post a new version soon. Thanks!

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!


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Updated to Version 1.6!

- Fixed not recording accurate mouse movements and intervals.
- Removed WinWaitActive from Window Recording.
- Added RunWait option in Run Command.

I fixed the recoding tool and improved it a little. It's still in tests but it should be more reliable now.
Thanks Eve for pointing out the problem.

Important: Please, after updating the program go to Options Menu > Load Default Settings.
I have made some changes to the script and set new default recording adjustments to fit most users.

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!


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
I made some updates.

- Added option to select between Window and Screen CoordMode for Mouse actions and recording (it should be set prior to any recording).
- Found and fixed some other issues regarding mouse recording.

Feel free to leave your feedback. ;)

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!


  • Guests
  • Last active:
  • Joined: --
Seems mouse left click a little buggy here.Click has no effect sometimes.like left button release too fast in reality.

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012

Seems mouse left click a little buggy here.Click has no effect sometimes.like left button release too fast in reality.

Hi there!
I made a few tests here and could not verify your report. I made a 3 clicks sequence and tested with no delays (which would be the maximum speed) and they worked everytime. I tryed both Click and Click Down/Up methods.
Can you explain with more details the commands you used and where? Do you mean during playback or recording?

Thanks!

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!


Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Updated:

Version: 1.64
- Added option to create Step-By-Step Macros: Each command of the list will be executed in sequence everytime you press the Hotkey (as in manual playback).


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!


immunity
  • Members
  • 3 posts
  • Last active: May 27 2012 07:13 AM
  • Joined: 27 May 2012
Pulover -

Can you implement functionality to have it always running in background? Right now it seems that you have to click Start to begin listening for the hotkey to run the macro. Once the macro is ran once, you can no longer hit it again unless you click Start once more. Can you make a setting for always listening, and probably a hotkey for stop listening?

immunity

Pulover
  • Members
  • 1596 posts
  • Last active: Apr 06 2016 04:00 AM
  • Joined: 20 Apr 2012
Hi, immunity!
In fact once you press Start the hotkey you selected is activated with the macro, it will execute the sequence everytime you press the hotkey, you don't need to press start again unless you open (activate) the program window again, only then the hotkey is deactivated, and the key to stop is the Abort Key you choose in the main window too. If it's woking only once as you say you may have found a bug, can you give me more details and tell me what windows version you are running? Do you think it should not deactivate the hotkeys when the gui is shown?
I'm currently working in version 2.0 which will have icon buttons and more features, such as image/pixel search, if statements and sendmessage, if you have any other suggestions, please let me know.

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!


immunity
  • Members
  • 3 posts
  • Last active: May 27 2012 07:13 AM
  • Joined: 27 May 2012
Hey Pulover -

Lucky for both of us, I'm a dev too. I found the bug. When I was recording, I performed an Alt + Right Click. However it didn't record the {LAlt Up} command, and stuck my UI with Alt being held down. so whenever I was hitting F3 to run the script, it really was hitting Alt+F3 and didn't recognize it. I edited the script via notepad and manually added that command, and now it works fine.

I do have another very useful suggestion for you. It is that it would be great if you designed the application to record at what screen position the mouse was at when you Run the Macro, and return the mouse position to that place upon finish of the Macro. That way the macro runs and then returns you to wherever you were upon the Macro's finish.

immunity