Page 1 of 1

Pawn.lua Error - Please help

Posted: Wed Jan 19, 2011 7:36 am
by iggypop
Hello, I have the following Problem (When my character are go in or out Instances):

Rombot crashes with this Error: C:/micromacro/scripts/rom/classes/pawn.lua:279: Error reading memory in CPawn:update()

Revision is r560

Is there anybody who can help me?


log:

stack traceback:
C:/micromacro/scripts/rom/classes/pawn.lua:279: in function 'update'
C:/micromacro/scripts/rom/classes/player.lua:2277: in function 'update'
C:/micromacro/scripts/rom/classes/player.lua:1783: in function 'moveTo'
scripts\rom\bot.lua:648: in function 'foo'
C:\micromacro\lib\lib.lua:538: in function <C:\micromacro\lib\lib.lua:536>

----------TRACEBACK END----------

Wed Jan 19 13:33:55 2011 : C:/micromacro/scripts/rom/classes/pawn.lua:279: Error reading memory in CPawn:update()
Wed Jan 19 13:33:55 2011 : Execution error: Runtime error

-----------

Re: Pawn.lua Error - Please help

Posted: Wed Jan 19, 2011 9:14 am
by JackBlonder
Try to add

Code: Select all

waitForLoadingScreen(); 
where you leave the instance

Re: Pawn.lua Error - Please help

