Results 1 to 8 of 8

Thread: Woodcutting.scar update

  1. #1
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default Woodcutting.scar update

    The current FindBirdsNest is a procedure, could a dev change it to this:

    SCAR Code:
    {*******************************************************************************
    Function FindBirdsNest: Boolean;
    By: Liquid and Starblaster100 with edit by cycrosism
    Description: If a birds nest is found, it will pick it up
    *******************************************************************************}


    Function FindBirdsNest: Boolean;
    var
      tries, x, y: Integer;
      s: string;
    begin
      if (not (GetLastChatText(s))) then
        LastChatter(s);
      if (Pos(s, 'A bird') <> 0) then
      begin
        repeat
          if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
            not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
            not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
          begin
            KeyDown(VK_LEFT);
            Wait(700 + Random(500));
            KeyUp(VK_LEFT);
            Wait(400 + Random(300));
          end;
          if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
            not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
            not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
          begin
            x := 648;
            y := 83;
            tries := tries + 1;
            FindColorSpiral(x, y, 241, 570, 5, 725, 155);
            Mouse(x + 3, y + 3, 2, 2, True);
            Flag;
            Wait(200 + Random(100));
          end;
          if (FindObj(x, y, 'Take Bird', 3952984, 10)) or
            (FindObj(x, y, 'Take Bird', 1713706, 10)) or
            (FindObj(x, y, 'Take Bird', 1581604, 10)) then
          begin
            WriteLn('Birds Nest Found');
            Result := True;
            Wait(450 + Random(400));
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, True);
            Flag;
            Wait(500 + Random(300));
            if (Screenshots) then
              SaveScreenshot('Birds Nest - SRL - ' + IntToStr(GetTimeRunning) + '.bmp');
            tries := tries + 100;
     //       Birdsnest := Birdsnest + 1;
            Mouse(583, 226, 2, 2, False);
            Wait(100 + Random(100));
            ChooseOption('Examine');
            Exit;
          end;
        until (FindObj(x, y, 'Take Bird', 3952984, 10)) or
          (FindObj(x, y, 'Take Bird', 1713706, 10)) or
          (FindObj(x, y, 'Take Bird', 1581604, 10)) or (tries > 5)
      end;
    end;

    It is just easier to use and better when it returns something
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  2. #2
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I believe that other people have made better birdnest functions.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  3. #3
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    I didn't make it i just made it a function and added Result := True; to it
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Done and done although I don't even think this works.

  5. #5
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Try this:
    SCAR Code:
    Function SearchBirdsNest: Boolean;
    Var
      CTS, i, x, y : Integer;
      NestATPA : T2DPointArray;
      NestTPA : TPointArray;
      Nest : TPoint;
      Timer : LongInt;
    Begin
      If (FindText(x, y, 'nest falls', SmallChars, 0, 400, 495, 460)) then
      Begin
        MarkTime(Timer);
        Repeat
          CTS := GetColorToleranceSpeed;
          ColorToleranceSpeed(2);
          x := MSCX;
          y := MSCY;
          FindColorsSpiralTolerance(x, y, NestTPA, 3952984, MSCX - 100, MSCY - 100, MSCX + 100, MSCY + 100, 15);
          NestATPA := TPAtoATPAEx(NestTPA, 5, 5);
          For i := 0 to (Length(NestATPA) - 1) Do
          Begin
            If (TimeFromMark(Timer) >= (10000)) Then
              Exit;
            Nest := MIddleTPA(NestATPA[I]);
            MMouse(Nest.x, Nest.y, 5, 5);
            Wait(50 + Random(100));
            If IsUpText('ird') Then
            Begin
              Mouse(Nest.X, Nest.Y, 5, 5, True);
              Result := True;
              Inc(User[CurrentPlayer].Nests);
              Wait(250 + Random(150));
              Write('Birds nest found.');
              Exit;
            End;
          End;
        Until((TimeFromMark(Timer) >= (10000)) Or Result);
        Exit;
      End;
    End;

    Worked last time I checked in my private wcer.
    Ce ne sont que des gueux


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

    Default

    yeah... that function definitely nees a re-write.

    ~RM

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

  7. #7
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Rasta Magician View Post
    yeah... that function definitely nees a re-write.

    ~RM
    Hehe, 12 FindObjs to find one thing... I lol'd. No offence to Star and Liquid.

  8. #8
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    I believe mine works, I could have swore I committed it.

    It is really fast.

    I will commit tomorrow, check the pub svn for it if you like.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •