Page 2 of 2
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Mon Nov 01, 2010 6:46 pm
by rock5
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Tue Nov 02, 2010 1:56 am
by checkii
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Tue Nov 02, 2010 5:13 am
by xtremeuser
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
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Tue Nov 02, 2010 7:04 am
by rock5
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?
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Tue Nov 02, 2010 7:20 am
by swietlowka
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)
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Wed Nov 03, 2010 5:42 am
by Herbee
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
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
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() ?!
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 05, 2010 2:18 am
by checkii
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
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 05, 2010 3:13 am
by rock5
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 05, 2010 6:28 pm
by checkii
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 05, 2010 10:39 pm
by rock5
Sorry forgot to add a 'not' just after the until command.
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
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Mon Nov 08, 2010 10:24 am
by checkii
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
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Thu Nov 11, 2010 6:04 am
by alaonor
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

Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Thu Nov 11, 2010 6:24 pm
by rock5
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 12, 2010 10:47 am
by checkii
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
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 12, 2010 4:24 pm
by krews
Code: Select all
pawn.lua:237: error reading memory in Cpawn:update<>
does anyone know how to solve this?
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Fri Nov 12, 2010 8:05 pm
by rock5
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Sun Nov 14, 2010 3:53 am
by checkii
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.
Re: pawn.lua:272: error reading memory in Cpawn:update<>
Posted: Sun Nov 14, 2010 5:29 pm
by poulpito
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
