Results 1 to 10 of 10

Thread: XP/hour won work right

  1. #1
    Join Date
    Feb 2012
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default XP/hour won work right

    i wonder what i did wrong? here is what it looks like in my script:

    Simba Code:
    ExpHr := Round((Rcxp * 3600) / (GetSystemTime / 1000));

    somewhere in my script i put

    Simba Code:
    incEx(RcXp,452);

    this is the lin in the proggy

    Simba Code:
    writeln(' XP: ' + IntToStr(RCxp));
    writeln(' XP/h: ' + IntToStr(ExpHr));

    and i always get results like this (in the debug box)

    XP: 5876
    XP/h: 446

    enyone knows why the math is wrong?

  2. #2
    Join Date
    Feb 2012
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    if it seems confusing above, here's a better exemple of the script

    Simba Code:
    ...

    incEx(Rcxp,452);

    ...

    procedure Proggy;

    ExpHr := Round((RcXp * 3600) / (GetSystemTime / 1000));  

    writeln('| XP: ' + IntToStr(RcXp));
    writeln('| XP/h: ' + IntToStr(ExpHr));

  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    XPH := Round((Exp * 3600) / (GetTimeRunning / 1000));

  4. #4
    Join Date
    Feb 2012
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    ???

  5. #5
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    you need getsystemtime-starttime not just getsystemtime.
    at the start of your script youd need starttime:=getsystemtime

  6. #6
    Join Date
    Feb 2012
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    so the equation should be this?

    ExpHr := Round((RcXp * 3600) / (GetSystemTime-StartTime / 1000));

  7. #7
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    yes, and you need to declare starttime as a global variable. then at the start of the script put

    Starttime := GetSystemTime;

  8. #8
    Join Date
    Feb 2012
    Posts
    224
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    kk thnx, ill try this out

  9. #9
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Why not just use Starttime. Isn't that a built in procedure?

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

    Default

    Use GetTimeRunning - it gets the time since the script was started, that's what you want to use.

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
  •