Page 2 of 2
Re: Character dies when client crashes.
Posted: Sat Jan 15, 2011 3:01 am
by Administrator
rock5 wrote:That opens up a whole kettle of beans. Do you realize how many times the 'error' function command is used in the bot? Potentially at each of those error points we might want it to close the client.
That, and any unhandled exceptions would still propagate an error without closing the client. Oh, and it would be really annoying to debug certain issues when it closes the client as you're trying to work on something.
Re: Character dies when client crashes.
Posted: Sat Jan 15, 2011 12:30 pm
by Alkaiser
I meant only the in CPawn:update() error, so the client would be closed only when an error occurs in the update() function. This is the only time I have a problem.
Line 274 in 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()");
end
This is where it happens. What would I add to have micromacro terminate the ROM process just before it errors out here and ONLY here.
Re: Character dies when client crashes.
Posted: Sat Jan 15, 2011 12:50 pm
by Administrator
You probably should just turn DEBUGGING on in setings.xml and post more detailed results of the error so that it can be properly fixed.
Re: Character dies when client crashes.
Posted: Sat Jan 15, 2011 2:15 pm
by Alkaiser
It happens extremely rarely and I assume that it occurs when the client becomes unstable, causing memory offsets no longer match up properly and update() to error out.
I think I found what I wanted.
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
local PID = findProcessByWindow(getWin()); -- Get process ID
os.execute("TASKKILL /PID " .. PID .. " /F");
while(true) do
-- Wait for process to close...
if( findProcessByWindow(__WIN) ~= PID ) then
printf(language[88]);
break;
end;
yrest(100);
end
error("Error reading memory in CPawn:update()");
end