Mouse functions broken in V1.0 ?

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
mh2000
Posts: 11
Joined: Mon Apr 20, 2009 5:00 pm

Mouse functions broken in V1.0 ?

#1 Post by mh2000 » Mon Apr 20, 2009 5:39 pm

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.

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

Re: Mouse functions broken in V1.0 ?

#2 Post by Administrator » Mon Apr 20, 2009 7:39 pm

Be more specific. Which functions exactly, which game, and what's your script look like?

mh2000
Posts: 11
Joined: Mon Apr 20, 2009 5:00 pm

Re: Mouse functions broken in V1.0 ?

#3 Post by mh2000 » Tue Apr 21, 2009 3:24 am

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.

mh2000
Posts: 11
Joined: Mon Apr 20, 2009 5:00 pm

Re: Mouse functions broken in V1.0 ?

#4 Post by mh2000 » Tue Apr 21, 2009 7:21 am

hmm... somehow it is working now after the RoM update today.
So thanks for help anyway ,-)

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

Re: Mouse functions broken in V1.0 ?

#5 Post by Administrator » Tue Apr 21, 2009 10:01 am

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.

mh2000
Posts: 11
Joined: Mon Apr 20, 2009 5:00 pm

Re: Mouse functions broken in V1.0 ?

#6 Post by mh2000 » Sat Apr 25, 2009 5:13 pm

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.

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

Re: Mouse functions broken in V1.0 ?

#7 Post by Administrator » Sat Apr 25, 2009 6:05 pm

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.

mh2000
Posts: 11
Joined: Mon Apr 20, 2009 5:00 pm

Re: Mouse functions broken in V1.0 ?

#8 Post by mh2000 » Sun Apr 26, 2009 9:08 am

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.

User avatar
sinman
Posts: 17
Joined: Sat May 16, 2009 5:27 am

Re: Mouse functions broken in V1.0 ?

#9 Post by sinman » Mon May 18, 2009 11:32 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests