How would I setup my scripts to auto update memory addresses

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

Re: How would I setup my scripts to auto update memory addre

#21 Post by Exempt » Sun Mar 07, 2010 12:23 am

I forgot to mention that, I did change it.

Code: Select all

printf("fff\n");
setStartKey(key.VK_DELETE);
setStopKey(key.VK_END);
 
 
function main()

	myProc = openProcess( findProcess("fff") );
	
	local mouseXPat = string.char(0xA1, 0xFF, 0xFF, 0xFF, 0xFF, 0x8B, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF,0x8B, 0x15, 0xFF, 0xFF, 0xFF, 0xFF, 0xA3);
	local mouseXMask = "x????xx????xx????x";
	local mouseXAdd = findPatternInProcess(myProc, mouseXPat, mouseXMask, 0x400000, 0x40000);
	
	if( mouseXAdd == 0 ) then
		printf("Failed to find the pattern in the process.\n");
	end
	
	local mouseYAdd = (mouseXAdd + 0x04);

	
	mouseX = memoryReadInt(myProc, mouseXAdd);
	mouseY = memoryReadInt(myProc, mouseYAdd);
	printf("mouseX Address: 0x%X\n", mouseXAdd);
	printf("mouseY Address: 0x%X\n", mouseYAdd);
	printf("mouseX Value: %d\n", mouseX);
	printf("mouseY Value: %d\n", mouseY);
	
    running = false;
    while(running) do
		--curX = memoryReadInt(myProc, 0x02C85944); --My current X position
        --curY = memoryReadInt(myProc, 0x0157D78C); --My current Y position
	
    end
end
startMacro(main);
Edit: This is what i get when I add the +1:

Code: Select all

Started.
mouseX Address: 0x419906
mouseY Address: 0x41990A
mouseX Value: 109435056
mouseY Value: -659288693
Stopping execution.
Last edited by Exempt on Tue Nov 16, 2010 8:13 pm, edited 1 time in total.

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

Re: How would I setup my scripts to auto update memory addre

#22 Post by Administrator » Sun Mar 07, 2010 6:23 am

Now that you've read MouseX, display it as hex (use 0x%X). I bet it turns out to be 0x685D8B0.

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

Re: How would I setup my scripts to auto update memory addre

#23 Post by Exempt » Sun Mar 07, 2010 8:09 am

I already have it setup like that, It's returning the constant address still.

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

Re: How would I setup my scripts to auto update memory addre

#24 Post by Administrator » Sun Mar 07, 2010 9:15 am

mouseX Value: 109435056
109435056 is 0x685D8B0. Isn't that what you need?

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

Re: How would I setup my scripts to auto update memory addre

#25 Post by Exempt » Sun Mar 07, 2010 1:15 pm

Lol, I can't believe I didn't see that before. I thought when I used read int it would return the value after I found the pattern.

EDIT:
Woot, works now. :D

Code: Select all

Started.
mouseX Address: 0x685D8B0
mouseY Address: 0x685D8B4
mouseX Value: 542
mouseY Value: 191
Stopping execution.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests