pawn.lua:272: error reading memory in Cpawn:update<>

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#21 Post by rock5 » Mon Nov 01, 2010 6:46 pm

checkii wrote:I been having some cPwan:update error. Though my code is 274.

I tried a few couple of things to avoid it. At first I thought it was during load time. But now it happens in the middle of a way point and sometimes its completely random as far as I can tell. The player getting stuck seems to be a quickturn=true problem specially at high speeds (mount). Turning it off seems to help.

Here is the craziest thing. Golden egg farm doesn't seem to ever get this error. I think it only applies to combat way points. It fails on travel (with aggro) and regular way points.
Miller's Farm is a small area so it would take less memory and less communication with the server compared to the outer world.

Probably what this means is when running scripts in more crowded areas you might have to reduce the number of clients you run at once.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#22 Post by checkii » Tue Nov 02, 2010 1:56 am

I did some more testing and i found a safe way to avoid this error when running regular way points (without reducing the number of clients running).

1) I turned quick turn off. I am not sure if getting stuck will cause this error, but better slow than crash. The strangest thing about quick turn, it will get you stuck sometimes even when there is nothing there. Sometimes quick turn causes the player to turn left and right in place trying to face the direction of the next way point. If after enough left-right turns, it will do the player:unstick() routine. And that compounds the situation, getting your character stuck permanently.

2) Minimize your all client window and don't keep the client OR micromacro on an active window. This is like a temp fix designed to place more lag on the client so it won't update as fast. Call it artificial yrest/lag if you want. However the downside is some commands might not make it through, such as ChoiceOptions(). You can call it twice or add more redundancy if you want, at least you won't cash.

xtremeuser
Posts: 22
Joined: Thu Sep 30, 2010 8:25 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#23 Post by xtremeuser » Tue Nov 02, 2010 5:13 am

I keep clients on windowed mode 800x600, hoping to use less memory, I keep all clients minimised etc. I get this error when Im running 1 or 2 clients only, so I don't think its a memory issue. Lately I been running 7 clients, usually 1 - 3 get hit with the error by morning. As i said tho I tested running only 2 clients, and still got the error. Still not sure why I get it a lot. Oh and I don't use quickturn, turns too quick and if i'm watching it, hurts my eyes lol so I have it turned off

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#24 Post by rock5 » Tue Nov 02, 2010 7:04 am

xtremeuser wrote:I keep clients on windowed mode 800x600, hoping to use less memory, I keep all clients minimised etc. I get this error when Im running 1 or 2 clients only, so I don't think its a memory issue. Lately I been running 7 clients, usually 1 - 3 get hit with the error by morning. As i said tho I tested running only 2 clients, and still got the error. Still not sure why I get it a lot. Oh and I don't use quickturn, turns too quick and if i'm watching it, hurts my eyes lol so I have it turned off
Just curious, how much memory do you have?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#25 Post by swietlowka » Tue Nov 02, 2010 7:20 am

xtremeuser wrote:I keep clients on windowed mode 800x600, hoping to use less memory, I keep all clients minimised etc. I get this error when Im running 1 or 2 clients only, so I don't think its a memory issue. Lately I been running 7 clients, usually 1 - 3 get hit with the error by morning. As i said tho I tested running only 2 clients, and still got the error. Still not sure why I get it a lot. Oh and I don't use quickturn, turns too quick and if i'm watching it, hurts my eyes lol so I have it turned off
If u want more windows use setting with 100x100 window and lowest graphics and range, i posted my config somewhere
(you need to mannually set it in config file)

Herbee
Posts: 4
Joined: Thu Oct 21, 2010 9:41 am

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#26 Post by Herbee » Wed Nov 03, 2010 5:42 am

Mates, moar offtopic:

I'm runnin at 14 instances on my laptop. He's got 4gb RAM, an sum dualcore CPU (think intel centrino 2@3ghz) and a gefoce 9650m gt. This 3 boy takes those 14 instances and bashes them super-stable for 24h without faulting. So no one needs a super-heavy uptodate system for excessive botting in ROM :D

I think on germangold's machine i would run like 30-50 instances, all u need is a rock-solid OS.

ofc this only works for farming at the ranch. When i do leveling, he takes 5 at a time, moar gets messy.

All the best!

edit: aww sry, didnt post anything on topic :P

This bug, u're talking about happens to me too sometimes. It's not that often, but sometimes he fucks up at the feedsacks. After the last feedsack he throws this error. Maybe some fail in targetObject() ?!

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#27 Post by checkii » Fri Nov 05, 2010 2:18 am

Is there anyway for the bot to automatically continue or restart the script once it gets this error?

Just keep restarting the script? This error is pretty momentary, not to mention the client hasn't crashed yet. A simple restart will put the bot back on track. And when I say restart i mean something like Shift UP, Enter

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#28 Post by rock5 » Fri Nov 05, 2010 3:13 am

checkii wrote:Is there anyway for the bot to automatically continue or restart the script once it gets this error?

Just keep restarting the script? This error is pretty momentary, not to mention the client hasn't crashed yet. A simple restart will put the bot back on track. And when I say restart i mean something like Shift UP, Enter
If you're sure the error is momentary and would like to see if it can continue, try putting that whole section into a "repeat until" loop and see what happens.

To do this, find this line around line 161;

Code: Select all

	tmp = debugAssert(memoryReadByte(proc, self.Address + addresses.charAlive_offset), memerrmsg);
and add a repeat above it like this;

Code: Select all

	repeat
	tmp = debugAssert(memoryReadByte(proc, self.Address + addresses.charAlive_offset), memerrmsg);
