ControlClick
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.
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.
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
ControlClick
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.
It sends a mouseclick to a window without having the focus, I wonder if its possible to add it in micromacro hmm.
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
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().
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
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.
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.
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: ControlClick
Can you post the function name with its arguments? Or is it equal to the one from autoit?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.
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
Same mouse functions as before. The only difference is that attach() now attaches mouse input, as well.
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.
Code: Select all
win = findWindow("Example");
attach(win);
local x, y;
while(true) do
x,y = mouseGetPos();
mouseSet(x, y);
mouseLClick();
yrest(100);
end
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: ControlClick
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.
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.
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
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.
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.
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: ControlClick
How's that strange then, it's a good thing.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.
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
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.
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: ControlClick
Also, can you include a function to rename captions of windows?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.
- Administrator
- Site Admin
- Posts: 5318
- Joined: Sat Jan 05, 2008 4:21 pm
Re: ControlClick
There's already a setWindowName() function.
Who is online
Users browsing this forum: No registered users and 0 guests