Results 1 to 6 of 6

Thread: Wtf I'm getting pissed please help, Setting up Smart..

  1. #1
    Join Date
    Aug 2008
    Location
    Chineese-Mexican
    Posts
    109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Wtf I'm getting pissed please help, Setting up Smart..

    hey when i set up smart and then run a script it opens smart.scar in a new tab and says
    Failed when compiling
    Line 2: [Error] (160:10): Duplicate identifier 'ISKEYDOWN'
    here is what i have in my smart.scar script
    SCAR Code:
    {$DEFINE SMART}
    function IsKeyDown(C:Char): Boolean;

    begin
      Result := SmartIsKeyDown(ord(c));
    end;

    procedure MoveMouse(x, y: Integer);
    begin
      SmartMoveMouse(x, y);
    end;

    procedure HoldMouse(x, y: Integer; left: Boolean);
    begin
      SmartHoldMouse(x, y, left);
    end;

    procedure ReleaseMouse(x, y: Integer; left: Boolean);
    begin
      SmartReleaseMouse(x, y, left);
    end;

    procedure KeyUp(key: Byte);
    begin
      If Key = 13 Then
        Key := 10;
      SmartReleaseKey(key);
    end;

    procedure KeyDown(key: Byte);
    begin
      If Key = 13 Then
        Key := 10;
      SmartHoldKey(key);
    end;

    procedure SendKeys(S: String);
    begin
      SmartSendKeys(S);
    end;

    procedure GetMousePos(var x, y: Integer);
    begin
      SmartGetMousePos(x, y);
    end;

    function GetColor(x, y: Integer): Integer;
    begin
      result:= SmartGetColor(x, y);
    end;

    procedure SmartSetTarget;
    var
      Smart_Bitmap: Integer;
    begin
      Smart_Bitmap:= BitmapFromString(765,503,'');
      GetBitmapCanvas(Smart_Bitmap).Handle:= SmartGetDC;
      SetTargetBitmap(Smart_Bitmap);
      FreeBitmap(Smart_Bitmap);
    end;

    function FindWindow(Title: String): Boolean;
    begin
      result:= true;
    end;

    procedure ActivateClient;
    begin
    end;

    function FindWindowBySize(Width, Height: Integer): Boolean;
    begin
      result:= true;
    end;

    procedure SmartSetupEx(worldnumber: integer; safe, signed, superdetail: boolean);
    var
      prefix: string;
    begin
      prefix := ReadINI('World' + IntToStr(worldnumber), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
      if(prefix = '')then
      begin
        writeln('Invalid world number or corrupted world list. Please review your settings');
        TerminateScript;
      end;
      SmartSetup(prefix, safe, signed, superDetail);
    end;

    Procedure SaveScreenshot(s : string);
    var
      TempBMP : integer;
      TempS : String;
    begin;
      Temps := s;
      While FileExists(Temps) do
      begin;
        Temps := ExtractFilePath(s) + Copy(ExtractFileName(Temps),1,LastPos('.',ExtractFileName(Temps))-1) + '2' + ExtractFileExt(s);
        Writeln(Temps);
      end;
      TempBMP := BitmapFromString(765,503,'');
      Try
        CopyClientToBitmap(TempBMP,0,0,765,503);
        SaveBitmap(TempBMP, Temps);
      Except
      end;
      FreeBitmap(TempBMP);
    end;
    Can someone please help me fix this???

  2. #2
    Join Date
    Mar 2007
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to update your SRL and then your reflection.

    Wizzup > Me > Noone.

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    You need to include Smart.scar before you include anything else.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  4. #4
    Join Date
    Aug 2008
    Location
    Chineese-Mexican
    Posts
    109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    You need to include Smart.scar before you include anything else.
    is this what you mean
    SCAR Code:
    {.include SRL\SRL\Misc\Smart.scar}
    {.include SRL\SRL.scar}
    {.include SRL\SRL\Reflection\Reflection.scar}
    {.include SRL\SRL\Misc\Users.scar}
    cause if so, i already did.

    @orange - i just did update my srl to 25 and my reflection also, and then i started having problems.

  5. #5
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's the script ^^
    ~Hermen

  6. #6
    Join Date
    May 2008
    Location
    Here :p
    Posts
    194
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nothing wrong with the scirpt try running:
    SCAR Code:
    program New;
    {.include SRL/SRL/Misc/smart.scar}
    {.include SRL/SRL.scar}
    begin
    setupsrl;
    end.
    making sure that this is in your setupsrl procedure in the main srl folder:
    SCAR Code:
    procedure SetupSRL;
    begin
    {$IFDEF SMART}
      SmartSetup('world16', false, false, false);
      wait(10000+random(5000));
      SetTargetDC(SmartGetDC);
      repeat
        wait(100);
      until(SmartGetColor(253, 233)<>1118604);
     {$ENDIF}
    //and then goes the rest...

    when you lode it up (the first 1 ) rs in smart sould lode up tell me if u still get the error once all that is correct

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
  •