Results 1 to 7 of 7

Thread: Pixel shift

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

    Default Pixel shift

    I am looking to add pixel shift to my bot, but I am not really sure how it works. I made this basic script copying an example off the forums and added my own stuff in:

    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, 500, 650) > 1500);
    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.

    But the bot still sometimes clicks the tree even when the character is doing the cutting animation what numbers would I have to change to prevent this, for it to re-click a tree when the animation stops?

  2. #2
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    run while cutting and while not, adjust numbers

    Simba Code:
    Procedure DebugShiftCount;
      var
        PBox: TBox;
      begin
        PBox := IntToBox(245, 130, 285, 195);
        Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
      end;

    http://villavu.com/forum/showthread.php?t=74090


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

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

    Default

    Your problem is you put '>1500'. This is waaay too high. Put around 100 to 150. That should do the trick. Usually, you do not see more than 300. (Check my ChopNBurn)
    ~Rez

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

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

    Default

    Quote Originally Posted by Rezozo View Post
    Your problem is you put '>1500'. This is waaay too high. Put around 100 to 150. That should do the trick. Usually, you do not see more than 300. (Check my ChopNBurn)
    ~Rez
    Ok thanks!
    I'm learning all this for my next membership application, my last one had colors and bitmaps and basic failsafes, my next one will have colors,DTM's,TPA's,pixelshift,bitmaps,added failsafes hopefuly that should get me in


    EDIT, I put it down to 300 and then it constantly said "waiting to stop chopping" so.. I guess ill make it a lot higher then?

  5. #5
    Join Date
    Feb 2012
    Posts
    390
    Mentioned
    2 Post(s)
    Quoted
    14 Post(s)

    Default

    no. idling never goes above 400. 400 is flawless

  6. #6
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    run while cutting and while not, adjust numbers

    Simba Code:
    Procedure DebugShiftCount;
      var
        PBox: TBox;
      begin
        PBox := IntToBox(245, 130, 285, 195);
        Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
      end;

    http://villavu.com/forum/showthread.php?t=74090
    Do exactly what Danny said. Debug the pixel shift and then you will be able to find what the max pixel shift for your idle character is and the min pixel shift for when your character is cutting. Make the number a reasonable sum between the two and it should work perfectly.

  7. #7
    Join Date
    Mar 2008
    Posts
    426
    Mentioned
    1 Post(s)
    Quoted
    116 Post(s)

    Default

    This thread was so helpful.. !

    Bumping it up to keep it alive for anyone searching pixels



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
  •