Page 1 of 1

Pause on reading from memory

Posted: Thu Sep 06, 2012 8:05 am
by gloover
Hey rock, greetingz lisa.

I'm using a modified version of RBAssist - its darned with some functions reading the curent speed from the memory etc.
The problem is by using the teleport, entering the house/guld castle ... everything wich is causing the loading screen - crashing the bot, because it cannot read the memory during the loading screen. Is there any possibility to prefent this? May any check inside the loop of RBASSIST looking for loading-screen?

thx in advance!

Re: Pause on reading from memory

Posted: Thu Sep 06, 2012 8:34 am
by lisa
In party.lua I use this at the start of the loop.

Code: Select all

		if memoryReadBytePtr(getProc(),addresses.loadingScreenPtr, addresses.loadingScreen_offset) ~= 0 then
			repeat
				printf("loading screen has appeared, waiting for it to end.\n")
				yrest(1000)
			until memoryReadBytePtr(getProc(),addresses.loadingScreenPtr, addresses.loadingScreen_offset) == 0
		end

Re: Pause on reading from memory

Posted: Thu Sep 06, 2012 9:03 am
by gloover
YES! that is it - thanx lisa!

Re: Pause on reading from memory

Posted: Thu Sep 06, 2012 10:04 am
by rock5
There's a new function called isInGame() that returns true only if fully in the game. The loadingscreen flag only indicates if the loading screen is visible. It wont detect if you are at the login or character selection screen like when changing character.

So maybe something like

Code: Select all

while not isInGame() do
        printf("Not currently in game, waiting for it to reenter.\n")
        yrest(1000)
end