Sorry nvm

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
Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Sorry nvm

#1 Post by Exempt » Wed Feb 17, 2010 11:30 am

Sorry nvm
Last edited by Exempt on Tue Nov 16, 2010 8:16 pm, edited 1 time in total.

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

Re: Mouse position calculation problem

#2 Post by Administrator » Wed Feb 17, 2010 1:11 pm

Code: Select all

x = (desX / 800) * 8.95429; -- should work
Basically, just cross multiplication of fractions.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Mouse position calculation problem

#3 Post by Exempt » Wed Feb 17, 2010 1:32 pm

That doesn't work because I'm turning mouse coords into ingame coords.

What i was doing is taking my current position - my destination which could be -6 through 6. If it's -4 it's would find the values needed to move my mouse to the coords -4 of my current x position.

Edit: Whats really got me confused right now is the values the mouse is using.

X: 0 - 8.95429718703558E-43
Y: 0 - 1.11671963328117E-37

Y goes from 9.9xxxxxxxxx-38 to 1.11671963328117E-37

I have no idea how to add in he E-37 calculation. I'm not that good at math.. -.-

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

Re: Mouse position calculation problem

#4 Post by Administrator » Wed Feb 17, 2010 4:19 pm

Exempt wrote:That doesn't work because I'm turning mouse coords into ingame coords.
Then reverse what I wrote. You aren't providing ample information for me to have any idea what you're looking for.
I have no idea how to add in he E-37 calculation. I'm not that good at math.. -.-
You don't. Don't worry about it. You really don't need that kind of accuracy.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Mouse position calculation problem

#5 Post by Exempt » Wed Feb 17, 2010 5:18 pm

I will try it reversed, I'm not sure what that will do.

All I'm trying to do is move the mouse in sync with the in game coords

The in game coords are like xxx, yyy. If i click myself in the game i can move around 5 step on the in game coord system so if i wanted to walk 5 steps to the left of 555, I would need to walk to 560. The mouse coords use the floats i said in the last post.
Um... 555 would be the center is the screen (my player position).

What other info should i post?

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

Re: Mouse position calculation problem

#6 Post by 3cmSailorfuku » Wed Feb 17, 2010 5:28 pm

Exempt wrote:I will try it reversed, I'm not sure what that will do.
What he did was using a positive multiplicator (To rewrite the values to your wanted value),
now you just multiplicate it with a negative value to get a lesser value of your source.

Basically he originally wrote a calculation to calculate ingame coords to screen coords, you just use a negative number. (That only works though if the screen resolution is bigger than the value you get ingame)

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Mouse position calculation problem

#7 Post by Exempt » Wed Feb 17, 2010 8:44 pm

Yes but it doesn't even come close to moving the mouse where it should be.

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

Re: Mouse position calculation problem

#8 Post by Administrator » Wed Feb 17, 2010 9:21 pm

Why would 555 be the center of the screen? I thought the game was 800*600. The closest resolution to what you are saying would be 1024*768, with 512 being half the width. Is that what you mean?

In this case, if you wanted to position the mouse in the center of the screen, (512 / 1024)*8.954297 = 4.477. If you write this value to memory, it should position it in the center. What happens?

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Mouse position calculation problem

#9 Post by Exempt » Wed Feb 17, 2010 9:27 pm

555 being the center of the ingame screen, where my character is standing.

there is both ingame coords and mouse coords here.

Exempt
Posts: 197
Joined: Wed Jan 20, 2010 9:55 am

Re: Mouse position calculation problem

#10 Post by Exempt » Wed Feb 17, 2010 9:47 pm

Holy cow, I hate the maker of this game. I had an issue before with the coords because i searched 4byte for the mouse coords and it was a float. Guess what...now the mouse coords are stored as 4byte. I have it working again using the 4byte values and write to a int -.-. Thanks a bunch for the help.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests