Results 1 to 13 of 13

Thread: Long Progress Reports Messing Up?

  1. #1
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default Long Progress Reports Messing Up?

    One of my scripts has been having this a problem now that I enabled SixHourFix. Everything seems to be reporting fine except for the xp/h, and that only messes up on long reports, For example:

    Quote Originally Posted by Laimonas171 View Post
    Progress Report:
    ~~~~~~~~~~~~Almost AIO PowerMiner~~~~~~~~~~
                     ~By BMWxi~               
    Iron Mined: 33474 (588 P/H)
    Mining XP earned: 1171590 (-377 P/H)
    Total Time: 56 Hours, 50 Minutes and 2 Seconds
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    See how the xp/h is -377?

    This is on a shorter one, but using the same version:
    Quote Originally Posted by dstahn236 View Post
    ~~~~~~~~~~~~Almost AIO PowerMiner~~~~~~~~~~
    ~By BMWxi~
    Iron Mined: 8758 (652 P/H)
    Mining XP earned: 306530 (22842 P/H)
    Total Time: 13 Hours, 25 Minutes and 10 Seconds
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The xp/h is fine.

    Here is how the proggy is calculated:
    Simba Code:
    begin
       IronPH := Round((Iron * 3600) / (GetTimeRunning / 1000));
       MiningXPPH := Round(((Iron * 35) * 3600) / (GetTimeRunning / 1000));
       ClearDebug;
       Writeln('~~~~~~~~~~~~Almost AIO PowerMiner~~~~~~~~~~');
       Writeln('                 ~By BMWxi~               ');
       Writeln('Iron Mined: ' + IntToStr(Iron) + ' (' + IntToStr(IronPH) + ' P/H)');
       Writeln('Mining XP earned: ' + (ToStr(Iron * 35)+ ' (' + IntToStr(MiningXPPH)) + ' P/H)');
       Writeln('Total Time: ' + TimeRunning);
       Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    end;
    Does anyone know why it is going negative when running for a long time? I don't see any reason why it would, so I'm a bit puzzled.

  2. #2
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    i'm not even gonna look at it. But i assume the variable is floating away into the mystery beyond because an int can only be so large.

  3. #3
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    33474 (iron mined), 56 (hours):

    MiningXPPH := Round( ... );
    ... = ((Iron * 35) * 3600) / (GetTimeRunning / 1000)

    33474 * 35 = 1171590

    1171590 * 3600 = 4217724000

    4,217,724,000 => is approx. twice as much as the max value an int/integer can hold.

    a possibly fix:
    Simba Code:
    var
    //  MiningXPPH: integer;
    // to
      MiningXPPH: int64;

    e: 'd

  4. #4
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    i'm not even gonna look at it. But i assume the variable is floating away into the mystery beyond because an int can only be so large.
    Then could I fix it by dividing the xp by 1000 and then writing "k xp" after?

  5. #5
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Then could I fix it by dividing the xp by 1000 and then writing "k xp" after?
    You could. Or you could calculate it differently.

  6. #6
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    You could. Or you could calculate it differently.
    Ok thanks . I'll see which way I like more.

  7. #7
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Ok thanks . I'll see which way I like more.
    This works, no? Makes gobbz more sense to me anyhow. You already calculate the IronPH why calculate it again on the next line? :P

    Simba Code:
    procedure Proggy;
    var
      IronPH, MiningXPPH: integer;
    begin
       IronPH := Round((Iron * 3600) / (GetTimeRunning/1000));
       MiningXPPH := IronPH*35;
       ClearDebug;
       Writeln('~~~~~~~~~~~~Almost AIO PowerMiner~~~~~~~~~~');
       Writeln('                 ~By BMWxi~               ');
       Writeln('Iron Mined: ' + IntToStr(Iron) + ' (' + IntToStr(IronPH) + ' P/H)');
       Writeln('Mining XP earned: ' + (ToStr(Iron * 35)+ ' (' + IntToStr(MiningXPPH)) + ' P/H)');
       Writeln('Total Time: ' + TimeRunning);
       Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
    end;
    Last edited by footballjds; 12-03-2012 at 08:40 PM.

  8. #8
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Yeah, I've just been using the same format back from when I first started. That would work I think, I'll just run some tests now.

  9. #9
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Yeah, I've just been using the same format back from when I first started. That would work I think, I'll just run some tests now.
    it will work, orePerHour*ExpPerOre = EXPPerHour

  10. #10
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    it will work, orePerHour*ExpPerOre = EXPPerHour
    I know that the math works, I want to see if it fixes the negative xp error

  11. #11
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    I know that the math works, I want to see if it fixes the negative xp error
    oh, well it DEFINITELY will, unless ofc you mine enough iron ore :P you'll have to mine a bit under 600,000 ores before it breaks again. I'd LOVE to see a proggy that long

  12. #12
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    oh, well it DEFINITELY will, unless ofc you mine enough iron ore :P
    Thank you for your help

  13. #13
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Thank you for your help
    np, good luck getting 600k iron ores in one run

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
  •