Results 1 to 10 of 10

Thread: error, Duplicate identifier

  1. #1
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Post error, Duplicate identifier

    Simba Code:
    [Error] (87:3): Duplicate identifier 'DropPattern' at line 86
    Compiling failed.

    Need some knowledge.



    Simba Code:
    program testbandit;
    {$DEFINE SMART}
    {$i srl/srl.simba}


    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    End;




    procedure StatsGuise(wat:String);
    begin
      StatsGuise(wat);
      Disguise(wat);
    end;



    procedure Antiban;
    begin
      case Random(90) of
        20: HoverSkill('Thieving', False);
        30: PickUpMouse;
        40: RandomMovement;
        50: BoredHuman;
        59: ExamineInv;
      end;
      Writeln('Antiban in action!');
    end;



    function Bandit: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.42, 0.14);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

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

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

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

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

    ///////////////Taken from YoHoJo's powerminner////////////

    Procedure DropJunk;
    var
      x, y, Needle, Antipoision, I: Integer;
      SlotBox:TBox;
      DropPattern:TIntegerArray;                 <----Error Line

    begin
       Lockpick:= DTMFromString('mrAAAAHic42BgYOhjZmCYD8QzgHgiELcDcQsQtwJxDxBXMDIwFAJxHhAXAXE9ELcAcQcQ1wKxnbU10BQmPBg/YCSAYQAA5GsJNg==');
       Antipoision:= DTMFromString('mAAEAAHiclc0xDkBQFETRebTWYGmCgiBYhpKSRiKhQmzRTX6j9G9ymmkmklSEToUaLXp0KJEiQYYch0kjJizYzG0nblzYsWLG8DS8BB7+F8M8fXsB8IkOcA==');
       DropPattern:= [9,13,17,21,25,10,14,18,22,26,7,11,15,19,23,27,8,12,16,20,24,28];

       for I:= 0 to 21 do
       Begin
         SlotBox:= InvBox(DropPattern[I]);
         if FindDTM(Lockpick,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Or
             FindDTm(Antipoision,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
          Begin
            MouseItem(DropPattern[I], False);
            WaitOption('Dro', 500);
          end;
       end;

       FreeDTM(Needle);
       FreeDTM(Antipoision);

    end;

    Procedure Pickpocket;
    var
      x, y: integer;
    begin
      repeat
      if(not(LoggedIn))then
        Exit;

        x:=MSCX;
        y:=MSCY;

        If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

        begin
          WriteLn('Found Bandit');

          GetMousePos(x, y);
          Mouse(x, y, 10, 10, False);
          WaitOption('Pick', 500)
          Wait(100)
          if pos( 'stunned', GetblackChatMessage) <> 0 then
            Case Random(2) of
              1:Wait(4000);
              2:Antiban;
            end;
        end;
       until(InvFull);
       begin
         FindNormalRandoms;
         WriteLn('Dropping');
         DropJunk;
         //Droping

       end;


    end;






    begin
      Smart_Server := 0;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        FindNormalRandoms;
        Pickpocket;
      Until(false);

    end.

  2. #2
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Drop Pattern is part of the SRL includes, you don't need to declare it as a variable. If you're trying to drop in a certain pattern use DropArray.

    (*
    DropArray
    ~~~~~~~~~

    .. code-block:: pascal

    procedure DropArray(InvSlots: TIntegerArray);

    Drops item positioned equivalent to numbers in "InvSlots" array.
    Example: "DropArray([2, 4, 9, 12]);" would drop items in InvSlot 2, 4, 9 and 12.

    .. note::

    by Lorax/EvilChicken!, Tickyy for idea.

    Example:

    .. code-block:: pascal

    DropArray([2, 3, 6]);

    *)

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Hmm, DropPattern may already be in SRL now hmm?

    Just rename all DropPatterns in your script to something (anything) else.


    I see you're using a lot of my code neat!

  4. #4
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Hmm, DropPattern may already be in SRL now hmm?

    Just rename all DropPatterns in your script to something (anything) else.


    I see you're using a lot of my code neat!
    Yeah i hope that's ok with you, i plan on going back through my script once i get it running all the way to customize it and learn some more

    Sorry posted something then saw your post.

    When i do that i get this error. could you explain what a type mismatch is?

    Simba Code:
    [Error] (103:44): Type mismatch at line 102
    Compiling failed.

    Simba Code:
    program testbandit;
    {$DEFINE SMART}
    {$i srl/srl.simba}



    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name :='';
      Players[0].Pass :='';
      Players[0].Nick :='';
      Players[0].Active:=True;
    End;




    procedure StatsGuise(wat:String);
    begin
      StatsGuise(wat);
      Disguise(wat);
    end;



    procedure Antiban;
    begin
      case Random(90) of
        20: HoverSkill('Thieving', False);
        30: PickUpMouse;
        40: RandomMovement;
        50: BoredHuman;
        59: ExamineInv;
      end;
      Writeln('Antiban in action!');
    end;



    function Bandit: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.42, 0.14);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1714004, MSX1, MSY1, MSX2, MSY2, 7);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

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

      for i := 0 to arL do
      begin
        Result := arC[i];
        //Writeln('AutoColor = ' + IntToStr(arC[i]));
        Break;
      end;

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

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



    ///////////////Taken from YoHoJo's powerminner////////////

    Procedure DropJunk;
    var
      x, y, Lockpick, Antipoision, I: Integer;
      SlotBox:TBox;
      DropingPattern:TIntegerArray;

    begin
       Lockpick:= DTMFromString('mrAAAAHic42BgYOhjZmCYD8QzgHgiELcDcQsQtwJxDxBXMDIwFAJxHhAXAXE9ELcAcQcQ1wKxnbU10BQmPBg/YCSAYQAA5GsJNg==');
       Antipoision:= DTMFromString('mAAEAAHiclc0xDkBQFETRebTWYGmCgiBYhpKSRiKhQmzRTX6j9G9ymmkmklSEToUaLXp0KJEiQYYch0kjJizYzG0nblzYsWLG8DS8BB7+F8M8fXsB8IkOcA==');
       DropingPattern:= [9,13,17,21,25,10,14,18,22,26,7,11,15,19,23,27,8,12,16,20,24,28];

       for I:= 0 to 21 do
       Begin
         SlotBox:= InvBox(DropingPattern[I]);
         if FindDTM(Lockpick,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Or
             FindDTm(Antipoision,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
          Begin
            MouseItem(DropingPattern[I], False);
            WaitOption('Dro', 500);
          end;
       end;

       FreeDTM(Needle);
       FreeDTM(Antipoision);

    end;



    Procedure Pickpocket;
    var
      x, y: integer;
    begin
      repeat
      if(not(LoggedIn))then
        Exit;

        SetAngle(SRL_ANGLE_HIGH);
        x:=MSCX;
        y:=MSCY;

        If FindObjTPA(x, y, Bandit, 5, 2, 5, 10, 20,['Atta'])then

        begin
          WriteLn('Found Bandit');

          GetMousePos(x, y);
          Mouse(x, y, 10, 10, False);
          WaitOption('Pick', 500)
          Wait(100)
         If FindBlackChatMessage('fail') Then
            Case Random(2) of
              1:Wait(4000);
              2:Antiban;
            end;
        end;
       until(InvFull);
       begin
         FindNormalRandoms;
         WriteLn('Dropping');
         DropJunk;
         //Droping

       end;


    end;






    begin
      Smart_Server := 0;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;

      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        FindNormalRandoms;
        Pickpocket;
      Until(false);

    end.
    Last edited by Littellj; 03-07-2012 at 05:38 AM.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

  6. #6
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    edited my earlier post, you had posted and i didn't see it and it answered my question.

  7. #7
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    You need to use DropArray unless you want to do one of the three patterns for DropPattern

    DropPattern only does these patterns
    dp_UpToDown = 1;
    dp_Snake = 2;
    dp_Random = 3;

    (*
    DropPattern
    ~~~~~~~~~~~

    .. code-block:: pascal

    procedure DropPattern(Which: Integer);

    Drops all items in inventory according to pattern which.

    .. note::

    by Rasta Magician

    Example:

    .. code-block:: pascal

    DropPattern(dp_Snake);

    *)

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Change the False to a 1 or 2 (forget which one is right click)

  9. #9
    Join Date
    Feb 2012
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ashaman88 View Post
    You need to use DropArray unless you want to do one of the three patterns for DropPattern

    DropPattern only does these patterns

    Ok, that makes sense. So for future use where would i put that into my script. Under Var? and then the same thing after my InvBox('here'), and then same thing after my mouseitem('here')?






    Quote Originally Posted by YoHoJo View Post
    Change the False to a 1 or 2 (forget which one is right click)
    Simba Code:
    Compiled successfully in 1592 ms.
    Thanks YoHoJo

  10. #10
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by Littellj View Post
    Simba Code:
    Compiled successfully in 1592 ms.
    Thanks YoHoJo
    Instead of using numbers, use mouse_Left, mouse_Middle or mouse_Right Much easier to remember, understand, and more change-proof
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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
  •