Results 1 to 7 of 7

Thread: my first woodcutter need help..experts!

  1. #1
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default my first woodcutter need help..experts!

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    const
      LoadsPerPlayer = 10; //Amounts of loads per player before switching.
      TreeColor = 3440752;       //Fill in the treecolor here.
      WaitPerTree = 5000; //the time to wait while we are chopping the tree in Miliseconds.

      procedure speed;
      begin
      Mousespeed:=21;
      end;
     

    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 9 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
          9: FindLamp(Players[CurrentPlayer].Skill);
          10: if FindTalk then
              Result := True;
          11: ClickToContinue;
        end;
        wait(1);
      end;
    end;
    Procedure AntiBanActions;
    var
      Ban: Integer;
    begin
      Ban:= Random(10);
     case Ban of
        0: PickUpMouse;
        1: RandomMovement;
        2: BoredHuman;

      end;
    end;

    procedure Randoms;
    begin
      FindNormalRandoms;
      Wait(20 + random(5));
     if (FindFight) then
      begin
        RunAwayDirection('N');
        Wait(4500 + Random(1900));
        RunBack;
      end;
      Wait(20)
        FindTalk;
    end;


    procedure Randomcheck;
    begin
    Findfastrandoms;
    Randoms;
    end;

    function FindObjMultiText2(var cx, cy: Integer; Ut1, UT2, UT3: string; color,
      tolerance: Integer): Boolean;
    var
      x, y, a, c, i, x1, y1, x2, y2: Integer;
    begin
        Color := Color;
      if (FindColorTolerance(x, y, color, msx1, msy1, msx2, msy2, tolerance)) then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if (not (Loggedin)) then
            Break;
          a := a + 1;
          if (a = 1) or (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end
            else if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end
            else if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end
            else if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            if (FindColorTolerance(x, y, Color, x1, y1, x2, y2, tolerance)) then
            begin
              MMouse(x, y, 0, 0)
              Wait(10);
                cx := x;
              cy := y;
              if (IsUpTextMulti(UT1, UT2, UT3)) then
              begin
                Result := True;
                Break;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    procedure ChopTree;
    var
      x, y, MyMark : integer;
    begin
      if not Loggedin then Exit;
      MarkTime(MyMark);
      repeat
        if FindObj(x, y, 'ree', TreeColor,30) then
        begin
          Mouse(x, y, 5, 5, False);
          Randomcheck;
          AntiBanActions;
          if ChooseOption('hop') then
          begin
            Randomcheck;
            Wait(WaitPerTree + Random(1000));
            Exit;
          end;
        end;
        if TimeFromMark(MyMark) > (3 * 60 * 100) then
        begin
          Logout;
          Exit;
        end;
      until false
    end;

    begin
      SetupSRL;
      SRLPlayerForm(True, [], [], [], []);
      if LoggedIn then Logout;
      LoginPlayer;
      repeat
        ChopTree;
        if InvFull then
        begin
          Randomcheck;
          AntiBanActions;
          DropToPosition(4, 28);
          Inc(Players[CurrentPlayer].Banked);
          if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
          begin
            NextPlayer(True);
          end;
        end;
        if not Loggedin then NextPlayer(False);
      until false

    end.

    This is my first almost done script...i need help badly...when it looks for the tree it makes it so detectable! It starts to for a square..it gets bigger and bigger until it can find the tree..if u dont understand what im saying please try the script...how can i get rid of the making square thing..and just make it go to the tree? plz any help would be appreciated!

    btw if u find any corrections need it can u correct it and post it rather than just telling me whats wrong...thanks!

  2. #2
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dont just look for a color, use the FindObjEx

    function FindObjEx(var x, y: Integer; ObjText: String; x1, y1, x2, y2, Color, Tol, MinXDist, MinYDist, WaitPerCheck: Integer; Spiral: Boolean): Boolean;
    SCAR Code:
    If (FindObjEx(x,y,'Oak',273,58,418,271,4285541,0,7,7,300,false))then

    4285541 is used oak color.

    That way, it will look for the color on your screen and then checks if it is "Oak". If it is continue with your procedure with chopping / looking for ents.

    You also need to pick a good color that isnt everywhere on the screen.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  3. #3
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Failed when compiling
    Line 95: [Error] (14776:10): Duplicate identifier 'FINDOBJEX' in script C:\Documents and Settings\Owner\My Documents\Grade 7\SCAR 3.12\Scripts\help.scar


    i changed it to wat u said...this keeps coming? anyone got any ideas?...plz

  4. #4
    Join Date
    Dec 2006
    Location
    Florida, U.S.A
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    post your new script with the error. it looks like you put in that function in as a procedure and as a function and thats what it recognizes it as.

  5. #5
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    const
      LoadsPerPlayer = 10; //Amounts of loads per player before switching.
      TreeColor = 264456;       //Fill in the treecolor here.
      WaitPerTree = 5000; //the time to wait while we are chopping the tree in Miliseconds.

      procedure speed;
      begin
      Mousespeed:=21;
      end;
     

    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 9 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
          9: FindLamp(Players[CurrentPlayer].Skill);
          10: if FindTalk then
              Result := True;
          11: ClickToContinue;
        end;
        wait(1);
      end;
    end;
    Procedure AntiBanActions;
    var
      Ban: Integer;
    begin
      Ban:= Random(10);
     case Ban of
        0: PickUpMouse;
        1: RandomMovement;
        2: BoredHuman;

      end;
    end;

    procedure Randoms;
    begin
      FindNormalRandoms;
      Wait(20 + random(5));
     if (FindFight) then
      begin
        RunAwayDirection('N');
        Wait(4500 + Random(1900));
        RunBack;
      end;
      Wait(20)
        FindTalk;
    end;


    procedure Randomcheck;
    begin
    Findfastrandoms;
    Randoms;
    end;

    function FindObjEx(var x, y: Integer; ObjText: String; x1, y1, x2, y2, Color, Tol, MinXDist, MinYDist,
    WaitPerCheck: Integer; Spiral: Boolean): Boolean;
    var
      x, y, a, c, i, x1, y1, x2, y2: Integer;
    begin
        Color := Color;
      if (FindColorTolerance(x, y, 264456, msx1, msy1, msx2, msy2, tolerance)) then
      begin
        x1 := 245;
        y1 := 165;
        x2 := 277;
        y2 := 185;
        repeat
          if (not (Loggedin)) then
            Break;
          a := a + 1;
          if (a = 1) or (a = 3) then
            c := c + 1;
          for i := 1 to c do
          begin
            if (a = 1) then
            begin
              x1 := x1 + 30;
              x2 := x2 + 30;
            end
            else if (a = 2) then
            begin
              y1 := y1 - 20;
              y2 := y2 - 20;
            end
            else if (a = 3) then
            begin
              x1 := x1 - 30;
              x2 := x2 - 30;
            end
            else if (a = 4) then
            begin
              y1 := y1 + 20;
              y2 := y2 + 20;
            end;
            if (x1 = 485) and (x2 = 517) then
              x2 := x2 - 2;
            if (y1 = 325) and (y2 = 345) then
              y2 := y2 - 7;
            if (x2 > 515) then
              Break;
            if (FindColorTolerance(x, y, Color, x1, y1, x2, y2, tolerance)) then
            begin
              MMouse(x, y, 0, 0)
              Wait(10);
                cx := x;
              cy := y;
              if (IsUpTextMulti(UT1, UT2, UT3)) then
              begin
                Result := True;
                Break;
              end;
            end;
          end;
          if (a = 4) then
            a := 0;
        until (x2 > 515) or (Result = True);
      end;
    end;

    procedure ChopTree;
    var
      x, y, MyMark : integer;
    begin
      if not Loggedin then Exit;
      MarkTime(MyMark);
      repeat
        If (FindObjEx(x,y,'ree',273,58,418,271,264456,0,7,7,300,false))then

        begin
          Mouse(x, y, 5, 5, False);
          Randomcheck;
          AntiBanActions;
          if ChooseOption('ree') then
          begin
            Randomcheck;
            Wait(WaitPerTree + Random(1000));
            Exit;
          end;
        end;
        if TimeFromMark(MyMark) > (3 * 60 * 100) then
        begin
          Logout;
          Exit;
        end;
      until false
    end;

    begin
      SetupSRL;
      SRLPlayerForm(True, [], [], [], []);
      if LoggedIn then Logout;
      LoginPlayer;
      repeat
        ChopTree;
        if InvFull then
        begin
          Randomcheck;
          AntiBanActions;
          DropToPosition(4, 28);
          Inc(Players[CurrentPlayer].Banked);
          if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
          begin
            NextPlayer(True);
          end;
        end;
        if not Loggedin then NextPlayer(False);
      until false

    end.


    here is the revised script..it keeps saying duplicate FindObjEX..plz any1 help me a.s.a.p.

  6. #6
    Join Date
    Dec 2006
    Location
    Florida, U.S.A
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you don't have to copy functions from srl files. if you find the file with that function in it then all you have to do is put this in your script: {.include SRL\SRL\Whatever the rest of the include file directory is\include.scar}

    ex.
    SCAR Code:
    program New;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Mining.scar}

    also. sorry but your power chopper is dead beyond resurection. i tried ot fix it but after me fixing like 3 things and it giving me 3 more errors, im at the end of my knowledge. sorry. i wish you good luck on this.

  7. #7
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    thanks but if i put {.include SRL\SRL.scar} i dont need to put
    this rite? {.include SRL\SRL\skill\Mining.scar} because srl/srl.scar means everything am i rite?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Woodcutter
    By snot in forum First Scripts
    Replies: 14
    Last Post: 09-01-2015, 10:11 AM
  2. woodcutter help
    By psychojamesd in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 07-27-2007, 02:57 PM
  3. i need a woodcutter
    By anaujiram in forum RS3 Outdated / Broken Scripts
    Replies: 2
    Last Post: 07-13-2007, 03:13 PM
  4. My Woodcutter
    By Pbjj in forum OSR Help
    Replies: 4
    Last Post: 06-08-2007, 08:30 PM

Posting Permissions

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