Posted: Wed Jan 19, 2011 11:55 am
by iggypop
I have already tried this. it works for some time and then same Error :(

Re: Pawn.lua Error - Please help

Posted: Wed Jan 19, 2011 5:49 pm
by Administrator
Well, at least you read the forum topic and totally followed the rules.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 1:34 am
by rock5
iggypop wrote:it works for some time and then same Error :(
This is the expected behavior. If you have a wp file that goes in and out of instances, it will eventually crash as the game client doesn't manage memory too well.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 2:09 am
by Giram
Would it be possible to logout or teleport if we get this error?

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 2:34 am
by rock5
Giram wrote:Would it be possible to logout or teleport if we get this error?
Sorry I thought you said the game crashed.

So the game doesn't crash? It's really hard to pinpoint the cause of these errors. I think it usually has something to do with a strain on memory, like running too many clients at once or using other memory intensive programs while rombot is running. I can't be sure though.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 2:40 am
by lisa
I have exact same error after resurection, CPawn:update()
I'm thinking the last SVN update has issues, I noticed the micromacro.exe and micromacro.cpb weren't in the SVN at all. I posted it on the micromacro forum support.
Not sure if any other files were missing.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 2:52 am
by Giram
I was trying to set

Code: Select all

player:logout("true");

to pawn.lua...

Code: Select all

	if( self.Alive == nil or self.HP == nil or self.MaxHP == nil or self.MP == nil or self.MaxMP == nil or
		self.MP2 == nil or self.MaxMP2 == nil or self.Name == nil or
		self.Level == nil or self.Level2 == nil or self.TargetPtr == nil or
		self.X == nil or self.Y == nil or self.Z == nil or self.Attackable == nil ) then

		error("Error reading memory in CPawn:update()");
		player:logout("true");
	end
...but it didn't work. So it's not possible to do this if we get memory reading error? That could be wrong place also but i don't know where in code bot stops if we get error.

I did waypoint that involves running in instance and i got that Error reading memory in CPawn:update() very randomly and i think i should do something else. Yesterday it crashed twice in hour but run well this night and at morning it was running and few mins later it was stopped and died.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 2:58 am
by Administrator
...but it didn't work.
Well, the error function is being called before the player:logout function in your code. error() stops execution, therefore, the call to player:logout() was never reached. That, and I'm not sure why you have true in quotes. You probably don't want to pass a string.

Re: Pawn.lua Error - Please help

Posted: Thu Jan 20, 2011 3:15 am
by Giram
I thought that was just error message. I placed logout above it and removed "" from logout. Going to test it now to see how its working.

Re: Pawn.lua Error - Please help

Posted: Fri Jan 21, 2011 2:10 am
by Giram
Finally got that pawn.lua error.

I added logout when it finds nil value and bot would stop working. So when it happened it logged out and i didn't die and that was what i hoped for. There was also post where some added checks for nil values and i have those added also. Dunno if it helps but haven't got many errors and was suprised that didn't get any errors yesterday with pawn.lua. I add this file if someone wants to try it. Modified from line 262 to 297.

Only thing what this didn't do was post that pawn error. There should be print before logout or something.

Code: Select all

error("Error reading memory in CPawn:update()");
Edit: If setting LOGOUT_SHUTDOWN is true then it will shutdown your pc i think. If its false then it should just go to character select screen.

Code: Select all

<option name="LOGOUT_SHUTDOWN"		value="true" />

Re: Pawn.lua Error - Please help

Posted: Fri Jan 21, 2011 7:05 am
by jduartedj
Actually I've encountered a CPawn error afew times in middle of botting with no apparent reason!

Re: Pawn.lua Error - Please help

Posted: Tue Feb 08, 2011 6:00 pm
by del3e7
jduartedj wrote:Actually I've encountered a CPawn error afew times in middle of botting with no apparent reason!

I have this same problem, I just get a CPawn error in the middle of botting with no reason, and I don't know how to pursue fixing it. Anyone have any ideas what might cause this?

Re: Pawn.lua Error - Please help

Posted: Sun Mar 13, 2011 8:08 pm
by 666morpheus
del3e7 wrote:
jduartedj wrote:Actually I've encountered a CPawn error afew times in middle of botting with no apparent reason!

I have this same problem, I just get a CPawn error in the middle of botting with no reason, and I don't know how to pursue fixing it. Anyone have any ideas what might cause this?
Same here - rom/classes/pawn.lua:333: Error reading memory in CPawn:update()

Re: Pawn.lua Error - Please help

Posted: Mon Mar 14, 2011 7:39 am
by lisa
I might have stumbled across what is happening by chance.

I had bot running and clicked on ground (which drops target) and got cpawn error instantly. I'm guessing it tried to update the target and there wasn't a target and so got the error.
So I am thinking with the new edit box thing and using escape, if it does escape when there is no boxes up then it will drop target and cause the error. Does this sound like what might be happening?

Re: Pawn.lua Error - Please help

Posted: Mon Mar 14, 2011 10:11 am
by rock5
lisa wrote:I might have stumbled across what is happening by chance.

I had bot running and clicked on ground (which drops target) and got cpawn error instantly. I'm guessing it tried to update the target and there wasn't a target and so got the error.
So I am thinking with the new edit box thing and using escape, if it does escape when there is no boxes up then it will drop target and cause the error. Does this sound like what might be happening?
Actually, it's easy to test. I just removed the edit box changes and clicked the ground while the bot was running and still got the error.

By the way, there is a possible fix being explored at this post
www.solarstrike.net/phpBB3/viewtopic.php?p=19274#p19274
It needs more testing so if you are having this error, try it out. Just replace pawn.lua.

Re: Pawn.lua Error - Please help

Posted: Mon Mar 14, 2011 10:25 am
by 666morpheus
rock5 wrote:
lisa wrote:I might have stumbled across what is happening by chance.

I had bot running and clicked on ground (which drops target) and got cpawn error instantly. I'm guessing it tried to update the target and there wasn't a target and so got the error.
So I am thinking with the new edit box thing and using escape, if it does escape when there is no boxes up then it will drop target and cause the error. Does this sound like what might be happening?
Actually, it's easy to test. I just removed the edit box changes and clicked the ground while the bot was running and still got the error.

By the way, there is a possible fix being explored at this post
http://www.solarstrike.net/phpBB3/viewt ... 274#p19274
It needs more testing so if you are having this error, try it out. Just replace pawn.lua.
works so far, no errors anymore. Thanks a lot!