Results 1 to 11 of 11

Thread: Duplicate identifier 'TDTMPointDef' at line 4

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

    Default Duplicate identifier 'TDTMPointDef' at line 4

    This doesn't happen if im not trying to run a reflection script but whenever i try and run a reflection script I get this error


    [Error] C:\Simba\Includes\SRL/SRL/Core/Simba.simba(5:3): Duplicate identifier 'TDTMPointDef' at line 4


    But line 4 is just


    SCAR Code:
    //-----------------------------------------------------------------//

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

    Default

    3 lines before and after that?

    The real error is at line 5?
    There used to be something meaningful here.

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

    Default

    Quote Originally Posted by Frement View Post
    3 lines before and after that?

    The real error is at line 5?
    The output says line 4 but im not sure where the real error is

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

    Default

    Quote Originally Posted by J_Pizzle View Post
    The output says line 4 but im not sure where the real error is
    Well, can you show more lines please?
    There used to be something meaningful here.

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

    Default

    heres my whole simba.simba


    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--                        Simba.simba                          --//
    //-----------------------------------------------------------------//

    {$ifdef Simba}
    {$loadlib irokiplugin}

    //{$define SimbaDebug}
    type
      TDTMPointDef = TSDTMPointDef;
      TDTMPointDefArray = TSDTMPointDefArray;
      TDTM = TSDTM;
    function  AddDTM(DTM : TDTM) : integer;
    begin
      result := AddSDTM(dtm);
    end;

    function InitializeHTTPClient(HandleCookies,handleredirects: Boolean): Integer;
    begin
      {$ifdef SimbaDebug}
      if HandleRedirects then
        Writeln('Simba does not support automatic redirects yet');
      {$endif}
      result := InitializeHTTPClientWrap(HandleCookies);
    end;

    function IntToPoint(x,y : integer) : TPoint;
    begin
      result := Point(x,y);
    end;

    procedure GetColorspeed2Modifiers(var hue,sat : extended);
    begin;
      GetToleranceSpeed2Modifiers(hue,sat);
    end;

    procedure Disguise(s : string);
    begin
      Writeln(format('Disguising as: %s',[s]));
    end;

    function StartsWith(prefix, s: string): Boolean;
    var
      i,l : integer;
    begin
      result := false;
      l := length(prefix);
      if l > length(s) then
        exit;
      for i := 1 to l do
        if s[i] <> prefix[i] then
          exit;
      result := true;
    end;

    procedure AddToReport(str : string);
    begin
      writeln('Status: ' + str);
    end;
    procedure ClearReport;
    begin
      DebugLn('Should clear report now..');
    end;

    procedure status(str : string);
    begin
      writeln(str);
    end;

    var
      Bladieblatempthingy : TForm;
    procedure CreateFormBladieblatempthingy;
    begin
      Bladieblatempthingy := TForm.Create(nil);
    end;
    procedure FreeFormBladieblatempthingy;
    begin
      if assigned(Bladieblatempthingy) then
        Bladieblatempthingy.free;
    end;
    procedure FreeForm(var form : TForm);
    var
      v : TVariantArray;
    begin;
      Bladieblatempthingy := Form;
      ThreadSafeCall('FreeFormBladieblatempthingy',v);
      form := nil;
    end;

    function CreateForm : TForm;
    var
      v : TVariantArray;
    begin;
      ThreadSafeCall('CreateFormBladieblatempthingy',v);
      result := Bladieblatempthingy;
    end;

    function IsFKeyDown(FKey : integer) : boolean;
    begin
      if not InRange(FKey,1,12) then
        raiseexception(erCustomError,'FKey not in range 1..12');
      result := IsKeyDown(VK_F1 + FKey - 1);
    end;

    function GetColors(Coords : TPointArray) : TIntegerArray;
    begin
      GetColorsWrap(Coords,Result);
    end;

    procedure ColorToRGB(Color : TColor; var R,G,B : integer);
    begin
      R := Color and $ff;
      G := Color shr 8 and $ff;
      B := Color shr 16 and $ff;
    end;

    function Degrees(Radians: Extended): Extended;
    begin
      result := Radians * 180 / pi;
    end;

    function Radians(Degrees: Extended): Extended;
    begin
      result := Pi * degrees / 180;
    end;

    function InCircle(x, y, mx, my, r: Integer): Boolean;
    begin
      result := (Sqrt(sqr(x-mx) + sqr(y-my)) <= r);
    end;

    function CreateBitmapMaskFromText(txt,chars : string) : integer;
    begin
      result := BitmapFromText(txt,chars);
    end;

    function GetNumbers(text : string) : string;
    begin;
      result := ExtractFromStr(text,numbers);
    end;

    function GetLetters(Text: string): string;
    begin
      result := ExtractFromStr(Text,letters);
    end;

    function GetOthers(Text: string): string;
    begin;
      result := ExtractFromStr(text,others);
    end;

    function FindDTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; sAngle, eAngle, aStep: Extended; out aFound: Extended): Boolean;
    begin;
      result := FindDTMRotatedAlternating(DTM,x,y,x1,y1,x2,y2,sangle,eangle,astep,afound);
    end;

    const
      tr_AllChars = 0;
      tr_BigLetters = 1;
      tr_SmallLetters = 2;
      tr_Digits = 3;
      tr_BigSymbols = 4;
      tr_SmallSymbols = 5;
      tr_SecondTableChars = 6;
      tr_Letters = 7;
      tr_AlphaNumericChars = 8;
      tr_Symbols = 9;
      tr_NormalChars = 10;

    type
      TCharRange = longword; //I donno

    function GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: String; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange): anystring;
    begin
      // no hspacing, defaulting to 4. (with 4 ' and : will work)
      // Defaulting MaxSpacing to 3
      if TextColor = -1 then
        raiseexception(ercustomerror,'GetTextAtEx with color = -1, is not supported');
      Maxspacing := 3;
      {$ifdef SimbaDebug}
      Writeln([x, y, minSpacing, maxSpacing, 4, textcolor, tolerance, textlength, Chars]);
      {$endif}
      Result := GetTextAt(x, y, minSpacing, maxSpacing, 4, textcolor, tolerance, textlength, Chars);
      {$ifdef SimbaDebug}
      Writeln('GetTextAt result: ' + Result);
      {$endif}
      if Range = tr_Digits then
        result := GetNumbers(result);
    end;

    function IsTextInAreaEx(xs, ys, xe, ye: Integer; var x, y: Integer; S: string; Tolerance: Integer; Chars: String; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer): Boolean;
    var
      TextTPA,SearchTPA, Matches: TPointArray;
      Box : TBox;
      xx,yy,i,len : integer;
    begin
      if TextColor = -1 then
        raiseexception(ercustomerror,'IsTextInArea with color = -1, is not supported');
      Result := False;
      FindColorsTolerance(SearchTPA,TextColor,xs,ys,xe,ye,tolerance);
      if Length(SearchTPA) < 1 then
        Exit;
      TextTPA:= TPAFromText(S,Chars,xx,yy);
      Result := FindTextTPAinTPA(yy ,TextTPA,SearchTPA,Matches);
      x := 0; y:=0;
      if Result = False then
        Exit;
      Box := GetTPABounds(TextTPA);
      SortTPAFrom(Matches, Point(Box.x1, Box.y1));
      x := matches[0].x;
      yy := 500000;
      len := High(TextTPA);
      for i := 0 to Len do
        if TextTPA[i].x = Box.x1 then
          yy := min(yy,TextTPA[i].y);
      y := matches[0].y-yy;
      {$ifdef SimbaDebug}
      Writeln(Format('IsTextInAreaEx: (%d,%d)',[x,y]));
      {$endif}
    end;

    function GetColorToleranceSpeed : integer;
    begin;
      result := GetToleranceSpeed;
    end;

    procedure ColorToleranceSpeed(cts : integer);
    begin;
      SetColorToleranceSpeed(cts);
    end;

    type
      TColorComp = (ccRed, ccGreen, ccBlue, ccHue, ccSat, ccLum);

    function FindColorComp(var x, y: Integer; Comp: Variant; CompType: TColorComp; xs, ys, xe, ye: Integer; Tolerance: Extended): Boolean;
    begin
      Writeln('FindColorComp is not yet implemented! Use another color finder ;-)');
      Result := false;
    end;

    procedure SetColorspeed2Modifiers(huemodifier, saturationmodifier: Extended);
    begin
      SetToleranceSpeed2Modifiers(Huemodifier, saturationmodifier);
    end;

    function InStrArr(Str: string; Arr: TStringArray; CaseSensitive: Boolean): Boolean;
    var
      i : integer;
    begin;
      result := true;
      if not casesensitive then
      begin
        str := lowercase(str);
        for i := high(arr) downto 0 do
          if lowercase(arr[i]) = str then
            exit;
      end else
        for i := high(arr) downto 0 do
          if arr[i] = str then
            exit;
      result := false;
    end;

    function Replace(Text, FindStr, ReplaceStr: string): string;
    begin;
      result := ReplaceWrap(Text,FindStr,ReplaceStr,[rfReplaceAll]);
    end;

    //Sends arrow to Client's window. For a, 0 = up, 1 = right, 2 = down, 3 = left.
    procedure SendArrow(Key: Byte);
    begin
      if not InRange(Key,0,3) then
        Writeln('KEY IS NOT INRANGE!!')
      else
        case key of
          0 : PressKey(vk_up);
          1 : PressKey(vk_right);
          2 : PressKey(vk_down);
          3 : PressKey(vk_left);
        end;
    end;

    procedure SendArrowWait(Key: Byte; WaitTime: Integer);
    var
      KeyCode : integer;
    begin;
      if not InRange(Key,0,3) then
        Writeln('KEY IS NOT INRANGE!!')
      else
      begin
        case key of
          0 : Keycode := (vk_up);
          1 : Keycode := (vk_right);
          2 : Keycode := (vk_down);
          3 : Keycode := (vk_left);
        end;
        KeyDown(keycode);
        wait(waittime);
        KeyUp(keycode);
      end;
    end;

    procedure SendArrowSilentWait(Key : byte; WaitTime : integer);
    begin
      SendArrowWait(key,waittime);
    end;

    procedure SendArrowSilent(Key : byte);
    begin
      SendArrow(key);
    end;

    function AMax(Data: TIntegerArray): Integer;
    var
      i : integer;
    begin;
      if length(data) = 0 then
      begin
        Writeln('cannot define result of AMax, input length = 0');
        raiseexception(erCustomError,'AMax input with length of zero');
      end;
      result := data[0];
      for i := high(data) downto 1 do
        result := max(result,data[i]);
    end;

    function AddOnTerminate(const proc : string) : boolean;
    var
      OldProcs : TVariantArray;
      i : integer;
    begin
      result := false;
      GetScriptProp(SP_OnTerminate,OldProcs);
      for i := 0 to high(OldProcs) do
        if lowercase(OldProcs[i]) = lowercase(proc) then
          exit;
      setlength(OldProcs,Length(OldProcs)+1);
      OldProcs[high(OldProcs)] := proc;
      SetScriptProp(SP_OnTerminate,oldprocs);
      result := True;
    end;

    function DeleteOnTerminate(const proc : string) : boolean;
    var
      OldProcs : TVariantArray;
      NewProcs : TVariantArray;
      i : integer;
    begin
      result := False;
      GetScriptProp(SP_OnTerminate,OldProcs);
      for i := 0 to high(OldProcs) do
        if lowercase(OldProcs[i]) = lowercase(proc) then
          result := true
        else
        begin
          setlength(NewProcs,Length(NewProcs)+1);
          NewProcs[high(NewProcs)] := lowercase(OldProcs[i]);
        end;
      SetScriptProp(SP_OnTerminate,NewProcs);
    end;

    function Readln(Question : string ) : string;
    begin
      InputQuery('Question box',Question,result);
    end;
    const
      NPCChars = CharsNPC;
    {$endif}

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

    Default

    Well, my guess is that somewhere in Reflection 'TDTMPointDef' is declared, so that should be removed.
    There used to be something meaningful here.

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

    Default

    Naww I jsut searched for it and came up empty handed

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

    Default

    Well, try removing it from Simba.simba, wierd thought because it works for me :/
    There used to be something meaningful here.

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

    Default

    Can you upload a zip of your includes with reflection included cause I just tried to reinstall and still no luck

  10. #10
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Somewhere your getting the include called twice. There was a setup like this in the previous reflection svn but it shouldn't be so in current.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  11. #11
    Join Date
    Jul 2008
    Posts
    907
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh so it wasn't just me!
    Renaming the one in Simba.Simba wouldn't do any damage would it?
    EDIT: Apparently it doesn't do anything.
    Last edited by Magiic; 07-09-2010 at 04:02 PM.


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
  •