18 September 2015, 03:45 | #1 |
Posts: n/a
|
Automatic mouseclick and screenshot every minute.
I am playing Sim City on WinUAE. At the start of the game you choose your initial city layout from an infinite set of possible maps. The game loads a random city map layout at startup and it gives you the options to either "Use This Map" or "Generate New Map." I want to continuously click on "Generate New Map" and take a screenshot of the generated map. So I will hover my mouse cursor over the "Generate New Map" button, then the emulator will simulate a mouse click to generate a new map, I will wait ten seconds for the map to be generated, then a screenshot/PrintScreen will be taken. Then the process will repeat: mouse-click, wait, screenshot, mouse click, wait, screenshot on to infinity. How can I do this?
|
18 September 2015, 17:43 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Go to the WinUAE input panel and bind F11 or something to WinUAE's screenshot function, and use one of the many macro/automation programs out there to record and replay clicking the mouse and pressing F11.
|
23 September 2015, 01:59 | #3 |
Posts: n/a
|
Arrrgh, I am so close! I mapped the SEMICOLON key to "Screenshot (file)" and the LBRACKET key to "Joy1 Fire / Left Mouse Button." I start the game up and I type ;[;[ onmy keyboard and it generates the new map and saves the screenshot and everything works great. The problem comes when I launch my special little C# program that I wrote that uses the SendKeys command to type nothing but ;[;[;[;[ every 30 seconds. The program works great when Notepad is activated, and types ;[;[;[ correctly, but when I activate the WinUAE window it doesn't work! WinUAE must be recognizing that an external program is trying to interfere with the program. Anybody have any ideas?
|
23 September 2015, 12:59 | #4 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
If you want to do it programmatically then SendInput() works fine, WinUAE will see those input events.
|
23 September 2015, 13:55 | #5 |
Registered User
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
|
Simple example with AutoHotkey (untested!):
Code:
F11::ExitApp ; F11 to quit Sleep, 5000 Loop { SendInput, {LButton} Sleep, 10000 SendInput, {;} Sleep, 60000 } |
23 September 2015, 16:56 | #6 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Did you try mapping events using "WinUAE null keyboard" instead of normal keyboard device? (In input panel device list)
It is default fallback virtual keyboard used when WinUAE receives keyboard event without keyboard identifier (which usually means it was injected event). |
24 September 2015, 01:58 | #7 |
Posts: n/a
|
Mapping using "WinUAE null Keyboard" with my special C# program did not work. I have never used SendInput or AutoHotKey before, so I will look into them next.
|
24 September 2015, 14:01 | #8 |
Retro Gamer
Join Date: Jan 2005
Location: Underworld
Age: 51
Posts: 4,058
|
Just use MiniMouseMacro, to setup what you want to do on screen and hotkeys.
http://sourceforge.net/projects/minimousemacro/ It is easy to program and to edit... |
26 September 2015, 13:28 | #9 |
Posts: n/a
|
None of these are working, I've tried Mini Mouse Macro and AutoHotKeys, they're all running into the same problem: they won't run when the focus is on the WinUAE window, and I've selected "WinUAE null keyboard." They work when Notepad is focused though. What am I missing?
|
26 September 2015, 13:30 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,504
|
Do you see any log messages if you run winuae with -log -inputlog 1 command line parameters? 1 = log PC keyboard events. ("winuae.exe -log -inputlog 1")
|
26 September 2015, 19:12 | #11 |
Posts: n/a
|
I was able to run the WinUAE program with logging in the cmd window. I see the log messages when I type out the ; [ ; [ keys, as expected. But I do not see any log messages when running Mini Mouse Macro. So, no, I think WinUAE is still not "seeing" the input.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiexpress Sysop in a Minute or More. | Black Beard | support.Apps | 4 | 03 July 2014 14:31 |
Last minute advice on my a4000 | VermillioN | support.Hardware | 14 | 06 November 2007 10:33 |
15 minute Amiga 500 commercial | gimbal | Nostalgia & memories | 7 | 23 October 2006 20:23 |
Minor request (1 minute change). | Jim | project.EAB | 1 | 11 December 2004 23:43 |
REQ: Automatic resolution change ; automatic resolution detection | Borg_Number_One | request.UAE Wishlist | 3 | 21 August 2004 14:16 |
|
|