Page 2 of 2 FirstFirst 12
Results 26 to 38 of 38

Thread: [TuT]Using Pixelshift for animation

  1. #26
    Join Date
    Jul 2012
    Location
    System 32
    Posts
    47
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sweet.

    Thanks again.
    +Rep

  2. #27
    Join Date
    Apr 2006
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice!

    I still can't get it to work for chopping.. something like look for the tree (object) after the player stops the chopping animation. Anyone?
    Oldgen.

  3. #28
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by QQu View Post
    Nice!

    I still can't get it to work for chopping.. something like look for the tree (object) after the player stops the chopping animation. Anyone?
    What part can you not get to work? If it can't detect when it's chopping, get the average pixelshift. There was a function for that.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  4. #29
    Join Date
    Apr 2006
    Posts
    168
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Function notSmashing : Boolean;
      var
        PBox : TBox;
      begin
        PBox := IntToBox(245, 190, 285, 195);
        Result := (AveragePixelShift(PBox, 5000, 500) < 300);
      end;

    Does that seem right? :/
    Oldgen.

  5. #30
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by QQu View Post
    SCAR Code:
    Function notSmashing : Boolean;
      var
        PBox : TBox;
      begin
        PBox := IntToBox(245, 190, 285, 195);
        Result := (AveragePixelShift(PBox, 5000, 500) < 300);
      end;

    Does that seem right? :/
    Swap that 5000 with 500, Your waitPerLoop is longer than maxTime.

  6. #31
    Join Date
    Nov 2007
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    started using it =3 awesome

    only problem is when some1 get too close and start atking my character wont move but shhhhhh

  7. #32
    Join Date
    Nov 2008
    Location
    UK
    Posts
    153
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    This works great for woodcutting scripts. I've used it in my willow cutter. Works really well after adjusting the threshold. Has some minor problems when standing right next to people or behind large trees, but overall its a pretty handy tool.

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

    Default

    Thanks Flight, I'm using this in my fisher and it works like a charm

    And that PixelShift finding tool is downright handy! Rep+
    Last edited by Ian; 11-30-2012 at 02:02 AM.

  9. #34
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Yea, this is where I got my chopping and mining checks from
    I didn't even see/ read about the pixelshift finding tool.
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  10. #35
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Great tut, I got my animation detection working good, but I have one queston, how would I make it click a lot faster after it no longer see's as much pixels shifting?
    My code is:
    Simba Code:
    program test;
    {$i srl/srl.simba}
    const
      TREEX=120;
      TREEY=81;
      TREEX2=382;
      TREEY2=226;
    Function Choppin: Boolean;
    var
    PBox: TBox;
    begin
    PBox := IntToBox(249, 134, 277, 180);
    Result := (AveragePixelShift(PBox, 200, 300) > 150);
    Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
    end;
    Procedure Woodchop;
    var
      X, Y: Integer;
    begin
    if (Choppin) then
    begin
    //writeln('Waiting  to stop Cutting');
    wait(100);
    end else
    begin
    //writeln('Lets look for a Tree');
    if FindColorTolerance(X,Y,12400,TREEX,TREEY,TREEX2,TREEY2,10)then
      MouseSpeed:=15;
      mmouse(x, y,1,1);
      Wait(350 + Random(150));
      ClickMouse(X, Y, mouse_Left);
      Wait(500 + Random(700));
      end;
    end;
    begin
    repeat
    Woodchop;
    until (IsKeyDown (114));
    end.

  11. #36
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Try this bud:
    Simba Code:
    program test;
    {$i srl/srl.simba}

    const
      TREEX=120;
      TREEY=81;
      TREEX2=382;
      TREEY2=226;

    Function Choppin: Boolean;
    var
      PBox: TBox;
    begin
      PBox := IntToBox(249, 134, 277, 180);
      Result := (AveragePixelShift(PBox, 200, 300) > 150);
      Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
    end;

    Procedure Woodchop;
    var
      X,Y: Integer;
    begin
      if (Choppin) then
      begin
        //writeln('Waiting  to stop Cutting');
        wait(100);
      end else
      begin
        //writeln('Lets look for a Tree');
        if FindColorTolerance(X,Y,12400,TREEX,TREEY,TREEX2,TREEY2,10)then
        begin
          mmouse(x,y,1,1);
          ClickMouse2(mouse_left)
          WaitFunc(@Choppin, 10, 3000);  //Wait for 3 seconds if we've started chopping.
        end;
      end;
    end;

    begin
      SetupSRL;
      MouseSpeed:=15;

      repeat
        Woodchop;
      until (IsKeyDown (114));
    end.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  12. #37
    Join Date
    Jan 2013
    Location
    Ohio
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    77 Post(s)

    Default

    Could this be used to detect if an item has spawned on the ground in a specific spot? I'm a far way from implementing anything like this but I have been thinking about things scripts I make could accomplish. Thanks for the tut!!!

  13. #38
    Join Date
    Dec 2007
    Posts
    174
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    I actually use this same code for my mining script. it's outdated now tho but going to get it running again.

Page 2 of 2 FirstFirst 12

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
  •