Results 1 to 22 of 22

Thread: Woodcutter Script Help.

  1. #1
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Woodcutter Script Help.

    Here is my script:

    SCAR Code:
    Program DraynorPowercutter;
    {.include SRL/SRL.Scar}
     {.include SRL/SRL/Skill/Woodcutting.Scar}

    Var
     X, Y, I, Dropped : Integer;
     
    Procedure DeclarePlayers;
    Begin
     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Strings[1] := 'No'; //Is your axed equipped? Yes/No?
    End;

    Procedure AntiBan;
    Var
      X, Y : Integer;
      RCompass : TStringArray;
    Begin
      RCompass := ['E', 'S', 'W'];
      Case Random(100) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('Random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: Begin
             MakeCompass(RCompass);
             Wait(2500 + Random(1000));
             MakeCompass('N');
        End;
      End;
    End;

    Procedure ProgressReport;
    Begin
      ClearDebug;
      WriteLn('|===================================================|');
      WriteLn('|               Draynor Powercutter V0              |');
      WriteLn('|===================================================|');
      WriteLn('| The script has been running for ' + TimeRunning + '         |');
      WriteLn('| You have dropped ' + inttostr(Dropped) + ' Willow Logs.                       |');
      WriteLn('| You have earned ' + inttostr(Dropped * 9) + ' Experience.                     |');
      WriteLn('|===================================================|');
      WriteLn('|                Created By: Devoker                |');
      WriteLn('|===================================================|');
    End;

    Procedure Cutter;
    Var
      Failed : Integer;
      TreeColors : Array [0..4] of Integer;
    Begin
     If (not LoggedIn) then Exit;
    Begin
     TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;

    Procedure Dropper;
    Begin
     case lowercase(Players[CurrentPlayer].Strings[1]) of
      'Yes' : Begin
            for I := 1 to 28 do
             begin
              DropItem(I);
              Inc(Dropped);
             End;
           End;

      'No' : Begin
           for I := 2 to 28 do
            begin
             DropItem(I);
             Inc(Dropped);
            End;
           End;
      End;
     End;



    Procedure DoOnce;
    Begin
     ClearDebug;
     SetupSRL;
     DeclarePlayers;
     LoginPlayer;
    End;

    Procedure MainLoop;
    Begin
     SetAngle(True);
     Wait(1000);
     SetRun(True);
     Repeat
      If InvFull Then
      Begin
       Dropper;
      End;
      ProgressReport;
     Until (not LoggedIn)
    End;

    Begin
      DoOnce;
      MainLoop;
      ProgressReport;
    End.

    Here is the problem:

    Code:
    [Runtime Error] : Out Of Range in line 10 in script

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to set the length of your players:
    scar Code:
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := =0;

     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Strings[1] := 'No'; //Is your axed equipped? Yes/No?
    End;


  3. #3
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What do you mean by, 'Set The Length'?

  4. #4
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In an array you have to set the Array length so the script knows how long it is...

    In this case
    Code:
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := =0;
    Sets the player array length

  5. #5
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    The [0], for declare players is an array. You need to declare the length of the array. In this case, you must declare the amount of players and other variables which go along with it.

    Here's an array tut just in case you need to know more.

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

  6. #6
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now it's going to some tab called, 'Math' and it does an error:

    Script:

    SCAR Code:
    Program DraynorPowercutter;
    {.include SRL/SRL.Scar}
     {.include SRL/SRL/Skill/Woodcutting.Scar}

    Var
     X, Y, I, Dropped : Integer;
     
    Procedure DeclarePlayers;
    Begin
     HowManyPlayers := 1;
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0;

     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Strings[1] := 'No'; //Is your axed equipped? Yes/No?
    End;

    Procedure AntiBan;
    Var
      X, Y : Integer;
      RCompass : TStringArray;
    Begin
      RCompass := ['E', 'S', 'W'];
      Case Random(100) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('Random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: Begin
             MakeCompass(RCompass);
             Wait(2500 + Random(1000));
             MakeCompass('N');
        End;
      End;
    End;

    Procedure ProgressReport;
    Begin
      ClearDebug;
      WriteLn('|===================================================|');
      WriteLn('|               Draynor Powercutter V0              |');
      WriteLn('|===================================================|');
      WriteLn('| The script has been running for ' + TimeRunning + '         |');
      WriteLn('| You have dropped ' + inttostr(Dropped) + ' Willow Logs.                       |');
      WriteLn('| You have earned ' + inttostr(Dropped * 9) + ' Experience.                     |');
      WriteLn('|===================================================|');
      WriteLn('|                Created By: Devoker                |');
      WriteLn('|===================================================|');
    End;

    Procedure Cutter;
    Var
      Failed : Integer;
      TreeColors : Array [0..4] of Integer;
    Begin
     If (not LoggedIn) then Exit;
    Begin
     TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;

    Procedure Dropper;
    Begin
     case lowercase(Players[CurrentPlayer].Strings[1]) of
      'Yes' : Begin
            for I := 1 to 28 do
             begin
              DropItem(I);
              Inc(Dropped);
             End;
           End;

      'No' : Begin
           for I := 2 to 28 do
            begin
             DropItem(I);
             Inc(Dropped);
            End;
           End;
      End;
     End;



    Procedure DoOnce;
    Begin
     ClearDebug;
     SetupSRL;
     DeclarePlayers;
     LoginPlayer;
    End;

    Procedure MainLoop;
    Begin
     SetAngle(True);
     Wait(1000);
     SetRun(True);
     Repeat
      If InvFull Then
      Begin
       Dropper;
      End;
      ProgressReport;
     Until (not LoggedIn)
    End;

    Begin
      DoOnce;
      MainLoop;
      ProgressReport;
    End.

    Error:

    Code:
    [Runtime Error] : Exception:  in line 46 in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Core/Math.scar

  7. #7
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Post that line please.
    Also have you updated you SRL?

    T~M

  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In Scar, go to Tools > Options > SRL Download > and press a button called 'Move plugins'.


  9. #9
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    update srl and btw it would be easier to do


    Code:
    Program DraynorPowercutter;
    {.include SRL/SRL.Scar}
     {.include SRL/SRL/Skill/Woodcutting.Scar}
    
    Var
     X, Y, I, Dropped : Integer;
     
    Procedure DeclarePlayers;
    Begin
     HowManyPlayers := 1;
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0;
    
     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Booleans[1] := false; //Is your axed equipped? True or false
    End;
    
    Procedure AntiBan;
    Var
      X, Y : Integer;
      RCompass : TStringArray;
    Begin
      RCompass := ['E', 'S', 'W'];
      Case Random(100) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('Random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: Begin
             MakeCompass(RCompass);
             Wait(2500 + Random(1000));
             MakeCompass('N');
        End;
      End;
    End;
    
    Procedure ProgressReport;
    Begin
      ClearDebug;
      WriteLn('|===================================================|');
      WriteLn('|               Draynor Powercutter V0              |');
      WriteLn('|===================================================|');
      WriteLn('| The script has been running for ' + TimeRunning + '         |');
      WriteLn('| You have dropped ' + inttostr(Dropped) + ' Willow Logs.                       |');
      WriteLn('| You have earned ' + inttostr(Dropped * 9) + ' Experience.                     |');
      WriteLn('|===================================================|');
      WriteLn('|                Created By: Devoker                |');
      WriteLn('|===================================================|');
    End;
    
    Procedure Cutter;
    Var
      Failed : Integer;
      TreeColors : Array [0..4] of Integer;
    Begin
     If (not LoggedIn) then Exit;
    Begin
     TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;
    
    Procedure Dropper;
    Begin
     case lowercase(Players[CurrentPlayer].Strings[1]) of
      'Yes' : Begin
            for I := 1 to 28 do
             begin
              DropItem(I);
              Inc(Dropped);
             End;
           End;
    
      'No' : Begin
           for I := 2 to 28 do
            begin
             DropItem(I);
             Inc(Dropped);
            End;
           End;
      End;
     End;
    
    
    
    Procedure DoOnce;
    Begin
     ClearDebug;
     SetupSRL;
     DeclarePlayers;
     LoginPlayer;
    End;
    
    Procedure MainLoop;
    Begin
     SetAngle(True);
     Wait(1000);
     SetRun(True);
     Repeat
      If InvFull Then
      Begin
       Dropper;
      End;
      ProgressReport;
     Until (not LoggedIn)
    End;
    
    Begin
      DoOnce;
      MainLoop;
      ProgressReport;
    End.

  10. #10
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    My Script:

    SCAR Code:
    Program DraynorPowercutter;
    {.include SRL/SRL.Scar}
     {.include SRL/SRL/Skill/Woodcutting.Scar}

    Var
     X, Y, I, Dropped : Integer;
     
    Procedure DeclarePlayers;
    Begin
     HowManyPlayers := 1;
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0;

     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Strings[1] := 'No'; //Is your axed equipped? Yes/No?
    End;

    Procedure AntiBan;
    Var
      X, Y : Integer;
      RCompass : TStringArray;
    Begin
      RCompass := ['E', 'S', 'W'];
      Case Random(100) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('Random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: Begin
             MakeCompass(RCompass);
             Wait(2500 + Random(1000));
             MakeCompass('N');
        End;
      End;
    End;

    Procedure ProgressReport;
    Begin
      ClearDebug;
      WriteLn('|===================================================|');
      WriteLn('|               Draynor Powercutter V0              |');
      WriteLn('|===================================================|');
      WriteLn('| The script has been running for ' + TimeRunning + '         |');
      WriteLn('| You have dropped ' + inttostr(Dropped) + ' Willow Logs.                       |');
      WriteLn('| You have earned ' + inttostr(Dropped * 9) + ' Experience.                     |');
      WriteLn('|===================================================|');
      WriteLn('|                Created By: Devoker                |');
      WriteLn('|===================================================|');
    End;

    Procedure Cutter;
    Var
      Failed : Integer;
      TreeColors : Array [0..4] of Integer;
    Begin
     If (not LoggedIn) then Exit;
    Begin
     TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[I], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;

    Procedure Dropper;
    Begin
     case lowercase(Players[CurrentPlayer].Strings[1]) of
      'Yes' : Begin
            for I := 1 to 28 do
             begin
              DropItem(I);
              Inc(Dropped);
             End;
           End;

      'No' : Begin
           for I := 2 to 28 do
            begin
             DropItem(I);
             Inc(Dropped);
            End;
           End;
      End;
     End;



    Procedure DoOnce;
    Begin
     ClearDebug;
     SetupSRL;
     DeclarePlayers;
     LoginPlayer;
    End;

    Procedure MainLoop;
    Begin
     SetAngle(True);
     Wait(1000);
     SetRun(True);
     Repeat
      If InvFull Then
      Begin
       Dropper;
      End;
      ProgressReport;
     Until (not LoggedIn)
    End;

    Begin
      DoOnce;
      MainLoop;
      ProgressReport;
    End.

    Error:

    Code:
    [Runtime Error] : Exception:  in line 46 in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Core/Math.scar
    Math Script:

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               » Math Routines                               --//
    //-----------------------------------------------------------------//
    // * procedure LoadCoSineArrays;                                                                           // * by Mutant Squirrle
    // * function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;                              // * by Raymond
    // * function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;                                   // * by BenLand100
    // * function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;                        // * by BenLand100
    // * function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;                                 // * by BenLand100
    // * function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer): Boolean;              // * by BenLand100
    // * function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; X, Y: Integer): Boolean; // * by BenLand100
    // * function Sine(degrees: Integer): Extended;                                                            // * by ?
    // * function Cose(degrees: Integer): Extended;                                                            // * by ?

    Var
       SineArray, Cosearray: Array[0..360] Of Extended;
       
    {*******************************************************************************
    procedure LoadCoSineArrays;
    By: Mutant Squirrle
    Description: Loads arrays for use with Radial- and LinearWalk.
    *******************************************************************************}


    procedure LoadCoSineArrays;
    var
      i: Integer;
    begin
      for i := 0 to 360 do
      begin
        Sinearray[i] := Sin(i * Pi / 180);
        Cosearray[i] := Cos(i * Pi / 180);
      end;
    end;

    {*******************************************************************************
    Function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;
    By: MastaRaymond
    Description: Returns the TPointArray of the inputted Text. Needs Wizzyplugin
    *******************************************************************************}


    Function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;
    var
      TempBMP : integer;
    begin;
      TempBMP := CreateBitmapMaskFromText(Txt,Chars);
      Result := CreateTPAFromBMP( GetBitmapDC(TempBMP));
      FreeBitmap(TempBMP);
    end;


    {*******************************************************************************
    function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;
    By: BenLand100
    Description: Returns the point on a spline, defined by control points Points, at Theta
    *******************************************************************************}


    function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;
    var
      i, n: Integer;
      XTemp, YTemp: Extended;
    begin
      n := GetArrayLength(Points) - 1;
      for i := 0 to n do
      begin
        XTemp := XTemp + (BinCoe(n, i) * Points[i].x * Pow((1 - Theta), n - i) *
          Pow(Theta, i));
        YTemp := YTemp + (BinCoe(n, i) * Points[i].y * Pow((1 - Theta), n - i) *
          Pow(Theta, i));
      end;
      Result.x := Round(XTemp);
      Result.y := Round(YTemp);
    end;

    {*******************************************************************************
    function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;
    By: BenLand100
    Description: Returns a spline, defined by control points Points, incrementing theta by ThetaInc
    *******************************************************************************}


    function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;
    var
      i: Integer;
      t: Extended;
      temp, last: TPoint;
      done: Boolean;
    begin
      repeat
        if t >= 1 then
        begin
          t := 1;
          done := True;
        end;
        temp := GetSplinePt(Points, t);
        if ((temp.x <> last.x) and (temp.y <> last.y)) then
        begin
          i := i + 1;
          SetArrayLength(Result, i);
          Result[i - 1] := temp;
          last := temp;
        end;
        t := t + ThetaInc;
      until (done)
    end;

    {*******************************************************************************
    function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;
    By: BenLand100
    Description: Adds midpoints to Path so no distance on it is greater than MaxDist
    *******************************************************************************}


    function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;
    var
      i, c: Integer;
      last: TPoint;
      done: Boolean;
    begin
      if (getarraylength(path) > 0) then
      begin
        repeat
          last := Path[0];
          done := True;
          for i := 1 to GetArrayLength(Path) - 1 do
          begin
            if Sqrt(Pow((Path[i].x - last.x), 2) + Pow((Path[i].y - last.y), 2)) >
              MaxDist then
            begin
              done := False;
              SetArrayLength(Path, GetArrayLength(Path) + 1);
              for c := GetArrayLength(Path) - 1 downto i + 1 do
              begin
                Path[c] := Path[c - 1];
              end;
              Path[i].x := Round((last.x + Path[i + 1].x) / 2);
              Path[i].y := Round((last.y + Path[i + 1].y) / 2);
            end;
            last := Path[i];
          end;
        until (done);
      end;
      Result := Path;
    end;

    {*******************************************************************************
    function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer): Boolean;
    By: BenLand100
    Description: Returns true if point x, y is in an abstract box defined by x1, y1, x2, y2, x3, y3, x4, y4
    An abstract box example:

    x1, y1     x2, y2
       +--------+
        \         /
         \       /
          +--+
    x4, y4    x3, y3
    *******************************************************************************}


    function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer):
      Boolean;
    var
      U, D, R, L: Boolean;
      UB, DB, LB, RB, UM, DM, LM, RM: Extended;
    begin
      UM := (-y1 - -y2) div (x1 - x2);
      DM := (-y4 - -y3) div (x4 - x3);
      if x1 - x4 <> 0 then
      begin
        LM := (-y1 - -y4) div (x1 - x4);
      end else
      begin
        LM := Pi;
      end;
      if x2 - x3 <> 0 then
      begin
        RM := (-y2 - -y3) div (x2 - x3);
      end else
      begin
        RM := Pi;
      end;
      UB := -(UM * x1) + -y1
        RB := -(RM * x2) + -y2;
      DB := -(DM * x3) + -y3;
      LB := -(LM * x4) + -y4;
      if (UM * x + UB >= -y) then U := True;
      if (DM * x + DB <= -y) then D := True;
      if (RM <> Pi) and (RM >= 0) and (RM * x + RB <= -y) then R := True;
      if (RM <> Pi) and (RM < 0) and (RM * x + RB >= -y) then R := True;
      if (RM = Pi) and (x < x2) then R := True;
      if (LM <> Pi) and (LM >= 0) and (LM * x + LB >= -y) then L := True;
      if (LM <> Pi) and (LM < 0) and (LM * x + LB <= -y) then L := True;
      if (LM = Pi) and (x > x1) then L := True;
      if U and D and L and R then Result := True;
    end;

    {*******************************************************************************
    function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; X, Y: Integer): Boolean;
    By: BenLand100
    Description: Returns True if X and Y fall within Radius1 to Radius2 and Angle1 to Angle2
    Note1: EVERYTHING IS RELATIVE TO ORIGIN!!!
    Note2: This checks in the smallest segment of the circle formed by Angle1 and Angle 2
    Example: (Assume the origin is 0,0)
     inAngle(0, 90, 5, 10, origin, 5, 5) = true;
     inAngle(0, 90, 0, 5, origin, 5, 5) = false;
     inAngle(90, 0, 5, 10, origin, 5, 5) = false;
    *******************************************************************************}


    function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; x,
      y: Integer): Boolean;
    var
      PTemp: PPoint;
      OTemp: TPoint;
      MinAngle, MaxAngle, MinRadius, MaxRadius: Extended;
    begin
      Angle1 := FixD(Angle1);
      Angle2 := FixD(Angle2);
      MinAngle := Angle1;
      if Angle1 > Angle2 then MinAngle := Angle2;
      MaxAngle := Angle1;
      if Angle1 < Angle2 then MaxAngle := Angle2;
      MinRadius := Radius1;
      if Radius1 > Radius2 then MinRadius := Radius2;
      MaxRadius := Radius1;
      if Radius1 < Radius2 then MaxRadius := Radius2;
      OTemp.x := x;
      OTemp.y := y;
      PTemp := ToPolarOffset(OTemp, Origin);
      if (PTemp.R >= MinRadius) and (PTemp.R <= MaxRadius) then
        if (PTemp.T >= MinAngle) and (PTemp.T <= MaxAngle) then
          Result := True;
    end;

    {*******************************************************************************
    function Sine(degrees: Integer): Extended;
    By:
    Description:
    *******************************************************************************}


    function Sine(Degrees: Integer): Extended;
    begin
      Result := sinearray[Trunc(FixD(Degrees))];
    end;

    {*******************************************************************************
    function Cose(degrees: Integer): Extended;
    By:
    Description:
    *******************************************************************************}


    function Cose(Degrees: Integer): Extended;
    begin
      Result := cosearray[Trunc(FixD(Degrees))];
    end;

  11. #11
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    update srl and btw it would be easier to do


    Code:
    Program DraynorPowercutter;
    {.include SRL/SRL.Scar}
     {.include SRL/SRL/Skill/Woodcutting.Scar}
    
    Var
     X, Y, I, Dropped : Integer;
     
    Procedure DeclarePlayers;
    Begin
     HowManyPlayers := 1;
     NumberOfPlayers(HowManyPlayers);
     CurrentPlayer := 0;
    
     Players[0].Name := ''; //Enter your Runescape Username here.
     Players[0].Pass := ''; //Enter your Runescape Password here.
     Players[0].Nick := ''; //Enter a Nickname for yourself here. 3-4 Characters.
     Players[0].Booleans[1] := false; //Is your axed equipped? True or false
    End;
    
    Procedure AntiBan;
    Var
      X, Y : Integer;
      RCompass : TStringArray;
    Begin
      RCompass := ['E', 'S', 'W'];
      Case Random(100) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('Random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: Begin
             MakeCompass(RCompass);
             Wait(2500 + Random(1000));
             MakeCompass('N');
        End;
      End;
    End;
    
    Procedure ProgressReport;
    Begin
      ClearDebug;
      WriteLn('|===================================================|');
      WriteLn('|               Draynor Powercutter V0              |');
      WriteLn('|===================================================|');
      WriteLn('| The script has been running for ' + TimeRunning + '         |');
      WriteLn('| You have dropped ' + inttostr(Dropped) + ' Willow Logs.                       |');
      WriteLn('| You have earned ' + inttostr(Dropped * 9) + ' Experience.                     |');
      WriteLn('|===================================================|');
      WriteLn('|                Created By: Devoker                |');
      WriteLn('|===================================================|');
    End;
    
    Procedure Cutter;
    Var
      Failed : Integer;
      TreeColors : Array [0..4] of Integer;
    Begin
     If (not LoggedIn) then Exit;
    Begin
     TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;
    
    Procedure Dropper;
    Begin
     case lowercase(Players[CurrentPlayer].Strings[1]) of
      'Yes' : Begin
            for I := 1 to 28 do
             begin
              DropItem(I);
              Inc(Dropped);
             End;
           End;
    
      'No' : Begin
           for I := 2 to 28 do
            begin
             DropItem(I);
             Inc(Dropped);
            End;
           End;
      End;
     End;
    
    
    
    Procedure DoOnce;
    Begin
     ClearDebug;
     SetupSRL;
     DeclarePlayers;
     LoginPlayer;
    End;
    
    Procedure MainLoop;
    Begin
     SetAngle(True);
     Wait(1000);
     SetRun(True);
     Repeat
      If InvFull Then
      Begin
       Dropper;
      End;
      ProgressReport;
     Until (not LoggedIn)
    End;
    
    Begin
      DoOnce;
      MainLoop;
      ProgressReport;
    End.
    Tell him what you changed, you cant expect him to spot it out.

    T~M

  12. #12
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    oh srry i changed the string in the declare players to a Booleans a true or false statement

  13. #13
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your cutting procedure looks similar to Torrent of Flame's

    Yours:
    SCAR Code:
    TreeColors[0] := 6650991;
     TreeColors[1] := 4678229;
     TreeColors[2] := 3825743;
     TreeColors[3] := 3360830;
     TreeColors[4] := 3166530;
     for I := 0 to 4 do
      if FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']) then
      Begin
       Repeat
        FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])
        Wait(500 + Random(250));
        MMouse(X, Y, 2, 2);
        Begin
         Wait(250 + Random(100));
         Wait(250 + Random(100));
         Case Random(2) Of
          0: Begin
           Mouse(X, Y, 4, 4, False);
           Wait(250 + Random(100));
           ChooseOption('Hop');
           WriteLn('Chopping Tree');;
          end;
          1: Begin
           Mouse(X, Y, 4, 4, True);
           WriteLn('Chopping Tree');
          End;
         End;
         Wait(3000 + Random(500));
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         MMouse(X,Y, 2, 2);
         FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
         Wait(3000 + Random(500));
         AntiBan;
         If Not (LoggedIn) Then
         LoginPlayer;
        End;
       Until InvFull or not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       While (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) do
       repeat
        if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
         MakeCompass('N');
         Wait(250 + Random(100));
          if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
           MakeCompass('E');
           Wait(250 + Random(100));
            if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
             MakeCompass('W');
             Wait(250 + Random(100));
              if (not FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo'])) then
               inc(Failed);
       Until FindObjTPA(X, Y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'llow', 'illo']);
       If (Failed=5) Then
        Begin
         WriteLn('Tree Finding Failed :(');
         ProgressReport;
         LoginPlayer;
        End;
       End;
      End;
     End;

    Torrent of Flame's
    SCAR Code:
    'willow': begin
                  TreeColors[0] := 2181686;
                  TreeColors[1] := 6193521;
                  TreeColors[2] := 3755332;
                  TreeColors[3] := 3234376;
                  for i := 0 to 3 do
                  if FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow']) then
                    begin
                    repeat
                      FindEnts(x, y, True);
                      FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])
                      Wait(100 + Random(300));
                      MMouse(x, y, 2, 2);
                      begin
                        Wait(100 + Random(200));
                        Wait(100 + Random(200));
                      case Random(2) of
                      0: begin
                           Mouse(x, y, 4, 4, False);
                           Wait(100 + Random(200));
                           ChooseOption('hop');
                           WriteLn('Chopping Tree');;
                         end;
                      1: begin
                           Mouse(x, y, 4, 4, True);
                           WriteLn('Chopping Tree');
                         end;
                      end;
                      Wait(3000 + Random(400));
                      FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])
                      MMouse(x, y, 2, 2);
                      FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])
                      Wait(3000 + Random(400));
                      AntiBan;
                      FindRandoms;
                      if not (LoggedIn) then
                        NextPlayer(False);
                        LoginPlayer;
                  end;
                  until Invfull or not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow']);
                  while (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])) do
                  repeat
                    if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])) then
                      MakeCompass('N');
                      Wait(100 + Random(300));
                      if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])) then
                        MakeCompass('E');
                        Wait(100 + Random(300));
                        if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])) then
                          MakeCompass('W');
                          Wait(100 + Random(300));
                          if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow'])) then
                            Inc(Failed);
                  until FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, ['Willow', 'Will', 'illo', 'llow']) or (Failed = 5);
                  if (Failed = 5) then
                  begin
                    WriteLn('Tree Finding Failed :(');
                    ProgressReport;
                    NextPlayer(False);
                    LoginPlayer;
                  end;
                end;
             end;

    You should credit him for that procedure.

  14. #14
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you running it with RS opened, and crosshair has been dragged to the rs window?

  15. #15
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, I am. And I did give credit to him. I just didn't copy that part of it.

  16. #16
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works for me. SCAR 3.20d and newest dev rev :]

  17. #17
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Devoker View Post
    Yes, I am. And I did give credit to him. I just didn't copy that part of it.
    Oh okay, if you are still getting this error
    Code:
    [Runtime Error] : Exception:  in line 46 in script C:\Program Files\SCAR 3.20\includes\SRL/SRL/Core/Math.scar
    then I think you have to move your plugins.

  18. #18
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    New problem:

    Script:

    SCAR Code:
    program AutoWillowcutter;
    {.include SRL/SRL.Scar}
      {.include SRL/SRL/Skill/Woodcutting.Scar}

    Var
      x, y, i, Dropped, WcLvl, EWcLvl, Loads : Integer;

    Const
      WieldAxe = 'False'; //Are you weilding an axe?
      LoadsToDo = 2; //How many loads to you want to do?

    Procedure AntiRandoms;
    Begin
      LampSkill := 'Woodcutting';
      FindNormalRandoms;
      FindEnt(x, y, True);
      If (FindFight) Then
      Begin
        RunAway('N', False, 1, 1000 + Random(500));
      End;
    End;

    Procedure AntiBan;
    Var
      RandomCompass : TStringArray;
    Begin
      RandomCompass := ['E', 'S', 'W'];
      MakeCompass(RandomCompass);
      Wait(2500 + Random(1000));
      MakeCompass('N');
      Case Random(50) Of
        0: BoredHuman;
        1: RandomMovement;
        2: PickUpMouse;
        3,4: HoverSkill('random', False);
        5: MMouse(Random(X), Random(Y), 0, 0);
        6: WriteLn('Woodcutting Levels?');
      End;
    End;

    Procedure Cutter;
    Var
      WillowColors : Array [0..4] of Integer;
    Begin
      WillowColors[0] := 3163964
      WillowColors[1] := 4025190
      WillowColors[2] := 4021327
      WillowColors[3] := 4286041
      WillowColors[4] := 3299411
      Begin
        For i := 0 To 4 Do
        If FindObj(x, y, 'illo', WillowColors[i], 30) Then
        Begin
          Mouse(x, y, 2, 3, True);
          Wait(5000 + Random(2500));
        End;
      End;
    End;

    Procedure Dropper;
    Begin
      Case WieldAxe Of
        'True' : Begin
          For i := 1 to 28 Do
          Begin
            DropItem(i);
            inc(Dropped);
          End;
          inc(Loads);
        End;

        'False' : Begin
          For i := 2 to 28 Do
          Begin
            DropItem(i);
            inc(Dropped);
          End;
          inc(Loads);
        End;
      End;
    End;

    Procedure ProgressReport;
    Begin
      ClearDebug;
      GameTab(2);
      WcLvl := GetSkillLevel('Woodcutting');
      WriteLn('||||||||||||||||||||||||||||||||||||||||');
      WriteLn('|          Auto Willowcutter           |');
      WriteLn('||||||||||||||||||||||||||||||||||||||||');
      WriteLn('Time Running: ' + TimeRunning);
      WriteLn('Loads Done: ' + IntToStr(LoadsToDo));
      WriteLn('Logs Dropped: ' + IntToStr(Dropped));
      WriteLn('EXP Earned: ' + IntToStr(Dropped * 9));
      WriteLn('WC Level: ' + IntToStr(WcLvl));
      WriteLn('||||||||||||||||||||||||||||||||||||||||');
      WriteLn('|         Created By: Devoker          |');
      WriteLn('||||||||||||||||||||||||||||||||||||||||');
    End;

    Begin
      SetUpSRL;
      ActivateClient;
      SetAngle(True);
      repeat
        Cutter;
        Dropper;
        AntiRandoms;
        AntiBan;
      until (Loads >= LoadsToDo)
      ProgressReport;
    End.

    I am trying to make it so that when it is a full inventory (InvFull) then it will stop cutting and start dropping.

  19. #19
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also, delete the things like NAIRI.dll and NAIRI.dpp or something like that. This is only if you're at rev #33 or using newest dev rev ;] If not, then I don't know.

    And Dark, a few people said that already

    SCAR Code:
    begin
      SetUpSRL;
      ActivateClient;
      SetAngle(True);
      repeat
        repeat
          Cutter;
        until(InvFull);
        if(InvFull)then
        begin
          Dropper;
          AntiRandoms;
          AntiBan;
        end;
      until (Loads >= LoadsToDo)
      ProgressReport;
    end.

  20. #20
    Join Date
    Feb 2009
    Location
    Philipines
    Posts
    600
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Make this your cutting procedure:
    SCAR Code:
    Procedure Cutter;
    Var
      WillowColors : Array [0..4] of Integer;
    Begin
      WillowColors[0] := 3163964
      WillowColors[1] := 4025190
      WillowColors[2] := 4021327
      WillowColors[3] := 4286041
      WillowColors[4] := 3299411
      Begin
        repeat
        For i := 0 To 4 Do
        If FindObj(x, y, 'illo', WillowColors[i], 30) Then
        Begin
          Mouse(x, y, 2, 3, True);
          Wait(5000 + Random(2500));
        End;
      until(InvFull);//stops if inventory full
      End;
    End;

    Edit:
    Quote Originally Posted by 99_ View Post
    Also, delete the things like NAIRI.dll and NAIRI.dpp or something like that. This is only if you're at rev #33 or using newest dev rev ;] If not, then I don't know.

    And Dark, a few people said that already

    SCAR Code:
    begin
      SetUpSRL;
      ActivateClient;
      SetAngle(True);
      repeat
        repeat
          Cutter;
        until(InvFull);
        if(InvFull)then
        begin
          Dropper;
          AntiRandoms;
          AntiBan;
        end;
      until (Loads >= LoadsToDo)
      ProgressReport;
    end.
    Wow your quick at posting.
    Last edited by Dark Arcana; 05-31-2009 at 01:00 PM.

  21. #21
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Or, do what I said in my post ;] no need to change your cutting procedure

  22. #22
    Join Date
    May 2009
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks everyone. I finished my script.

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
  •