Next change this code around line 272;

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()");
	end
to

Code: Select all

	yrest(100)
		until ( 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 )

		--error("Error reading memory in CPawn:update()");
	--end
See what that does.

Edit: Just realized I should add a pause between loops.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#29 Post by checkii » Fri Nov 05, 2010 6:28 pm

I did the edits, it would pause when i run a script. I would not even get pass the green % load. Actually the green loading thing is missing.

I am going to test this out some more to see if we can get to the bottom of this. If anyone else can also give it a shot it would be appreciated.

P.S Hey rock5, I want to thank you. You have been a tremendous help and I am glad you are around.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#30 Post by rock5 » Fri Nov 05, 2010 10:39 pm

Sorry forgot to add a 'not' just after the until command. :oops:

Code: Select all

	yrest(100)
		until not ( 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 )

		--error("Error reading memory in CPawn:update()");
	--end
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#31 Post by checkii » Mon Nov 08, 2010 10:24 am

The bot moves kinda funky when i made those changes. He moves around awkwardly and will get stuck which leads to unstick() routines.

I am gonna try taking out the error portion completely

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()");
  -- end

alaonor
Posts: 2
Joined: Thu Jul 29, 2010 2:20 am

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#32 Post by alaonor » Thu Nov 11, 2010 6:04 am

I have similar problem with line 274 in pawn.lua with eggs mailing profile. This error occurs sometimes right after my character teleports in city. None of the above mentioned methods works for me :(

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#33 Post by rock5 » Thu Nov 11, 2010 6:24 pm

alaonor wrote:I have similar problem with line 274 in pawn.lua with eggs mailing profile. This error occurs sometimes right after my character teleports in city. None of the above mentioned methods works for me :(
Any script that teleports will get this error. Teleporting will slowly increase the memory use until the game crashes. When the game crashes (usually while teleporting) it will fail to read the memory so you get that error. This has nothing to do with micromacro.

My suggestion is don't use the teleports in the city, just ride the distance.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#34 Post by checkii » Fri Nov 12, 2010 10:47 am

After testing it by removing the if then error code. I found out the underlining problem was nil values.

So I added a few of these in

Code: Select all

	if( self.MaxHP == 0 or self.MaxHP == nil ) then
		self.HP = 1000;
		self.MaxHP = 1000;
	end
	
	if( self.Name == nil ) then
		self.Name = "<UNKNOW>";
	end
	
	if( self.Level == nil or self.Level2 == nil ) then
		self.Level = 1;
		self.Level2 = 1;
	end
	
	if( self.TargetPtr == nil ) then
		self.TargetPtr = 0;
	end
	
	if( self.X == nil or self.Y == nil or self.Z == nil ) then
		self.X = 0;
		self.Y = 0;
		self.Z = 0;
	end
	
	if( self.Attackable == nil ) then
		self.Attackable = false;
	end

krews
Posts: 12
Joined: Fri Aug 28, 2009 7:34 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#35 Post by krews » Fri Nov 12, 2010 4:24 pm

Code: Select all

pawn.lua:237: error reading memory in Cpawn:update<>
does anyone know how to solve this?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#36 Post by rock5 » Fri Nov 12, 2010 8:05 pm

checkii wrote:After testing it by removing the if then error code. I found out the underlining problem was nil values.

So I added a few of these in
That's not going to work. If it stopped being able to read the memory (probably because the game has crashed) assigning values manually will not make it work.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

checkii
Posts: 50
Joined: Sat Oct 09, 2010 8:50 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#37 Post by checkii » Sun Nov 14, 2010 3:53 am

rock5 wrote: That's not going to work. If it stopped being able to read the memory (probably because the game has crashed) assigning values manually will not make it work.
I understand, but the game did not crash. Only the script did. So I would see my character standing there without anything to do. If I restarted the script he would continue on his way. It would be great if the script can realize the client did not crash and continue on his way ... automatically like a bot.

Now I hate to say this, cause I think you are probably right. I have not seen any cpawn() errors since I made those changes. I also kept the bot window active. I think i am just probably running out of memory for the script but oddly enough the client didn't crash first.

poulpito
Posts: 7
Joined: Sun Nov 14, 2010 5:24 pm

Re: pawn.lua:272: error reading memory in Cpawn:update<>

#38 Post by poulpito » Sun Nov 14, 2010 5:29 pm

checkii wrote:
rock5 wrote: That's not going to work. If it stopped being able to read the memory (probably because the game has crashed) assigning values manually will not make it work.
I understand, but the game did not crash. Only the script did. So I would see my character standing there without anything to do. If I restarted the script he would continue on his way. It would be great if the script can realize the client did not crash and continue on his way ... automatically like a bot.

Now I hate to say this, cause I think you are probably right. I have not seen any cpawn() errors since I made those changes. I also kept the bot window active. I think i am just probably running out of memory for the script but oddly enough the client didn't crash first.
Hi,
it's my first contribution to this forum :p

i've the same issue game client did not crash and continue to run fine but the script hang with cpawn update
with similar modification (fix manually values if nil) it seems to work perfectly and correct rare crash not solved by the function waitForLoadingScreen()

Code: Select all

function waitForLoadingScreen()
    if memoryReadBytePtr(getProc(), 0x00A0A9F8, 0x0C) == 0 then 
         repeat
            yrest(1000)
    until memoryReadBytePtr(getProc(), 0x00A0A9F8, 0x0C) == 1
    end
    repeat 
        yrest(1000)
    until memoryReadBytePtr(getProc(), 0x00A0A9F8, 0x0C) == 0
end
thanks for your help checkii :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest