Results 1 to 18 of 18

Thread: Line 1 Error :(

  1. #1
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    456
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Line 1 Error :(

    So frustrating, can anyone find the error in my script?

    I get :
    Failed when compiling
    Line 1: [Error] (1:1): Variable Expected in script C:\Documents and Settings\VAIO\Desktop\scarprerelease\Scripts\Yew Chopper 2.scar

    Code:
    program YewChopper;
      {.Include srl/srl.scar}
      {.Include srl/srl/Misc/SmartColors.scar}
    
    { To do list
      Break out of loops
      Animation IsTreeDown
      BankYews;
      Progress Report
      Multiplayer
      Failsafes
      Antiban
      Antirandoms
    
    }
    
    const
    
      // Indexes
      OBJ_YEW = 0;
      OBJ_BANK = 1;
      
      NORTH_TREE = 0;
      SOUTH_TREE = 1;
    
    var
      x, y : Integer;
      TreeSymbol, MyRoadColor : Integer;
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Pin := '';
       // Integers[0] := 1000;
       // Strings[1] := 'iron';
       // Booleans[1] := True;
      end;
    end;
    
    procedure MakeObjects;
    begin
      MakeObjEx(OBJ_YEW, 1461824, 3, 0.06, 0.72, ['hop', 'own', 'ew' ], ['hop']);
      SetupSmartColorsDetailsEx(OBJ_YEW, 5, 20, 7, 35, 5, 5, 3, 20);
      
      MakeObjEx(OBJ_BANK, 7370363, 4, 0.19, 0.23, ['ank', 'ooth' ], ['quickly', 'qui', 'kly']);
      SetupSmartColorsDetailsEx(OBJ_BANK, 5, 20, 7, 25, 5, 15, 2, 20);
    end;
    
    function ACTreeSymbol: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.26, 0.46);
    
      FindColorsSpiralTolerance(MMCX, MMCY, arP, 556549, MMX1, MMY1, MMX2, MMY2, 4);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. T');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;
    
      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);
    
      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);
    
        if (X >= 5.68) and (X <= 9.73) and (Y >= 11.19) and (Y <= 19.16) and (Z >= 2.22) and (Z <= 3.40) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;
    
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    
    function ACRoadColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(22.46, 0.46);
    
      FindColorsSpiralTolerance(MMCX, MMCY, arP, 8555396, MMX1, MMY1, MMX2, MMY2, 1);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. R');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;
    
      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);
    
      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);
    
        if (X >= 22.35) and (X <= 23.60) and (Y >= 24.06) and (Y <= 24.56) and (Z >= 24.94) and (Z <= 27.15) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;
    
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    
      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    
    function CurrentTree : Integer;
    begin
      Result := SOUTH_TREE;
      if FindColorSpiral(x, y, MyRoadColor, MMX1, 45, MMX2, MMY2) then
        Result := NORTH_TREE;
    end;
    
    function TransferTree : Boolean;
    var
      ym : Integer;
    begin
      case CurrentTree of
        NORTH_TREE : begin
                       x := MMCX;
                       y := 150;
                       ym := - 12;
                     end;
        SOUTH_TREE : begin
                       x := MMCX;
                       y := 15;
                       ym := 15;
                     end;
      end;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if Result then
        Mouse(x + 5, y + ym , 2, 2, True)
      else
        WriteLn('No tree symbol found!');
    end;
    
    function BankToTrees : Boolean;
    begin
      x := MMCX;
      y := MMCY;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if (Result) then
      begin
        Mouse(x + 5, y + 17, 2, 2, True);
      end;
    end;
    
    function Chop : Boolean;
    var
      TempCTS, TPALength : Integer;
      TPA : TPointArray;
    begin
      Result := False;
      repeat
        repeat
            Wait(1000 + Random(200));
        until SmartColorsEx(OBJ_YEW);
        TempCTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.06, 0.72);
        repeat
          Wait(1000 + Random(200));
          FindColorsTolerance(TPA, 1461824, MSX1, MSY1, MSX2, MSY2, 3);
          TPALength := Length(TPA);
        until (TPALength < 10);
        ColorToleranceSpeed(TempCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        TransferTree;
      until InvFull;
      Result := True;
    end;
    
    function TreesToBank : Boolean;
    var
      BankDTM : Integer;
    begin
      Result := False;
      BankDTM := DTMFromString('78DA63AC646260486000034608C5F0E70F130' +
        '32B94FF1F0818416A2270AB018B83D4041250530B54E38B5F0D00' +
        '08EF0F4B');
      case CurrentTree of
        NORTH_TREE : Mouse(631, 46, 4, 4, True); // Blind Click for now
        SOUTH_TREE : Mouse(663, 28, 4, 4, True);
      end;
      repeat
        Wait(2000 + Random(1000));
      until DTMRotated(BankDTM, x -10, y, MMX1, MMY1, MMX2, MMY2);
      Mouse(x, y, 2, 2, True);
      Flag;
      FreeDTM(BankDTM);
    end;
    
    function Bank : Boolean;
    begin
      Result := False;
      SmartColorsEx(OBJ_BANK);
    end;
    
    begin
      ClearDebug;
      SetupSRL;
      //DeclarePlayers;
      //LoginPlayer;
      ActivateClient;
      Wait(2000);
      TreeSymbol := ACTreeSymbol;
      MyRoadColor := ACRoadColor;
      MakeObjects;
      {repeat
        BankToTrees;
        Chop;
        TreesToBank;
        Bank;
      until False;}
      Bank;
    end.

  2. #2
    Join Date
    Oct 2007
    Posts
    678
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah its ur includes.

    {.Include srl/srl.scar}
    {.Include srl/srl/Misc/SmartColors.scar}

    to this:

    //{.Include srl/srl.scar}
    //{.Include srl/srl/Misc/SmartColors.scar}

    and the error switches. obviously its srl.

    as to what can you do about it, well you probably need to complete a basic version of the script because its not compiling right.

    your current one has unidentified variables.

    and thats teh error ul see after u do that ^^^

  3. #3
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by chitin View Post
    yeah its ur includes.

    {.Include srl/srl.scar}
    {.Include srl/srl/Misc/SmartColors.scar}

    to this:

    //{.Include srl/srl.scar}
    //{.Include srl/srl/Misc/SmartColors.scar}

    and the error switches. obviously its srl.

    as to what can you do about it, well you probably need to complete a basic version of the script because its not compiling right.

    your current one has unidentified variables.

    and thats teh error ul see after u do that ^^^
    Uhm.. If you comment out the includes then the includes wont be used, you do know that?

    And I get the error too, and I just updated my SRL.

  4. #4
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Well the error comes from:
    function TreesToBank : Boolean;
    There used to be something meaningful here.

  5. #5
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    456
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You're suggesting just to not use SRL?

    edit:

    Zytex, that's what I was thinking lol.

    Cheers Frement I'll take a look.

  6. #6
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Jack Shannon View Post
    You're suggesting just to not use SRL?

    edit:

    Zytex, that's what I was thinking lol.

    Cheers Frement I'll take a look.
    Line 224: until DTMRotated(BankDTM, x -10, y, MMX1, MMY1, MMX2, MMY2);
    Line 224(Fixed): until DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2);

    You cant have -10 in there, that function asks for variables that will be filled with values by the function.
    After that you can make:
    SCAR Code:
    RealX := x - 10;
    And you have to define RealX as integer ofcourse.
    Last edited by Frement; 01-22-2010 at 05:10 PM.
    There used to be something meaningful here.

  7. #7
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    456
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks mate, I just fixed the problem though.

    LINE 224

    Code:
      until DTMRotated(BankDTM, x -10, y, MMX1, MMY1, MMX2, MMY2);
    should be

    Code:
      until DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2);

    I did use a Boolean but imo this looks neater.

    Thanks again for pointing the function out.

    Edit: Looks like you found it before me :P

  8. #8
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Yeah, took a while, didnt expect it to be found there
    There used to be something meaningful here.

  9. #9
    Join Date
    Oct 2007
    Posts
    678
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    Uhm.. If you comment out the includes then the includes wont be used, you do know that?

    And I get the error too, and I just updated my SRL.
    yeah im just using elimination to find the prob lol. althought it would be nice to see standalone sciprts again. i rember stupid3000.....oh the good old days.

  10. #10
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    program YewChopper;
      {.Include srl/srl.scar}
      {.Include srl/srl/Misc/SmartColors.scar}

    { To do list
      Break out of loops
      Animation IsTreeDown
      BankYews;
      Progress Report
      Multiplayer
      Failsafes
      Antiban
      Antirandoms

    }


    const

      // Indexes
      OBJ_YEW = 0;
      OBJ_BANK = 1;

      NORTH_TREE = 0;
      SOUTH_TREE = 1;

    var
      x, y : Integer;
      TreeSymbol, MyRoadColor : Integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Pin := '';
       // Integers[0] := 1000;
       // Strings[1] := 'iron';
       // Booleans[1] := True;
      end;
    end;

    procedure MakeObjects;
    begin
      MakeObjEx(OBJ_YEW, 1461824, 3, 0.06, 0.72, ['hop', 'own', 'ew' ], ['hop']);
      SetupSmartColorsDetailsEx(OBJ_YEW, 5, 20, 7, 35, 5, 5, 3, 20);

      MakeObjEx(OBJ_BANK, 7370363, 4, 0.19, 0.23, ['ank', 'ooth' ], ['quickly', 'qui', 'kly']);
      SetupSmartColorsDetailsEx(OBJ_BANK, 5, 20, 7, 25, 5, 15, 2, 20);
    end;

    function ACTreeSymbol: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.26, 0.46);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 556549, MMX1, MMY1, MMX2, MMY2, 4);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. T');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 5.68) and (X <= 9.73) and (Y >= 11.19) and (Y <= 19.16) and (Z >= 2.22) and (Z <= 3.40) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function ACRoadColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(22.46, 0.46);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 8555396, MMX1, MMY1, MMX2, MMY2, 1);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. R');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 22.35) and (X <= 23.60) and (Y >= 24.06) and (Y <= 24.56) and (Z >= 24.94) and (Z <= 27.15) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function CurrentTree : Integer;
    begin
      Result := SOUTH_TREE;
      if FindColorSpiral(x, y, MyRoadColor, MMX1, 45, MMX2, MMY2) then
        Result := NORTH_TREE;
    end;

    function TransferTree : Boolean;
    var
      ym : Integer;
    begin
      case CurrentTree of
        NORTH_TREE : begin
                       x := MMCX;
                       y := 150;
                       ym := - 12;
                     end;
        SOUTH_TREE : begin
                       x := MMCX;
                       y := 15;
                       ym := 15;
                     end;
      end;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if Result then
        Mouse(x + 5, y + ym , 2, 2, True)
      else
        WriteLn('No tree symbol found!');
    end;

    function BankToTrees : Boolean;
    begin
      x := MMCX;
      y := MMCY;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if (Result) then
      begin
        Mouse(x + 5, y + 17, 2, 2, True);
      end;
    end;

    function Chop : Boolean;
    var
      TempCTS, TPALength : Integer;
      TPA : TPointArray;
    begin
      Result := False;
      repeat
        repeat
            Wait(1000 + Random(200));
        until SmartColorsEx(OBJ_YEW);
        TempCTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.06, 0.72);
        repeat
          Wait(1000 + Random(200));
          FindColorsTolerance(TPA, 1461824, MSX1, MSY1, MSX2, MSY2, 3);
          TPALength := Length(TPA);
        until (TPALength < 10);
        ColorToleranceSpeed(TempCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        TransferTree;
      until InvFull;
      Result := True;
    end;

    function TreesToBank : Boolean;
    var
      BankDTM : Integer;
    begin
      Result := False;
      BankDTM := DTMFromString('78DA63AC646260486000034608C5F0E70F130' +
        '32B94FF1F0818416A2270AB018B83D4041250530B54E38B5F0D00' +
        '08EF0F4B');
      case CurrentTree of
        NORTH_TREE : Mouse(631, 46, 4, 4, True); // Blind Click for now
        SOUTH_TREE : Mouse(663, 28, 4, 4, True);
      end;
      repeat
        Wait(2000 + Random(1000));
      until DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2);
      x := x - 10;
      Mouse(x, y, 2, 2, True);
      Flag;
      FreeDTM(BankDTM);
    end;

    function Bank : Boolean;
    begin
      Result := False;
      SmartColorsEx(OBJ_BANK);
    end;

    begin
      ClearDebug;
      SetupSRL;
      //DeclarePlayers;
      //LoginPlayer;
      ActivateClient;
      Wait(2000);
      TreeSymbol := ACTreeSymbol;
      MyRoadColor := ACRoadColor;
      MakeObjects;
      {repeat
        BankToTrees;
        Chop;
        TreesToBank;
        Bank;
      until False;}

      Bank;
    end.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    SCAR Code:
    program YewChopper;
      {.Include srl/srl.scar}
      {.Include srl/srl/Misc/SmartColors.scar}

    { To do list
      Break out of loops
      Animation IsTreeDown
      BankYews;
      Progress Report
      Multiplayer
      Failsafes
      Antiban
      Antirandoms

    }


    const

      // Indexes
      OBJ_YEW = 0;
      OBJ_BANK = 1;

      NORTH_TREE = 0;
      SOUTH_TREE = 1;

    var
      x, y : Integer;
      TreeSymbol, MyRoadColor : Integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;
        Pin := '';
       // Integers[0] := 1000;
       // Strings[1] := 'iron';
       // Booleans[1] := True;
      end;
    end;

    procedure MakeObjects;
    begin
      MakeObjEx(OBJ_YEW, 1461824, 3, 0.06, 0.72, ['hop', 'own', 'ew' ], ['hop']);
      SetupSmartColorsDetailsEx(OBJ_YEW, 5, 20, 7, 35, 5, 5, 3, 20);

      MakeObjEx(OBJ_BANK, 7370363, 4, 0.19, 0.23, ['ank', 'ooth' ], ['quickly', 'qui', 'kly']);
      SetupSmartColorsDetailsEx(OBJ_BANK, 5, 20, 7, 25, 5, 15, 2, 20);
    end;

    function ACTreeSymbol: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.26, 0.46);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 556549, MMX1, MMY1, MMX2, MMY2, 4);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. T');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 5.68) and (X <= 9.73) and (Y >= 11.19) and (Y <= 19.16) and (Z >= 2.22) and (Z <= 3.40) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function ACRoadColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(22.46, 0.46);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 8555396, MMX1, MMY1, MMX2, MMY2, 1);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result. R');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToXYZ(arC[i], X, Y, Z);

        if (X >= 22.35) and (X <= 23.60) and (Y >= 24.06) and (Y <= 24.56) and (Z >= 24.94) and (Z <= 27.15) then
        begin
          Result := arC[i];
          Writeln('AutoColor = ' + IntToStr(arC[i]));
          Break;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    function CurrentTree : Integer;
    begin
      Result := SOUTH_TREE;
      if FindColorSpiral(x, y, MyRoadColor, MMX1, 45, MMX2, MMY2) then
        Result := NORTH_TREE;
    end;

    function TransferTree : Boolean;
    var
      ym : Integer;
    begin
      case CurrentTree of
        NORTH_TREE : begin
                       x := MMCX;
                       y := 150;
                       ym := - 12;
                     end;
        SOUTH_TREE : begin
                       x := MMCX;
                       y := 15;
                       ym := 15;
                     end;
      end;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if Result then
        Mouse(x + 5, y + ym , 2, 2, True)
      else
        WriteLn('No tree symbol found!');
    end;

    function BankToTrees : Boolean;
    begin
      x := MMCX;
      y := MMCY;
      Result := FindColorSpiral(x, y, TreeSymbol, MMX1, MMY1, MMX2, MMY2);
      if (Result) then
      begin
        Mouse(x + 5, y + 17, 2, 2, True);
      end;
    end;

    function Chop : Boolean;
    var
      TempCTS, TPALength : Integer;
      TPA : TPointArray;
    begin
      Result := False;
      repeat
        repeat
            Wait(1000 + Random(200));
        until SmartColorsEx(OBJ_YEW);
        TempCTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.06, 0.72);
        repeat
          Wait(1000 + Random(200));
          FindColorsTolerance(TPA, 1461824, MSX1, MSY1, MSX2, MSY2, 3);
          TPALength := Length(TPA);
        until (TPALength < 10);
        ColorToleranceSpeed(TempCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        TransferTree;
      until InvFull;
      Result := True;
    end;

    function TreesToBank : Boolean;
    var
      BankDTM : Integer;
    begin
      Result := False;
      BankDTM := DTMFromString('78DA63AC646260486000034608C5F0E70F130' +
        '32B94FF1F0818416A2270AB018B83D4041250530B54E38B5F0D00' +
        '08EF0F4B');
      case CurrentTree of
        NORTH_TREE : Mouse(631, 46, 4, 4, True); // Blind Click for now
        SOUTH_TREE : Mouse(663, 28, 4, 4, True);
      end;
      repeat
        Wait(2000 + Random(1000));
      until DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2);
      x := x - 10;
      Mouse(x, y, 2, 2, True);
      Flag;
      FreeDTM(BankDTM);
    end;

    function Bank : Boolean;
    begin
      Result := False;
      SmartColorsEx(OBJ_BANK);
    end;

    begin
      ClearDebug;
      SetupSRL;
      //DeclarePlayers;
      //LoginPlayer;
      ActivateClient;
      Wait(2000);
      TreeSymbol := ACTreeSymbol;
      MyRoadColor := ACRoadColor;
      MakeObjects;
      {repeat
        BankToTrees;
        Chop;
        TreesToBank;
        Bank;
      until False;}

      Bank;
    end.
    Maybe mention what you edited?
    There used to be something meaningful here.

  12. #12
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry . The function DTMRotated has x and y parameters but you are supposed to pass a variable.
    x - 10 is not a variable. x is .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  13. #13
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    And that has been stated in this thread already
    There used to be something meaningful here.

  14. #14
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Shit sorry.
    I didn't look at the whole thread, just the first post.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  15. #15
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Shit sorry.
    I didn't look at the whole thread, just the first post.
    Yeah, i allways (when i remember) add "SOLVED" in bold red to my first post if have a thread that has been solved.
    There used to be something meaningful here.

  16. #16
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If you want randoms in it, i think it would be something like: "until DTMRotated(BankDTM, x+Random(positive or negative can go here), y+Random(same here), MMX1, MMY1, MMX2, MMY2);"

    I don't really post much, just thought the above would help if you didn't already know. =]

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

    Default

    remove

    Program YewChopper;

    ~RM

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

  18. #18
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Even if he removed that it would make no difference. The problem was solved already.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

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
  •