SRL Archive - OSR Help

Stats_Commit


Gucci

2012-12-29 19:48:30

Anybody know why I'm getting this error? It opens the globalstats tab

Error: Out Of Range at line 368
HTTPClient[0] has not been freed in the script, freeing it now.
The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4, 5, 6, 7, 8, 9]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap, SRL - Options Bitmap, 5, 6, 7, 8, 12]

riwu

2012-12-29 19:56:21

Post the script that caused this error?
At what point did the error occur?

Gucci

2012-12-29 20:09:41

Don't really want to post the whole thing as I don't want it public but here is the procedure where it happens

procedure Proggy;
begin
CurrentEXP := GetXPBarTotal;
TotalEXP := (CurrentEXP - StartEXP);
Stats_IncVariable('Thieving EXP (Gained)',(CurrentEXP - StartEXP));
Stats_IncVariable('Times Banked',(NumbOfBanks));
Stats_Commit;
ClearDebug;
Writeln('############# Guccis Safe Cracker ###########');
Writeln('|= Player : ' + Players[CurrentPlayer].Nick);
Writeln('|= Time Running : ' + TimeRunning);
Writeln('|= EXP Gained : ' + IntToStr(TotalEXP));
Writeln('|= Safes Done : ' + IntToStr(TotalEXP/70));
Writeln('|= Safes Failed : ' + IntToStr(SafesFailed));
Writeln('#############################################');
end;

Oh yeah the error occurs when it tries to commit the stats

Le Jingle

2012-12-29 20:14:57

Maybe assigning the xp to a variable before commit, and since I see Flight viewing, I know he does this in his scripts (seeing his username viewing this thread reminded me of any of my advice right now ;p) and also assigns it to 0 after commit too I think.

Any who, I think this may? help with the problem, definitely perhaps maybe not (lol)

Cheers,
Lj

Gucci

2012-12-29 20:35:28

From: Le Jingle
Maybe assigning the xp to a variable before commit, and since I see Flight viewing, I know he does this in his scripts (seeing his username viewing this thread reminded me of any of my advice right now ;p) and also assigns it to 0 after commit too I think.

Any who, I think this may? help with the problem, definitely perhaps maybe not (lol)

Cheers,
Lj


Yeah a lot of people use those, I tried assigning to a variable still and setting it to zero at the beginning still doesn't work :/

Edit: Figured it out

riwu

2012-12-29 22:41:01

Did you have SetupSRLStats() done correctly in the main program? That's likely the cause.

Gucci

2012-12-29 22:45:59

From: riwu
Did you have SetupSRLStats() done correctly in the main program? That's likely the cause.


I did but wasn't the problem I figured it out though.

Thanks for the help guys

riwu

2012-12-29 22:50:41

From: Gucci
I did but wasn't the problem I figured it out though.

Thanks for the help guys

So what's the cause? Would like to know for future reference ;)

Gucci

2012-12-29 22:59:41

From: riwu
So what's the cause? Would like to know for future reference ;)


I moved the progress report to happen when there was an actual value for the variables and that seemed to have done the trick