Results 1 to 11 of 11

Thread: duplicate identifier?

  1. #1
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default duplicate identifier?

    well i fixed one problem with ScanExactMiniMap and what not....now i get this
    duplicate identifier

  2. #2
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

  3. #3
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               » ColorFinding Routines                       --//
    //-----------------------------------------------------------------//

    //  » function  FindColorRightTol(var cx,cy: Integer; dacolor,ax1,ay1,ax2,ay2,tol: Integer):                          | by Freddy1990
    //  » function  FindColorEllipse(var x, y: integer; Color, Tol, X1, Y1, X2, Y2: integer): boolean;                    | by BenLand100
    //  » function  FindColorsEllipse(var Points: TPointArray; Color, Tol, X1, Y1, X2, Y2: integer): boolean;             | by BenLand100
    //  » function  FindColorAbstract(var x,y: integer; Color, Tol, x1,y1,x2,y2,x3,y3,x4,y4: integer): boolean;           | by BenLand100
    //  » function  FindColorsAbstract(var Points: TPointArray; Color, Tol, x1,y1,x2,y2,x3,y3,x4,y4: integer): boolean;   | by BenLand100
    //  » procedure ClickRandomlyOnColour(Colour, x, y, xa, ya : Integer; Left : Boolean);                                | by Spky
    //  » function  ScanMMColorExact(var x, y: Integer; color: Integer): Boolean;                                         | by Freddy1990
    //  » function  ScanMMColorTolerance(var x, y: Integer; color, tolerance: Integer): Boolean;                          | by Freddy1990
    //  » procedure ClickExactMMColor(color: Integer);                                                                    | by Freddy1990
    //  » procedure ClickExactMMColorTol(color, tolerance: Integer);                                                      | by Freddy1990
    //  » function  ScanMMAreaColorExact(var x, y: Integer; x1, y1, x2, y2, color: Integer): Boolean;                     | by Freddy1990
    //  » function  ScanMMAreaColorExactTolerance(var x, y: Integer; x1, y1, x2, y2, color, tolerance: Integer): Boolean; | by Freddy1990

    {*******************************************************************************
    function FindColorRightTol(var cx, cy: Integer; Color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
    By: Freddy1990
    Description: Same as FindColorTolerance but searches from right
    *******************************************************************************}


    function FindColorRightTol(var cx, cy: Integer; Color, x1, y1, x2, y2,
      Tolerance: Integer): Boolean;
    var
      BmpCol: T2DIntArray;
      xx, yy: Integer;
    begin
      BmpCol := GetBitmapAreaColors(x1, y1, x2, y2);
      for yy := y1 to y2 do
        for xx := x2 downto x1 do
        begin
          Result := SimilarColors(Color, BmpCol[xx - x1][yy - y1], Tolerance);
          if Result then
          begin
            cx := xx;
            cy := yy;
            Exit;
          end;
        end;
    end;


    {*******************************************************************************
    function FindColorEllipse(var x, y: Integer; Color, Tol, X1, Y1, X2, Y2: Integer): Boolean;
    By: BenLand100
    Description: Searches only in the given ellipse for a color with tol, returns true if found and position in x, y
    Set Ellips Bounds according to the diagram:
             y1
        +----------+
        |          |
        | Ellipse  |
     x1 | Bounds   | x2
        |          |
        +----------+
             y2
    *******************************************************************************}


    function FindColorEllipse(var x, y: Integer; Color, tol, X1, Y1, X2, Y2:
      Integer): Boolean;
    var
      Temp: TCanvas;
      Cx, Cy, H, W, ScreenBmp, TempBmp, Handle: Integer;
    begin
      W := Max(X1, X2) - Min(X1, X2);
      H := Max(Y1, Y2) - Min(Y1, Y2);
      Handle := GetClientWindowHandle;
      TempBmp := BitmapFromString(W, H, '');
      Temp := GetBitmapCanvas(TempBmp);
      ScreenBmp := BitmapFromString(W, H, '');
      FastDrawClear(TempBmp, -1);
      CopyClientToBitmap(ScreenBmp, X1, Y1, X2, Y2);
      CopyCanvas(GetBitmapCanvas(TempBmp), Temp, 0, 0, W, H, 0, 0, W, H);
      Temp.Ellipse(0, 0, W, H);
      CopyCanvas(Temp, GetBitmapCanvas(TempBmp), 0, 0, W, H, 0, 0, W, H);
      SetTransparentColor(TempBmp, 16777215);
      FastDrawTransparent(0, 0, TempBmp, ScreenBmp);
      SetTargetBitmap(ScreenBmp);
      x := -1;
      y := -1;
      Cx := W div 2;
      Cy := H div 2;
      if FindColorSpiralTolerance(Cx, Cy, Color, 0, 0, W, H, tol) then
      begin
        x := Cx;
        y := Cy;
        Result := True;
      end;
      SetClientWindowHandle(Handle);
      FreeBitmap(TempBmp);
      FreeBitmap(ScreenBmp);
    end;

    {*******************************************************************************
    function FindColorsEllipse(var Points: TPointArray; Color, Tol, X1, Y1, X2, Y2: Integer): Boolean;
    By: BenLand100
    Description: Searches only in the given ellipse for every color with tol, returns true if found and the points in Points
    Set Ellips Bounds according to the diagram:
              y1
         +----------+
         |          |
         | Ellipse  |
      x1 | Bounds   | x2
         |          |
         +----------+
              y2
    *******************************************************************************}


    function FindColorsEllipse(var Points: TPointArray; Color, tol, X1, Y1, X2, Y2:
      Integer): Boolean;
    var
      Temp: TCanvas;
      PtTemp: TPointArray;
      H, W, ScreenBmp, TempBmp, Handle: Integer;
    begin
      W := Max(X1, X2) - Min(X1, X2);
      H := Max(Y1, Y2) - Min(Y1, Y2);
      Handle := GetClientWindowHandle;
      TempBmp := BitmapFromString(W, H, '');
      Temp := GetBitmapCanvas(TempBmp);
      ScreenBmp := BitmapFromString(W, H, '');
      FastDrawClear(TempBmp, -1);
      CopyCanvas(GetClientCanvas, GetBitmapCanvas(ScreenBmp), X1, Y1, X2, Y2, 0, 0,
        W, H);
      CopyCanvas(GetBitmapCanvas(TempBmp), Temp, 0, 0, W, H, 0, 0, W, H);
      Temp.Ellipse(0, 0, W, H);
      CopyCanvas(Temp, GetBitmapCanvas(TempBmp), 0, 0, W, H, 0, 0, W, H);
      SetTransparentColor(TempBmp, 16777215);
      FastDrawTransparent(0, 0, TempBmp, ScreenBmp);
      SetTargetBitmap(ScreenBmp);
      FindColorsSpiralTolerance(W / 2, H / 2, PtTemp, Color, 0, 0, W, H, tol);
      if GetArrayLength(PtTemp) > 0 then
      begin
        Points := PtTemp;
        Result := True;
      end;
      SetClientWindowHandle(Handle);
      FreeBitmap(TempBmp);
      FreeBitmap(ScreenBmp);
    end;

    {*******************************************************************************
    function FindColorAbstract(var x, y: Integer; Color, Tol, x1, y1, x2, y2, x3, y3, x4, y4: Integer): Boolean;
    By: BenLand100
    Description: Searches in an abstract box (see Math.scar) for a color and tolerance and the first one found in x, y
    *******************************************************************************}


    function FindColorAbstract(var x, y: Integer; Color, tol, x1, y1, x2, y2, x3,
      y3, x4, y4: Integer): Boolean;
    var
      found: Boolean;
      Pt, CX, CY, UY, dy, rx, LX: Integer;
      Points: TPointArray;
    begin
      UY := Min(y1, y2);
      dy := Max(y3, y4);
      LX := Min(x1, x4);
      rx := Max(x2, x3);
      FindColorsSpiralTolerance(((LX + rx) / 2), ((UY + dy) / 2), Points, Color, LX,
        UY, rx, dy, tol);
      for pt := 0 to GetArrayLength(points) - 1 do
        if InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4, Points[pt].x, Points[pt].y) then
        begin
          found := True;
          CX := Points[pt].x;
          CY := Points[pt].y
            Break;
        end;
      x := -1
        y := -1
        if found then
      begin
        x := CX
          y := CY
          Result := True
      end;
    end;

    {*******************************************************************************
    function FindColorsAbstract(var Points: TPointArray; Color, Tol, x1, y1, x2, y2, x3, y3, x4, y4: Integer): Boolean;
    By: BenLand100
    Description: Searches in an abstract box (see Math.scar) for a color and tolerance and puts every instance of it in Points
    *******************************************************************************}


    function FindColorsAbstract(var Points: TPointArray; Color, tol, x1, y1, x2, y2,
      x3, y3, x4, y4: Integer): Boolean;
    var
      Pt, TempPt, UY, dy, rx, LX: Integer;
      FPoints, Temp: TPointArray;
    begin
      UY := Min(y1, y2);
      dy := Max(y3, y4);
      LX := Min(x1, x4);
      rx := Max(x2, x3);
      FindColorsSpiralTolerance(((LX + rx) / 2), ((UY + dy) / 2), FPoints, Color,
        LX, UY, rx, dy, tol);
      for pt := 0 to GetArrayLength(FPoints) - 1 do
      begin
        WriteLn(IntToStr(FPoints[pt].x) + ', ' + IntToStr(FPoints[pt].y));
        if InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4, FPoints[Pt].x,
          FPoints[Pt].y) then
        begin
          Result := True;
          SetArrayLength(Temp, GetArrayLength(Temp) - 1);
          TempPt := GetArrayLength(Temp) - 1;
          Temp[TempPt].x := FPoints[Pt].x;
          Temp[TempPt].y := FPoints[Pt].y;
        end;
      end;
      Points := Temp;
    end;

    {*******************************************************************************
    procedure ClickRandomlyOnColour(Colour, x, y, xa, ya: Integer; Left: Boolean);
    By: Spky
    Description: Clicks randomly on the specified colour in box "x, y, xa, ya".
    *******************************************************************************}


    procedure ClickRandomlyOnColour(Colour, x, y, xa, ya: Integer; Left: Boolean);
    var
      Ix, Iy, I: Integer;
      Coords: array of TPoint;
    begin
      for Iy := y to ya do
        for Ix := x to xa do
          if (GetColor(Ix, Iy) = Colour) then
          begin
            SetArrayLength(Coords, GetArrayLength(Coords) + 1)
              Coords[GetArrayLength(Coords) - 1].x := Ix;
            Coords[GetArrayLength(Coords) - 1].y := Iy;
          end;
      I := 0 + Random(GetArrayLength(Coords));
      if (I > 0) then
        Mouse(Coords[I].x, Coords[I].y, 0, 0, Left);
    end;

    {*******************************************************************************
    function ScanMMColorExact(var x, y: Integer; color: Integer): Boolean;
    By: Freddy1990
    Description: Finds a color on the minimap. (minimap being 100% correct)
    *******************************************************************************}


    function ScanMMColorExact(var x, y: Integer; color: Integer): Boolean;
    begin
      Result := ScanExactMinimapD(x, y, color, 0);
    end;

    {*******************************************************************************
    function ScanMMColorExactTolerance(var x, y: Integer; color, tolerance: Integer): Boolean;
    By: Freddy1990
    Description: Finds a color with a tolerance on the minimap. (minimap being 100% correct)
    *******************************************************************************}


    function ScanMMColorExactTolerance(var x, y: Integer; color, tolerance:
      Integer): Boolean;
    begin
      Result := ScanExactMinimapD(x, y, color, tolerance);
    end;

    {*******************************************************************************
    procedure ClickExactMMColor(color: Integer);
    By: Freddy1990
    Description: Clicks a color on the EXACT minimap
    *******************************************************************************}


    procedure ClickExactMMColor(color: Integer);
    var
      x, y: Integer;
    begin
      if (ScanMMColorExact(x, y, color)) then
        Mouse(x, y, 0, 0, True);
    end;

    {*******************************************************************************
    procedure ClickExactMMColorTol(color, tolerance: Integer);
    By: Freddy1990
    Description: Clicks a color with a tolerance on the EXACT Minimap.
    *******************************************************************************}


    procedure ClickExactMMColorTol(color, tolerance: Integer);
    var
      x, y: Integer;
    begin
      if (ScanMMColorExactTolerance(x, y, color, tolerance)) then
        Mouse(x, y, 0, 0, True);
    end;

    {*******************************************************************************
    function ScanMMAreaColorExact(var x, y: Integer; x1, y1, x2, y2, color: Integer): Boolean;
    By: Freddy1990
    Description: Finds a color in the specified rectangle on the minimap. (minimap being 100% correct)
    *******************************************************************************}


    function ScanMMAreaColorExact(var x, y: Integer; x1, y1, x2, y2, color:
      Integer): Boolean;
    begin
      Result := ScanExactMMAreaD(x, y, x1, y1, x2, y2, color, 0);
    end;

    {*******************************************************************************
    function ScanMMAreaColorExactTolerance(var x, y: Integer; x1, y1, x2, y2, color, tolerance: Integer): Boolean;
    By: Freddy1990
    Description: Finds a color in the specified rectangle with a tolerance on the minimap. (minimap being 100% correct)
    *******************************************************************************}


    function ScanMMAreaColorExactTolerance(var x, y: Integer; x1, y1, x2, y2, color,
      tolerance: Integer): Boolean;
    begin
      Result := ScanExactMMAreaD(x, y, x1, y1, x2, y2, color, tolerance);
    end
    ;

  4. #4
    Join Date
    Jul 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its not mine but its one of the resource files its the scan exact mini map part...it says uknown identifier

  5. #5
    Join Date
    Aug 2007
    Location
    Finland
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    omg use [scar] tags -.-

    It might get easier to help that way-.-

  6. #6
    Join Date
    Jan 2007
    Location
    Tennessee
    Posts
    642
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I can't run it to see what is wrong because i dont't have the new version of scar yet, but that usually means you have 2 variables that are the same.
    Or a variable that is the name of a procedure or something like that.
    So what does it say the duplicate identifier is?

  7. #7
    Join Date
    Nov 2007
    Location
    USA, Michigan
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default



    I have to quote you because I cannot believe you said that EvilChicken. (and offer my help with the script identifier problem.)

    EvilChicken
    Community Member
    Lesser Demon

    This isn''t your script, so I wont bother helping you in-depth,
    but that error usually means that you have a unnesesary
    thing in "your" script.

    Evil, you should, and I know you do, recognize the script as a "core" script, which were all corrrectly copied WITH credit to each author. So you should bother helping in-depth...ego's abound in SRL. Never forget the noob inside of all of us was helped at one time or another.

    ladiesman48
    Registered User
    Chicken

    You have a duplicate identifier in "your" ScanExactMiniMap subscript that uses the "core" script identifier over again. I'd need to see "your" script in order to find the duplilcate.

  8. #8
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by S.R.L.R.S View Post


    I have to quote you because I cannot believe you said that EvilChicken. (and offer my help with the script identifier problem.)

    EvilChicken
    Community Member
    Lesser Demon

    This isn''t your script, so I wont bother helping you in-depth,
    but that error usually means that you have a unnesesary
    thing in "your" script.

    Evil, you should, and I know you do, recognize the script as a "core" script, which were all corrrectly copied WITH credit to each author. So you should bother helping in-depth...ego's abound in SRL. Never forget the noob inside of all of us was helped at one time or another.

    ladiesman48
    Registered User
    Chicken

    You have a duplicate identifier in "your" ScanExactMiniMap subscript that uses the "core" script identifier over again. I'd need to see "your" script in order to find the duplilcate.
    I am so sorry, at that time I had just gotten a genious idea and just needed a excuse for not answering, I didn't even look at the script, i just happened to notice the words "this isn't mine" and I answered on the base of that. Once again, I am sorry.

  9. #9
    Join Date
    Nov 2007
    Location
    USA, Michigan
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default



    ok, spill the beans....what was the genious idea??????

    I know your GOOD at scripting, so it has to be something worth while...

    any clues???

  10. #10
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    It was genious in my head because it was a much needed feature to add to my script. When v5.2 will be released, just compare them. And how do you know I'm good at scripting?

  11. #11
    Join Date
    Nov 2007
    Location
    USA, Michigan
    Posts
    34
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default



    Jonas...good advice with "any 1 plz help i get this error?", even though IT WAS FROM THE FREE SECTION AND DIDN'T WORK...

    ... how is v5.2 doing?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Duplicate Identifier
    By iunseeni in forum OSR Help
    Replies: 2
    Last Post: 11-06-2007, 04:18 PM
  2. Duplicate Identifier
    By Jackrawl in forum OSR Help
    Replies: 9
    Last Post: 09-06-2007, 02:37 PM
  3. Duplicate Identifier?
    By IEatJ00erBaybees in forum OSR Help
    Replies: 7
    Last Post: 03-05-2007, 01:53 AM

Posting Permissions

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