Results 1 to 8 of 8

Thread: Need help with progress report on 6 hour reset

  1. #1
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default Need help with progress report on 6 hour reset

    Having an issue with my progress report when SMART is reloaded during 6 hour reset. My script will reset the initial xp values and the timerunning remains at 6+ hours. My current progress report looks like this...

    Simba Code:
    XpCount := chatBox.getXP - StartXp;
      SecondS := round((getTimeRunning/1000));
      XpHour := round((3600 * XpCount) / (SecondS));

    Right before the reset
    Code:
    [06:00:19]: -- *************Progress Report***************
    [06:00:19]: -- Total Time Running: 6 Hours, 19 Seconds
    [06:00:20]: -- Xp Gained: 466049
    [06:00:20]: -- Xp per Hour: 77603
    [06:00:20]: -- *******************************************
    After reset
    Code:
    [06:07:51]: ---- *************Progress Report***************
    [06:07:51]: ---- Total Time Running: 6 Hours, 7 Minutes and 51 Seconds
    [06:07:51]: ---- Xp Gained: 1745
    [06:07:51]: ---- Xp per Hour: 285
    [06:07:51]: ---- *******************************************
    I set my StartXp in the login loop, but I am wondering do all these variables stay intact on a reset? So I can add code to my login loop like...
    Simba Code:
    if not isLoggedIn then
          begin
            ...
            StartXp := chatBox.getXP;
            //Making this up, don't know if such a function exists
            if simbaReset then
              StoredXp := XpCount;
          end;

    And then add StoredXp to our XpCount in the progress report procedure...
    Simba Code:
    XpCount := chatBox.getXP - StartXp + StoredXp;

    I would like accurate information past 6 hours since this bot can run for many more hours than that. So is there a way to check for the 6hour reset, if so what is the function? Or is there a better way to solve this for the 6 hour mark?

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Just don't put your startXP calculation inside the main loop. When you start the script, login the player, grab start XP, and then repeat the main loop.

  3. #3
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    It's currently in my login procedure only. That's the problem though, it will reset the xp as if it were logging in the first time, but it doesn't reset the time running nor do I want it to. I just want to add the old XpCount to the new starting xp everytime it resets.

  4. #4
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by Brotein View Post
    It's currently in my login procedure only. That's the problem though, it will reset the xp as if it were logging in the first time, but it doesn't reset the time running nor do I want it to. I just want to add the old XpCount to the new starting xp everytime it resets.
    Well do what the mayor said

  5. #5
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    So what you're saying is when sixHourFix() is called inside my main loop, it'll restart inside the main loop?

    So instead of
    Simba Code:
    begin
    ...
      repeat
        if not isLoggedIn then
          begin
            ...
            StartXp := chatBox.getXP;
          end;
        ...
      until(false);
    end.

    Something like this?
    Simba Code:
    begin
    ...
    if not isLoggedIn then
          begin
            ...
            StartXp := chatBox.getXP;
          end;
      repeat
        if not isLoggedIn then
          begin
            ...
          end;
        ...
      until(false);
    end.

  6. #6
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

    Default

    Quote Originally Posted by Brotein View Post
    So what you're saying is when sixHourFix() is called inside my main loop, it'll restart inside the main loop?

    So instead of
    Simba Code:
    begin
    ...
      repeat
        if not isLoggedIn then
          begin
            ...
            StartXp := chatBox.getXP;
          end;
        ...
      until(false);
    end.

    Something like this?
    Simba Code:
    begin
    ...
    if not isLoggedIn then
          begin
            ...
            StartXp := chatBox.getXP;
          end;
      repeat
        if not isLoggedIn then
          begin
            ...
          end;
        ...
      until(false);
    end.
    Yes, like that. It's much simpler that adding in new variables and calculations. Also don't indent your begins

  7. #7
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    SixHourFix() simply restarts SMART when called, logs the player back in, and resumes with the script. So to answer your question, no, there are no variables that are reset when SixHourFix() is called (which is called by SRL and should technically be an internal function, but that's not the point).

    Your problem is (like The Mayor said) that you're setting the startXP variable inside your mainloop's repeat loop, meaning it will reset every iteration of the loop. Just make sure you're only setting your startXP variable once.

  8. #8
    Join Date
    Jan 2012
    Location
    Long Island, NY
    Posts
    413
    Mentioned
    5 Post(s)
    Quoted
    95 Post(s)

    Default

    Yup got it all sorted thanks guys!

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
  •