Page 1 of 1
Mouse functions broken in V1.0 ?
Posted: Mon Apr 20, 2009 5:39 pm
by mh2000
Hi,
it seems that the mouse functions are somehow broken in version 1.0. They where working in 0.99 perfectly
fine. I'm not sure, but I suppose the restructuring of macro.h causes the issue (as this is the only major
difference I could find.)
Is there a chance to get a running version 1.01 ?
thanks,
mh.
Re: Mouse functions broken in V1.0 ?
Posted: Mon Apr 20, 2009 7:39 pm
by Administrator
Be more specific. Which functions exactly, which game, and what's your script look like?
Re: Mouse functions broken in V1.0 ?
Posted: Tue Apr 21, 2009 3:24 am
by mh2000
Hi,
the game is Runes of Magic and I have following Testcode, which works in
micromacro v0.99 but not in 1.0:
Code: Select all
function main()
while( true ) do
if( keyPressed( key.VK_NUMPAD1 ) ) then
local mx, my = mouseGetPos();
mouseSet(mx+50, my);
mouseLClick();
cprintf(cli.green, "Mouse position: (%d, %d)\n", mx, my);
end;
yrest(100);
end
end
startMacro(main);
The correct Mouse position is displayed in 1.0, but no click is actually happening
in the game.
By the way: the RoM Sendmail script also only works in 0.99 (see comment of haura)
http://solarimpact.servegame.com/phpBB3 ... ?f=3&t=222
mh.
Re: Mouse functions broken in V1.0 ?
Posted: Tue Apr 21, 2009 7:21 am
by mh2000
hmm... somehow it is working now after the RoM update today.
So thanks for help anyway ,-)
Re: Mouse functions broken in V1.0 ?
Posted: Tue Apr 21, 2009 10:01 am
by Administrator
At first, I thought it would have been due to changes in the attach() function, but after seeing that script, I'm not sure what would have done it. My only guess would have to be that the mouse button wasn't being "held" long enough for the game to detect it, so a simple setMouseDelay(100) might have done it. Good thing you've got it resolved. If you notice this problem again, let me know.
Re: Mouse functions broken in V1.0 ?
Posted: Sat Apr 25, 2009 5:13 pm
by mh2000
Hi Admin,
If I use the "attach()" function, then the mouse handling does actually not work in RoM. I suppose
this function was invented to just post messages to a specified window, but it seems, that the
events are send to somewhere, where RoM cannot use them.
Can you please check this?
regards,
mh.
Re: Mouse functions broken in V1.0 ?
Posted: Sat Apr 25, 2009 6:05 pm
by Administrator
It's not a bug. It just has to do with the APIs that RoM uses. Different input routines require different input injection routines.
You can get around this easily. Just detach from the process before you do mouse input.
Code: Select all
detach(); -- Detach from RoM
mouseLClick(); -- Make a mouse click
attach(romWin); -- Re-attach so it picks up our keyboard input in attached state.
Re: Mouse functions broken in V1.0 ?
Posted: Sun Apr 26, 2009 9:08 am
by mh2000
Hiho,
yep, that was also my idea, but unfortunately, after detach() and attach() you need to click
with the mouse manually to the RoM client - Any clues about this?
Maybe it is possible to split the function into attachKeyboard() and attachMouse() ?
thanks,
mh.
Re: Mouse functions broken in V1.0 ?
Posted: Mon May 18, 2009 11:32 am
by sinman
Hi all, I've got same problem with Fiesta Online script that worked on micromacro 0.9.4. I comment "attach" and "detach" lines and it works fine.