ControlClick

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

ControlClick

#1 Post by 3cmSailorfuku » Wed Oct 08, 2008 9:58 am

http://www.autoitscript.com/autoit3/doc ... lClick.htm

It sends a mouseclick to a window without having the focus, I wonder if its possible to add it in micromacro hmm.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#2 Post by Administrator » Wed Oct 08, 2008 4:37 pm

Thanks for the info. I was actually thinking about this the other day and got sidetracked so I forgot about it. I'll have to look into how I can possibly get this to work with attach().

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#3 Post by Administrator » Fri Oct 17, 2008 2:14 am

I have just recently added this, but it needs some testing. In my tests, it was able to send mouse input to Metin 2 without stealing focus. Should work, but it's best to make sure.

It will not try to use SendInput when the application has focus, so make sure the program will allow for attached input first. The same will be going for keyboard input in the future (but if you ever need to use both methods, it is really easy to do this, too).

If you (or others) could please test mouse input in an application or two (which allows attached input [use attached keyboard messages to check]) and report back, that would help.

Experimental micromacro.exe attached.

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: ControlClick

#4 Post by 3cmSailorfuku » Fri Oct 17, 2008 3:38 pm

elverion wrote:I have just recently added this, but it needs some testing. In my tests, it was able to send mouse input to Metin 2 without stealing focus. Should work, but it's best to make sure.

It will not try to use SendInput when the application has focus, so make sure the program will allow for attached input first. The same will be going for keyboard input in the future (but if you ever need to use both methods, it is really easy to do this, too).

If you (or others) could please test mouse input in an application or two (which allows attached input [use attached keyboard messages to check]) and report back, that would help.

Experimental micromacro.exe attached.
Can you post the function name with its arguments? Or is it equal to the one from autoit?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#5 Post by Administrator » Fri Oct 17, 2008 5:27 pm

Same mouse functions as before. The only difference is that attach() now attaches mouse input, as well.

Code: Select all

win = findWindow("Example");
attach(win);

local x, y;

while(true) do
  x,y = mouseGetPos();
  mouseSet(x, y);
  mouseLClick();

  yrest(100);
end
One thing that people might think is strange is the mouse movement. If you use mouseSet(32,64), then move your physical mouse pointer to somewhere else, and then use mouseLClick(), the click will take place at (32,64), not where the physical mouse pointer is. This is just something to keep in mind. If you want to generate mouse clicks (in attached mode) where the physical pointer is, just use mouseGetPos() to get the current physical pointer position, then mouseSet() to reposition the virtual mouse pointer.

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: ControlClick

#6 Post by 3cmSailorfuku » Sun Oct 26, 2008 3:15 pm

I just had time to test this completly, it works but I don't get the problem you encountered, metin2 might be the cause of the problem.
Though it greatly depends on how the Game is programmed. I noticed a few difficulties like the mouseclick goes through monsters,
but It's enough for my needs thank you.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#7 Post by Administrator » Sun Oct 26, 2008 6:30 pm

It should not be game dependent. When attached, the mouse will click at the location it was last positioned. So if you use setMouse(32, 32), then actually move your mouse to some other location, it will still click at (32,32). I think I just wasn't clear on this before.

I'm not sure about the clicks "going through" monsters. There's a ton of reasons it could be doing that. I guess the important thing is that it worked. Thanks for the testing.

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: ControlClick

#8 Post by 3cmSailorfuku » Mon Oct 27, 2008 1:32 pm

elverion wrote:It should not be game dependent. When attached, the mouse will click at the location it was last positioned. So if you use setMouse(32, 32), then actually move your mouse to some other location, it will still click at (32,32). I think I just wasn't clear on this before.
How's that strange then, it's a good thing. :lol:

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#9 Post by Administrator » Mon Oct 27, 2008 2:38 pm

Indeed. It is an intended behavior, but I'm sure some people might not quite realize right away why it is not clicking where the user has their mouse.

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: ControlClick

#10 Post by 3cmSailorfuku » Tue Oct 28, 2008 11:36 am

elverion wrote:Indeed. It is an intended behavior, but I'm sure some people might not quite realize right away why it is not clicking where the user has their mouse.
Also, can you include a function to rename captions of windows?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: ControlClick

#11 Post by Administrator » Tue Oct 28, 2008 12:59 pm

There's already a setWindowName() function.

Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests