Page 1 of 1

[HELP] Help with reading memory

Posted: Fri Mar 07, 2008 11:48 am
by 3cmSailorfuku
Suggestions & fixes please.
It's my first script. That's why it looks stupid and got stolen snippets.

Code: Select all

IsMenuOpen_addr = 0x00108CC0;

function main()
  attach( findWindow("DJMAX") );
  proc = openProcess( findProcess("DJMAX") );
  setPriority(PRIORITY_HIGH);

  while(true) do
  IsMenuOpen = memoryReadInt(proc, IsMenuOpen_addr);
    if( IsMenuOpen() > 1 ) then
      keyboardPress(VK_D);
      keyboardPress(VK_F);
      keyboardPress(VK_SPACE);
      keyboardPress(VK_J);
      keyboardPress(VK_K);
	end
	if( IsMenuOpen() == 1 ) then
	mouseSet(233, 451);
	mouseLClick();
	end
    yrest(50);
  end
end

startMacro(main, true);
I think the error I got in MicroMacro was that I cant call a global value or something like that.
Too lazy to check it now.

Re: [HELP] Help with reading memory

Posted: Fri Mar 07, 2008 8:08 pm
by Administrator
It's hard to say without the log. At first look, everything looks fine. The only thing I see that could be a problem is startMacro(). You're calling it with the second parameter, which I just added for the Perfect World bot version. If you aren't using the MicroMacro included with that, then that's probably what the error is. I hope to update again this weekend (0.96c), it just needs a little more testing.

EDIT: Oh, duh. You're calling IsMenuOpen(). IsMenuOpen is a variable, you don't want to call it as a function. Just remove the ().

Re: [HELP] Help with reading memory

Posted: Sat Mar 08, 2008 6:07 am
by 3cmSailorfuku
elverion wrote:It's hard to say without the log. At first look, everything looks fine. The only thing I see that could be a problem is startMacro(). You're calling it with the second parameter, which I just added for the Perfect World bot version. If you aren't using the MicroMacro included with that, then that's probably what the error is. I hope to update again this weekend (0.96c), it just needs a little more testing.

EDIT: Oh, duh. You're calling IsMenuOpen(). IsMenuOpen is a variable, you don't want to call it as a function. Just remove the ().
Yea I am using the pw edition ;D And thanks, that was some silly mistake I did. Better not copy again from your bots lol.