Page 2 of 2

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

Posted: Sun Mar 07, 2010 12:23 am
by Exempt
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.

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

Posted: Sun Mar 07, 2010 6:23 am
by Administrator
Now that you've read MouseX, display it as hex (use 0x%X). I bet it turns out to be 0x685D8B0.

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

Posted: Sun Mar 07, 2010 8:09 am
by Exempt
I already have it setup like that, It's returning the constant address still.

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

Posted: Sun Mar 07, 2010 9:15 am
by Administrator
mouseX Value: 109435056
109435056 is 0x685D8B0. Isn't that what you need?

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

Posted: Sun Mar 07, 2010 1:15 pm
by Exempt
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.