+ Reply to Thread
Results 1 to 17 of 17

Thread: Varrock East Oaks Animation

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default Varrock East Oaks Animation

    Not sure if this 'problem' is specific to this location, I've got noticed it here.

    Often times when chopping a tree, you come at it diagonally, making you actually stand one block to the left/right of the center block on the screen.

    MSI checks for animation only on the center block (which is fine) but when this happens the script thinks you are not chopping since there is no animation on the center block (unless someone next to you is chopping) causing the script to click the tree over and over until it is chopped.

    Maybe (just for this location/locations were this happens?) we could increase the area in which we search for animation, it's pretty common.

    :]

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Simba Code:
    Procedure MSI_WaitWhileChopping(TreeID: integer);
    Var
      CTS, HalfWidth, HalfHeight, L, I, T, OldInvCount, NewInvCount, tDist, prevLen: Integer;
      TotalChopTime, R, CT: Integer;
      ATPA: T2DPointArray;
      TPA: TPointArray;
      Objs: TIntegerArray;
      B: TBox;
      TreeExists, Debug: Boolean;
    Begin
      if (not LoggedIn) then
        Exit;

      MSI_AddHeader('MSI_WaitWhileChopping');

      Objs := MSI_Players[CurrentPlayer].Scripts[CurrentScript].Trees;

      CTS := GetColorToleranceSpeed;

      SetColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(MSI_Objects[TreeID].Hue, MSI_Objects[TreeID].Sat);

      HalfWidth := Round(MSI_Objects[TreeID].W * 0.7);
      HalfHeight := Round(MSI_Objects[TreeID].H * 0.7);
      B := IntToBox(MSI_Objects[TreeID].X - HalfWidth, MSI_Objects[TreeID].Y - HalfHeight,
                    MSI_Objects[TreeID].X + HalfWidth, MSI_Objects[TreeID].Y + HalfHeight);

      L := Length(MSI_Objects[TreeID].Colors);
      SetLength(ATPA, L);
      Dec(L);

      OldInvCount := InvCount;
      T := (GetSystemTime + MSI_Objects[TreeID].MaxTime + Random(5000));
      TotalChopTime := (GetSystemTime + (4 * 60000));

      Repeat
        Debug := (Random(10) < 3);

        If InvFull Then
          Break;

        MSI_FindRandoms(False);
        MSI_AntiBan(RandomRange(0, 5000), ANTI_BAN_CHANCE);

        // Check if the tree Exists
        if (Debug) then
          MSI_Debug('Looking for tree');

        For I := 0 To L Do
          FindColorsTolerance(ATPA[I], MSI_Objects[TreeID].Colors[I],
                              B.X1, B.Y1, B.X2, B.Y2, MSI_Objects[TreeID].Tol);
        TPA := MergeATPA(ATPA);
        SortTPAFrom(TPA, Point(MSCX, MSCY));

        if (Length(TPA) > 0) then
        begin
          if (length(TPA) <= (prevLen / 2)) then
          begin
            MSI_Debug('Length(TPA) < half the previous, tree is gone');
            break;
          end;

          if (MSI_SetupVars[SETUP_DEBUG_SMART]) then
            SMART_DrawDotsEx(True, TPA, clYellow);

          // Gets distance from closest point to player
          tDist := Distance(TPA[0].x, TPA[0].y, MSCX, MSCY);

          // Resets the tracking box to a box the size of the tree located around the closest point
          B := MSI_MakeBox(Point(TPA[0].x, TPA[0].y), MSI_Objects[TreeID].W, MSI_Objects[TreeID].H);

          if (MSI_SetupVars[SETUP_DEBUG_SMART]) then
            SMART_DrawBoxEx(False, B, clBlue);

          prevLen := length(TPA);
        end;

        if (Debug) then
          MSI_Debug('Track box distance: '+IntToStr(tDist));

        if (tDist > TREE_MAX_DIST) then
        begin
          if (Debug) then
            MSI_Debug('Tracking box is over the maximum distance');
          Break;
        end;

        TreeExists := Length(TPA) >= MSI_Objects[TreeID].Accuracy;
        If (TreeExists) Then
          If (Random(4) <> 0) Then
            Wait(200 + Random(50))
          Else
            SleepAndMoveMouse(200 + Random(50));

        if (random(20) < 5) then
          if MSI_FindBirdNest then
            Break;

        // InvCount check
        if (Debug) then
          MSI_Debug('Checking inventory count');

        NewInvCount := InvCount;
        If (NewInvCount > OldInvCount) Then
        Begin
          if (Debug) then
            MSI_SubDebug('New count > old count');

          OldInvCount := NewInvCount;
          T := (GetSystemTime + MSI_Objects[TreeID].MaxTime + Random(5000));
        End;

        // Prevent logout
        If ((TotalChopTime - GetSystemTime) < 60000) Then
        Begin
          if (Debug) then
            MSI_Debug('Preventing logout');

          CT := GetCurrentTab;
          Repeat
            R := RandomRange(Tab_Combat, Tab_Notes);
          Until(R <> CT);
          GameTab(R);

          if (Debug) then
            MSI_SubDebug('Clicking game tab: ' + IntToStr(R));
          Wait(RandomRange(500, 1000));
        End;

        if (GetCurrentTab <> tab_Inv) then
          MouseBox(646, 177, 662, 195, 1);

      Until(Not TreeExists) Or (GetSystemTime > T) Or (Not LoggedIn);

      MSI_CloseHeader('MSI_WaitWhileChopping: Finished');

      SetColorToleranceSpeed(CTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    End;
    Exactly what Animation check are you talking about?

    I know Coh3n has been working with WaitWhileChopping for a few days, not sure as to his current progress, but I'd imagine any issues would be fixed.

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I actually never looked at any code .
    I jut assumed whilechopping looked for any character movement/animation on the center tile. I'm on phone right now I'll look at it more when I get home.

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

    Default

    Quote Originally Posted by YoHoJo View Post
    I actually never looked at any code .
    I jut assumed whilechopping looked for any character movement/animation on the center tile. I'm on phone right now I'll look at it more when I get home.
    My new one does. It works 1000x better, I just haven't committed it yet. I can push it to my repository, then you can pull from mine if you want to test it out. Also, MSI_WaitWhileChopping has a huge memory leak somehow, so that may be the cause of your code:8 errors.

    E: Updated my repo -> https://github.com/Coh3n/MSI/commit/...fedd57d1d4592d I still have a few things to test before pushing to main.
    Last edited by Coh3n; 04-02-2011 at 06:57 PM.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Thanks.
    Memory Leak fixed in your updated repo? Or still can't figure out exactly wtf is wrong?

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

    Default

    Quote Originally Posted by YoHoJo View Post
    Thanks.
    Memory Leak fixed in your updated repo? Or still can't figure out exactly wtf is wrong?
    I still can't figure out what the fuck is wrong, but it's definitely improved. Did you ever have this issue when using a mining script?

    I've been running 2 Simbas all night, still going and they're both at over 12 hours.

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I've mined for 24+ hours on two simbas, never code 8.
    You also have mined a BUNCH of clay and I assume you also never code 8ed?

    Only seems to happen with WCing, I'm running two more 1.5 hours so far....

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

    Default

    Quote Originally Posted by YoHoJo View Post
    I've mined for 24+ hours on two simbas, never code 8.
    You also have mined a BUNCH of clay and I assume you also never code 8ed?

    Only seems to happen with WCing, I'm running two more 1.5 hours so far....
    That's exactly why it was probably MSI_WaitWhileChopping. I also got the code:8 after switching from mining to woodcutting (and yeah, I ran 4 simbas all went for 30h mining clay). I also ran a series of tests on WaitWhileChopping, which showed that there was definitely a leak. The question is what is the leak?

    Running woodcutting last night, my memory as still increased, but no code:8, so it's an improvement. I hope you have good luck with my repo as well. Let me know how it goes.

  9. #9
    Join Date
    Nov 2007
    Posts
    326
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Only seems to happen with WCing, I'm running two more 1.5 hours so far....
    Not to be a downer, but I wake up every morning (that is, I run it with 4 characters for about 7 hours or so before it dies) with MSI crashed with a code 8 and all I run is Rimmington Iron Miner, so it isn't just WC'ing.

    Check out my Edgeville Smelter!

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

    Default

    Quote Originally Posted by IPwnz View Post
    Not to be a downer, but I wake up every morning (that is, I run it with 4 characters for about 7 hours or so before it dies) with MSI crashed with a code 8 and all I run is Rimmington Iron Miner, so it isn't just WC'ing.
    Do you have smart debugging enabled?

  11. #11
    Join Date
    Nov 2007
    Posts
    326
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    Do you have smart debugging enabled?
    Nope, I haven't ever bothered because of the misc incompatibility bugs I hear with plugins and such.

    Check out my Edgeville Smelter!

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

    Default

    Quote Originally Posted by IPwnz View Post
    Nope, I haven't ever bothered because of the misc incompatibility bugs I hear with plugins and such.
    See, this is the issue that makes me so fucking mad. I have no idea whatsoever that would cause this. The only thing that's called during mining are MSI_TrackObject and MSI_FindObjectsIn, and those just use Simba's color routines. There's no unfreed DTMs in MSI, because they're all loaded on startup. All form components are freed. After that, I don't know what can cause leaks.

  13. #13
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I've never got a code 8 at all and I have 5 players (2 WCing and 3 Mining) running around the clock with little exception. (usually 20+ hrs. before I stop to reset/check things)

  14. #14
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Different thing althogether....

    why do we have if debug then MSI_Debug instead of just having if not Debug then exit inside MSI_Debug? ( I know I'm always throwing shit onto your hands.... excuse my lazy old ass )

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  15. #15
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    Different thing althogether....

    why do we have if debug then MSI_Debug instead of just having if not Debug then exit inside MSI_Debug? ( I know I'm always throwing shit onto your hands.... excuse my lazy old ass )

    ~RM
    Just the way it was originally done I suppose. Me and Coh3n have plans to (it seems he's already began a bit) go through MSI as a whole and just fix up the code where need be.

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

    Default

    Quote Originally Posted by Sir R. M8gic1an View Post
    Different thing althogether....

    why do we have if debug then MSI_Debug instead of just having if not Debug then exit inside MSI_Debug? ( I know I'm always throwing shit onto your hands.... excuse my lazy old ass )

    ~RM
    Why would it exit? "Debug" is just randomly set to true. It just so it doesn't spam the debug as much.

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

    Default

    This was fixed quite some time ago.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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