Results 1 to 2 of 2

Thread: PixelShift Help

  1. #1
    Join Date
    Dec 2010
    Posts
    89
    Mentioned
    4 Post(s)
    Quoted
    8 Post(s)

    Default PixelShift Help

    Hey Guys...
    I'm working a fishing script at the moment, but I'm a little unhappy with one spot of my script. I find the Fishing Spot just fine, but I'm using PixelShift to determine when my character is not animating, though sometimes the PixelShift will "Result:= True" when my character is still animating, causing the script to look really bot like. Soo... I tried coming up with a work around, but that's when I run into problems... >_>

    Simba Code:
    function PixelShift_1: Boolean;     // This works, but results
    var                                   //true too frequently.
        PBox: TBox;

      begin
        PBox := IntToBox(245, 130, 285, 195);
        if (AveragePixelShift(PBox, 250, 500) < 160) then
          begin
            FindNormalRandoms;                                
            Writeln('PixelShift is Low; Not Animating');      
            Result:= True;
          end;
      end;

    function NotFishing: Boolean;   //This is what I'm struggling with...
    var
      Retry: Integer;

    begin
      Retry:= 0;

      if PixelShift_1 then
        begin
          Inc(Retry);
          repeat
            PixelShift_1;
          until ((Retry) > 3) then
            Result:= true;
        end;
    end;

    What I would LIKE for it to do is when PixelShift_1 results true then it will increase the Retry count. When (Retry > 3) three times in a row (consecutively) then "NotFishing" would result true.

    I'm sure I'm super far off... which is why I'm asking for help.
    Any ideas?
    Last edited by Valithor; 04-01-2012 at 11:01 PM.

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

    Default

    Try something like this:

    Simba Code:
    Repeat
      if (PixelShift_1 = true) then
        inc(trys);
      else
        trys := 0;
    until (Trys = 3)

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
  •