I've been developing a script for a recent sci-fi mmo; I haven't programmed with mm/lua in a few years (since rombot was first released), so my memory is foggy on a few things:
1) Is there any lag between the script and issuing the command to an attached window? Ie. If you loop 1000 times and each time the mouse moves a pixel, is this infinitely small (ie. 0) or is there some sort of lag (ie. 10ms)?
2) mouseSet - when using absolute coordinates, is this absolute from the edge of the game window or absolute from the edge of the desktop?
Few Questions: Attach, Mouse
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.
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Few Questions: Attach, Mouse
There will be some delay, but it will be small. There is no way around it, and has nothing to do with the language or software being used, but it is just a limitation of how computers work.
mouseSet should accept screen coordinates in attached mode. It will automatically convert them to client coordinates internally.
mouseSet should accept screen coordinates in attached mode. It will automatically convert them to client coordinates internally.
Re: Few Questions: Attach, Mouse
Few more if you don't mind:
1) mouseMove doesn't appear to work correctly, it has some error when moving.
Example:
function main()
mouseSet(0,200);
for x=0,50 do
mouseMove(1,0);
rest(10);
xx,yy=mouseGetPos();
print(x..": "..xx..","..yy);
end
end
startMacro(main);
Returns something like
1: 0,200
..
9: 10,200
..
50: 59,200
It should be xx exactly equals x, but it seems as it somehow is rounding the pixel value up or something?
2) Attaching and MouseSet/Move: I've noticed that even when attached, the mouseset/move affects the mouse outside of the program. Does this mean the program that mm is attaching to doesn't work with mm? Even if the attach is successful, how can I make it such that only the mouse moves/sets/whatever is registered within the program and not the desktop?
Thanks
1) mouseMove doesn't appear to work correctly, it has some error when moving.
Example:
function main()
mouseSet(0,200);
for x=0,50 do
mouseMove(1,0);
rest(10);
xx,yy=mouseGetPos();
print(x..": "..xx..","..yy);
end
end
startMacro(main);
Returns something like
1: 0,200
..
9: 10,200
..
50: 59,200
It should be xx exactly equals x, but it seems as it somehow is rounding the pixel value up or something?
2) Attaching and MouseSet/Move: I've noticed that even when attached, the mouseset/move affects the mouse outside of the program. Does this mean the program that mm is attaching to doesn't work with mm? Even if the attach is successful, how can I make it such that only the mouse moves/sets/whatever is registered within the program and not the desktop?
Thanks
- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Few Questions: Attach, Mouse
Code: Select all
mouseMove doesn't appear to work correctly, it has some error when moving.
That code you have shown isn't using attached input. You aren't attaching to anything, so it is going to move the physical mouse cursor. The 'virtual mouse' that MicroMacro uses doesn't actually move anything; it only keeps track of coordinates and uses those only when passing events to the attached process.
Additionally, mouseGetPos() returns the coordinates of the actual mouse cursor, not the virtual mouse. I suppose that could be changed, but then that would add complications if you want to actually get the real mouse position in attached mode.
For accuracy and control reasons, it is better to use mouseSet() than mouseMove(). The only time you would really want to use mouseMove() is if the game is looking for movement events instead of the mouse position. I know it seems strange at first because, visually, they seem almost the same, however, they do send (slightly) different event IDs. You could accomplish what you are doing like so:
Code: Select all
function main()
attach( findWindow("SomeGame*") );
mouseSet(1, 200);
for j = 0,50 do
mouseSet(1 + j, 200);
rest(10);
end
end
startMacro(main, true);
Who is online
Users browsing this forum: No registered users and 1 guest