I've been wondering what's the best way in MMF2 to make the mouse automatically perform a sequence of clicks upon pressing a button in the program. ControlX was the first thing that jumped to my mind, but I wonder if there's a better and less exhausting way to do that.
I more or less want something like:
* Upon pressing a key or some button
= Perform left click at X1,Y1
= interval for K milisecs
= Perform left click at X2,Y2
I should probably note I don't necessarily want the clicks to be in the game's window. I want to make a little utility to save some clicks in other windows on the screen.
My question still stands for better offers, but I'll ask an additional question.
It appears that the series of events I made that clicks and unclicks, specifically the unclicking (left mouse button up), causes my screen to black out for about 2 seconds. Is there any known reason for that?
Huh, I actually just made a crude little program like this myself.
I found that Cellosoft's Mouse Object is good for getting/setting the absolute X/Y of the mouse. I kinda didn't have the patience to figure out how Control X's mouse movement worked.
But I still used the Control X Object good for simulating the actual click.
I stored all the mouse locations in an array, and called 'em back with a fastloop. I didn't add any delay between the clicks, though. But I guess Windows was okay with that? It seemed to work fine, anyhow.
I have no idea why the screen would black out for you, though. That seems very odd.
If you want to take a look, here's the little program I made.
Click on the Active Object to switch between record and playback, and press G (stupid key choice, I know) to record/replay the clicks.
I am trying to do something similar to this if anyone can help. Sorry for hijacking the thread
I am trying to perform the following simulated keypresses:
and then repeat
I had an active object on screen which i was using purely for a flag and the control x extension and i used these actions:
Upon pressing F9 Toggle Active Object flag 0
Act obj Flag 0 =on
-Control X simulate Key "Space" down
-Control X simulate Key "Space" up
I then repeated the above for all the keys i listed.
I saved it as an executable app (with run while minimized selected) and tried to run it in the background but i got error 139 (or similar) popping up all the time. I had to manually kill it in Task Manager.
How can i achieve this?? It has to run in the background and be able to intercept keystrokes and then affect the app i am using.
Thanks s-m-r and Fifth!
It appears I ended up doing pretty much like Fifth.
Regarding the blackouts, it appears to only happen on Windows 7 (I tried on 2 laptops with 7 and one desktop with XP), and only if I created a series of clicks without moving the mouse at all. I realized that if I even lightly touch the mouse while the clicks are being performed it won't do that.
It's still strange that it happens to begin with...maybe it triggers something in the Windows 7 shutdown procedures...