Inventory Control Specialist
Guest
|
Post by Inventory Control Specialist on Mar 29, 2019 12:41:50 GMT
First of all, this program is working wonders for me. Thanks for developing it!
Now to business: I am on a quest to find the quickest timing for Keypress, Click down, Click Release, and Mouse movement actions that does not sacrifice near perfect accuracy.
I have messed around some and just settled for 200ms for Keypress, Click down, and Click Release actions and 1ms for mouse movement actions, but I am looking at a project that will require 10120 repetitions of a currently 10.452 second macro (That's 29.37 hrs straight runtime) so clearly I would love to shave down some time while making sure I don't have to do a lot of even more time consuming manual corrections.
Has anyone else been more persistent in finding optimal timing?
Thanks!
|
|
Inventory Control Specialist
Guest
|
Post by Inventory Control Specialist on Mar 29, 2019 12:58:07 GMT
Just trimmed down 1.5 sec per repetition by trimming down the mouse movement actions on the drag select recordings. Even though I set the timing on each register to 1 ms the sum timing of the entries was much larger than math would indicate, and leaving a 4 coordinate drag trail (instead of the 30-40 initially recorded) doesn't effect the accuracy.
Still want the optimal timing for keystrokes and clicks though.
|
|
Inventory Control Specialist
Guest
|
Post by Inventory Control Specialist on Mar 29, 2019 20:22:56 GMT
Ok, so all my keypresses are 100% accurate at 1 ms, but I can't get my click and drags to be accurate with any sort of consistency.
|
|
|
Post by Steve on Mar 30, 2019 4:33:29 GMT
Wow so your keypresses are 100% accurate at 1 ms during playback? that seems fast for playback of keys presses. usually i go a minimum of 100 ms. Mouse can be trimmed down to 0ms, it ends up pushing the mouse around as fast as the program can read the code out. Clicks can be tricky. If you just need a click down and release without a drag just do a: 1 | 500 | 500 | 0 | Left Click Left Click without the down and release. A 'Left Click' does both the down and release a lot faster and cleaner. Obviously if your dragging controls around the screen you need the down and release for the press.
|
|
Inventory Control Specialist
Guest
|
Post by Inventory Control Specialist on Apr 2, 2019 12:47:21 GMT
Basically my macro is copying inventory data from the IBM power9 system my company uses and pasting it into an excel table. This was the version I settled with Friday:
1 | 1216 | 16 | 200 | Left Click Down
2 | 1216 | 16 | 200 | Left Click Release
3 | 1216 | 16 | 1 | Keypress Ctrl+ | c
4 | 1216 | 16 | 1 | Keypress Alt+ | tab
5 | 1216 | 16 | 1 | Keypress tab
6 | 1216 | 16 | 1 | Keypress Ctrl+ | v
7 | 1216 | 16 | 1 | Keypress enter
8 | 1216 | 16 | 1 | Keypress Alt+ | tab
9 | 1216 | 16 | 1 | Keypress right
10 | 1216 | 16 | 1 | Keypress escape
11 | 1216 | 16 | 1 | Keypress Alt+ | tab
12 | 3298 | 353 | 200 | Left Click Down
13 | 3302 | 353 | 200 | Mouse Movement
14 | 3377 | 349 | 1 | Mouse Movement
15 | 3380 | 349 | 1 | Mouse Movement
16 | 3380 | 349 | 200 | Left Click Release
17 | 3380 | 349 | 1 | Keypress Ctrl+ | c
18 | 3380 | 349 | 1 | Keypress Alt+ | tab
19 | 3380 | 349 | 1 | Keypress Ctrl+ | v
***20 | 3380 | 349 | 1 | Keypress tab
21 | 3380 | 349 | 1 | Keypress Alt+ | tab
22 | 3380 | 349 | 1 | Keypress Enter
***23 | 2538 | 292 | 200 | Left Click Down
24 | 2541 | 292 | 150 | Mouse Movement
25 | 2545 | 292 | 1 | Mouse Movement
27 | 2568 | 294 | 1 | Mouse Movement
29 | 2627 | 294 | 1 | Mouse Movement
31 | 2657 | 294 | 1 | Mouse Movement
33 | 2703 | 294 | 1 | Mouse Movement
35 | 2747 | 297 | 1 | Mouse Movement
37 | 2784 | 297 | 1 | Mouse Movement
39 | 2861 | 300 | 1 | Mouse Movement
42 | 2911 | 299 | 1 | Mouse Movement
43 | 2925 | 297 | 200 | Left Click Release
44 | 2936 | 300 | 1 | Keypress Ctrl+ | c
45 | 2936 | 300 | 1 | Keypress Alt+ | tab
46 | 2936 | 300 | 1 | Keypress f2
47 | 2936 | 300 | 1 | Keypress Ctrl+ | v
48 | 2936 | 300 | 1 | Keypress enter
49 | 400 | 300 | 1 | Keypress home I had tested the keypress timing in word typing abcdefghijklmnopqrstuvwxyz and Shift+left selecting half the string, and ctrl+b bolding the selection to simulate the compound key presses. In word the macro did not miss a single keypress at 1ms over 100 repetitions, so I figured 1ms was safe for keypresses.
The Mouse drags (to select data for copying) was more complicated. I found that sometimes the left click down or the left click release were not registering, but after tinkering more I discovered that I had removed too much of the mouse movement entries. The mouse movement entries are fine at 1ms but I had left only 3 as a skeleton for the drag to follow and for the longer selection that was messing with the accuracy.
When I left work Friday I set the version above to run 9000 times and then queued a macro to save the spreadsheet, close all windows and sleep the computer. (I found that the macro is unable to force itself to close in order to complete the full shut down process, but it can sleep the system).
When I came in Monday and checked the results there were occasional (25-30?) inaccuracies that I had to fix stemming, as far as I can tell, from the two lines above preceded by three asterisks ***. I look forward to further exploring the program and learning how to further optimize it.
|
|
|
Post by Steve on Apr 3, 2019 5:53:11 GMT
Thanks for the detailed reply. Again, I am surprised that the 1ms timing for any keypress is giving you any form of consistent accuracy. In my experience it rarely, if ever, works with a 1ms delay between keypress's. It's fine for a fast mouse press. Timing for mouse movements only matters if you are doing the drag and drop style work you are doing.
If I can make a suggestion or two: - remove all mouse movement unless you really need it. have you considered an alternative within MMM for selecting and copying data? - unless you really need the 1ms change the value for at least 100ms +
|
|
Inventory Control Specialist
Guest
|
Post by Inventory Control Specialist on Apr 3, 2019 14:37:11 GMT
I have won.
I eliminated the mouse selections and simply had mmm copy the whole page and paste it into excel, where I used MID, LEFT and RIGHT text formulas to instantaneously extract the data I needed and then mmm triggers an excel macro with ctrl+k which copies and pastes the mined data into a separate sheet serving as a database and then deletes the block of text and preps the screen for the next paste from the source program. I found that with so few actions in my mmm macro timing everything at 200 generally gave the excel macros and formulas enough time to operate with very generous breathing room, and while I could definitely make it run faster, my intention was to let it run overnight without supervision, so accuracy was more important than speed. I queued this mmm macro to run 6000 times, then had another macro to save the spreadsheet and trigger an excel macro that emailed me the current status of the transfer. I looped that set of macros twice then queued the shutdown macro. When I came in this morning I found that the macro pretty much gave me 100% accuracy until 3000 repetitions into the second set of this macro, or the 9000th overall repetition, at which point it started to degrade for a reason I have not discovered yet.
1 | 2949 | 653 | 200 | Left Click Down 2 | 2949 | 653 | 200 | Left Click Release 3 | 2796 | 818 | 200 | Keypress Ctrl+ | c 4 | 1300 | 24 | 200 | Left Click Down 5 | 1300 | 24 | 200 | Left Click Release 6 | 2796 | 818 | 200 | Keypress Ctrl+ | v 7 | 2796 | 818 | 200 | Keypress up 8 | 2796 | 818 | 200 | Keypress Ctrl+ | k 9 | 2949 | 653 | 200 | Left Click Down 10 | 2949 | 653 | 200 | Left Click Release 11 | 2796 | 818 | 200 | Keypress f10
I found that using mouse clicks tor transfer back and forth between windows is more reliable than alt+tab because any alert window that pops up throws everything completely haywire when alt+tab window switching.
Have you found any effect on playback accuracy after, say, 7 hours of running a macro nonstop?
|
|
|
Post by Steve on Apr 13, 2019 5:25:49 GMT
I can't say I often run complex macro's on loops for that long. The macro's I have run for several hours on loops, like yours, have been logic driven and often wait for queues from the OS to perform conditions. I have found that disabling the event log (the default) does give greater performance overall. I would defiantly disable it for macros running continuously.
If you don't need a 'click and drag' event then you could change your 'Left Click Down' and 'Left Click Release' to just 'Left Click'. A 'Left Click' performs a full click down and up a lot cleaner. Also it will help with performance overall.
|
|