SRL Archive - OSR Help

Saving debug to file?


Spandzbab

2012-05-05 01:51:24

I have a script with a case random of 100 and it runs until false.

Every time the case lands on something it reports to console, I'd like to know what landed. Is there a way to save debug to file every set amount of time or cases ?

Abu

2012-05-05 07:19:09

Take a look at the MSI Include. I know they have a way of doing this with their scripts.

Shatterhand

2012-05-05 07:36:49

I found this months ago. Didnt try it out yet.
function WriteReportToFile: Boolean;
var
theFile: Integer;
thePath: string;
begin
thePath := AppPath + 'Scripts\Progress.txt';

try
theFile := RewriteFile(thePath, False);
except
Writeln('Error opening file!');
end;

WriteFileString(theFile, 'Tree: ' + TreeName + #13 + #10); // The '#13 + #10' will skip to the next line in the file, so Exp: won't be written on the same line
WriteFileString(theFile, 'Exp: ' + FloatToStr(TreeExp) + #13 + #10);
WriteFileString(theFile, 'Total Logs: ' + IntToStr(TotalLogs) + #13 + #10);
WriteFileString(theFile, 'Total Exp: ' + FloatToStr(TotalExp) + #13 + #10);

CloseFile(theFile); // Again, don't forget this!
end;

Rich

2012-05-05 08:31:34

Check out a guide on INIs. I can't link you to one at the moment because I'm in my phone, but a search for "WriteINI" in Tutorial Island should get you going in the right direction.

Echo_

2012-05-05 08:54:44

INI:
http://villavu.com/forum/showthread.php?t=44955

Or you could read up on SQLite:
http://docs.villavu.com/simba/scriptref/sqlite.html