Results 1 to 5 of 5

Thread: Saving debug to file?

  1. #1
    Join Date
    Mar 2012
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Saving debug to file?

    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 ?

  2. #2
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

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

  3. #3
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    I found this months ago. Didnt try it out yet.
    Simba Code:
    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;

  4. #4
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    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.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  5. #5
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •