Results 1 to 5 of 5

Thread: Woodcutting Functions

  1. #1
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Woodcutting Functions

    Hey I made two woodcutting functions for a script I am making and I realized that they are actually pretty dang useful. One, called IsChopping returns true if you are actually cutting a tree and false if you aren't. The other, IsChopped, figures out if you are done cutting down the tree. While pretty useless by themselves (since they use the text that comes up), together they make a powerful tool that allows you to wait between cutting without having to guess how long it will take to cut down a tree. Simple yet efficient. If there are any bugs or possibilities I forgot let me know!

    SCAR Code:
    function IsChopping: Boolean;
    begin
      FixChat;
      if ((FindBlackChatMessage('You do not have an axe which you have the woodcutting level to use.')) or (FindBlackChatMessage('You need a Woodcutting level of'))) then
      begin
        Result := False;
      end;
      if (FindBlackChatMessage('You swing your axe at the tree')) then
      begin
        Result := True;
      end else
      begin
        Result := False;
      end;
    end;
    SCAR Code:
    function IsChopped: Boolean;
    begin
      FixChat;
      if (FindColorTolerance(x, y, 16711680, MIx1, MIy1, MIx2, MIy2, 5)) then
      begin
      Mouse(x, y, 10, 1, True);
      end;
      if (FindBlackChatMessage('You get some logs.')) then
      begin
        Result := True;
      end else
      begin
        Result := False;
      end;
    end;

    Here is a sample on how you can use them in combination (used after you pick and click on a tree):
    SCAR Code:
    if (IsChopping) then
      begin
        repeat
          Wait(500+random(150));
        until(IsChopped);
      end;

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

    Default

    oaks, willows, yews etc will get many 'you get some logs' but not be chopped.

    ~RM

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

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Nice but Maybe make it click once in a while, becuase sometimes the tree will vanish and it will still Find the color instead use this:
    SCAR Code:
    CountInvItems

    ^ I think^

    Check ammount.scar

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    The first function can be shortened a lot by using or instead of a string of if else's, observe:
    SCAR Code:
    function IsChopping: Boolean;
    begin
      Result := True;
      FixChat;
      if (FindBlackChatMessage('You do not have an axe which you have the woodcutting level to use.')) or (FindBlackChatMessage('You need a Woodcutting level of')) or (FindBlackChatMessage('You swing your axe at the tree')) then
        Result := False;
    end;
    Note: I just have the Result := True at the beginning because then I don't need an else as if it does match one of those phrases then it will get set to false otherwise remain true.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  5. #5
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'll fix it up top, one of those ors is a true instead of a false though.

    There I think I fixed that bit.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Looking for 3 testers with 60+ woodcutting
    By solemn wishes in forum Research & Development Lounge
    Replies: 14
    Last Post: 05-16-2009, 09:22 AM
  2. I'm going for 99 Woodcutting.
    By Riffe in forum RuneScape News and General
    Replies: 6
    Last Post: 10-21-2008, 09:27 PM
  3. First woodcutting script help.
    By bondman in forum OSR Help
    Replies: 4
    Last Post: 11-15-2007, 03:27 AM

Posting Permissions

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