The Daily Click ::. Forums ::. Klik Coding Help ::. Automatically performing a sequence of clicks
 

Post Reply  Post Oekaki 
 

Posted By Message

Ecstazy



Registered
  04/01/2002
Points
  179

VIP Member
2nd August, 2011 at 20:55:13 -

Hey everybody
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
= etc.

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.

 
Amongst Strangers
http://www.create-games.com/project.asp?id=1445

Ecstazy



Registered
  04/01/2002
Points
  179

VIP Member
3rd August, 2011 at 00:27:19 -

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?

 
Amongst Strangers
http://www.create-games.com/project.asp?id=1445

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
3rd August, 2011 at 00:57:58 -

How about this instead...?

ALWAYS add 1 to Alterable Value 1 (choose some Active Object and use one of its available Alterable Values for this)

IF user clicks Left Mouse Button
THEN set Alterable Value to 0

IF Alterable Value = 1
THEN (the effect of clicking the Left Mouse Button) at X1, Y1

(then you simply set up an event for each interval of the Alterable Value you're using)

IF Alterable Value = 50
THEN (the effect of clicking the Left Mouse Button) at X2, Y2

IF Alterable Value = 100
THEN (the effect of clicking the Left Mouse Button) at X3, Y3

...And so on. This seems a lot simpler than what you're trying to do with the ControlX extension or whatever.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
3rd August, 2011 at 03:24:16 -

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.
http://www.l-ames.com/logan/mouse-trick.zip

 
Go Moon!

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
3rd August, 2011 at 17:19:12 -

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:

Space
W
W
Ctrl
Shift

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.

 
n/a

Ecstazy



Registered
  04/01/2002
Points
  179

VIP Member
4th August, 2011 at 11:41:47 -

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...

Edited by Ecstazy

 
Amongst Strangers
http://www.create-games.com/project.asp?id=1445
   

Post Reply



 



Advertisement

Worth A Click