Results 1 to 10 of 10

Thread: why am i getting this error when compiling...

  1. #1
    Join Date
    May 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default why am i getting this error when compiling...

    [Error] C:\Simba\Includes\srl/srl/misc/smart.simba(2:20): 'BEGIN' expected at line 1
    Compiling failed.

    i put a begin in there and then another error occurs and I keep getting errors that I have no idea what they mean I have only been programing for 1 week and wow I am winging it.

    Working on a script for almost 3 days now and fucking get it done and this error comes up idk what to do help... fustrated...
    Last edited by Steingraber; 05-25-2012 at 10:50 PM.

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

    Default

    Post the code, put it in simba tags.

  3. #3
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    After all of your global vars, global consts, functions, and procedures you need a main loop.

    Simba Code:
    begin

    end. // the final end has a period.

  4. #4
    Join Date
    May 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    program WalktoSANDPITYANILLE;
    {$include srl/srl/misc/smart.simba}
    {$I SRL/SRL.simba}
    {$I srl/srl/misc/debug.simba}

    procedure DeclarePlayers;
    begin



      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := ''; // Username
      Players[0].Pass := ''; // Password
      Players[0].Active := True;
      Players[0].Pin := '';
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
    end;// declare players
    procedure SetupLogin;
    begin
      ClearDebug;
      Smart_Server := 87;
      Smart_Members := True;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
    end;

    var
    x, y, i: Integer;
    Q: Array [0..1] of Integer;//DTM Declaring procedure.

    Procedure SetDTM;
    begin
    Q[0] := DTMFromString('mbQAAAHicY2VgYGADYiEglmKAAGYo3wrKB4lzAHFxXgZDUowsQ22BKUOwnxJDXIg6AzbAiAWDAQBPnQWQ');
    Q[1] := DTMFromString('mggAAAHicY2NgYBAAYi0glmKAAA4glgRiMSBWBmI9qLgiELMCcXFeBkNUhCpDnBEbw6kKQYa4cGmG8nxlBlyAEQeGAAD6uwbx');



    begin

      SetupLogin;
      DeclarePlayers;
      LoginPlayer;
      SetDTM;
      if FindDTM(Q[0], x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
      Mouse(x, y, 3, 3, True);
      FFlag(6);
      repeat
      Wait(50 + Random(25));
      until FindDTM(Q[1], x, y, MMX1, MMY1, MMX2, MMY2);
      end;
      if FindDTM(Q[1], x, y, MMX1, MMY1, MMX2, MMY2) then
      begin
      Mouse(x, y, 3, 3, True);
      FFlag(6);

    end;

    All I want to do is make the Script walk.. Tell me whats wrong I know there is a lot of mistakes but remember only 1week...
    Last edited by Steingraber; 05-25-2012 at 11:15 PM.

  5. #5
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Needs to end with a end. not a end;
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

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

    Default

    Procedure SetDTM; has not end for it.

    Your need another end. (with a period) at the very bottom of sccript.

    Also post scripts in SIMBA tags not Quote tags.
    Also make sure you have good standards so your code is nicer/easier to read!

  7. #7
    Join Date
    May 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kevin33 View Post
    Needs to end with a end. not a end;
    THanks. but still doesnt answer my problem of why when I try to compile I opens another Tab and tells me I have an error in another Script.

    Simba Code:
    {$DEFINE SRL_SMART};
    {$DEFINE SMART}
    {.loadlib libsmart}

    function IsKeyDown(C:Byte): Boolean;
    begin
      Result := SmartIsKeyDown(C);
    end;

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

    procedure HoldMouse(x, y: Integer; button : integer);
    begin
      if button = mouse_left then
        SmartHoldMousePlus(x,y,1)
      else if button = mouse_middle then
        SmartHoldMousePlus(x,y,2)
      else if button = mouse_right then
        SmartHoldMousePlus(x,y,3)
      else
        raiseexception(ercustomerror,'Unknown mouse button in SmartHoldMousePlus');
    end;

    procedure ReleaseMouse(x, y: Integer; button : integer);
    begin
      if button = mouse_left then
        SmartReleaseMousePlus(x,y,1)
      else if button = mouse_middle then
        SmartReleaseMousePlus(x,y,2)
      else if button = mouse_right then
        SmartReleaseMousePlus(x,y,3)
      else
        raiseexception(ercustomerror,'Unknown mouse button in SmartReleaseMousePlus');
    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; keywait{$IFNDEF SIMBAMAJOR980}, keymodwait{$ENDIF}: integer);
    begin
      SmartSendKeys(S);
    end;

    function FindAndSetTarget(TitlePrefix: String; SetAsTarget: Boolean): Boolean;
    var
      T : TSysProcArr;
      I : Integer;
    begin
      T := GetProcesses;
      for I := High(T) downto 0 do
        if Pos(TitlePrefix, T[I].Title) <> 0 then
        begin
          Result := True;
          if SetAsTarget then SetTarget(T[I]);
          Exit;
        end;
    end;

    procedure GetRealMousePos(var X, Y : Integer);
    var
      KMTarget, ITarget : Integer;
    begin
      KMTarget := GetKeyMouseTarget;
      ITarget := GetImageTarget;
      FindAndSetTarget('Public SMART', True);
      GetTClient.IOManager.GetMousePos(X, Y);
      FreeTarget(GetImageTarget);
      SetKeyMouseTarget(KMTarget);
      SetImageTarget(ITarget);

      // These are not universial offsets, but works somewhat for some Windows themes.
      X := X - 8;
      Y := Y - 25;
    end;

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

    function IsRealMouseInBox(B : TBox): Boolean;
    var
      P : TPoint;
    begin
      GetRealMousePos(P.X, P.Y);
      Result := PointInBox(P, B);
    end;

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

    procedure SmartSetTarget;
    begin
      SetTargetArray(SmartImageArray, 765,503);
    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 SmartSaveSettings(v: TVariantArray);
    var
      i: Integer;
      ts: TStringArray;
    begin
      ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/misc/smartINI.ini'];
      for i := 0 to 4 do
        WriteINI('SMART', ts[i], v[i], ts[5]);
    end;   }


    procedure SmartSetupEx(Server: integer; members, signed, superdetail: boolean);
    var
      prefix: string;
    begin
      prefix := ReadINI('World' + IntToStr(Server), 'Prefix', IncludePath + 'SRL/SRL/misc/worlds.ini');
      if(prefix = '')then
      begin
        writeln('Invalid world number or corrupted world list. Please review your settings');
        TerminateScript;
      end;
      SmartSetup('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)), 765, 503, 's');
      //SmartSaveSettings([Server, Members, Signed, SuperDetail, SmartGetDC]);
    end;

    {function SmartLastSettings: TStringArray;
    var
      i: Integer;
      ts: TStringArray;
    begin
      ts := ['server', 'members', 'signed', 'sd', 'DC', IncludePath + 'SRL/SRL/Misc/smartINI.ini'];
      SetLength(Result, 5);
      for i := 0 to 4 do
        Result[i] := ReadINI('SMART', ts[i], ts[5]);
    end; }

    This tab opens up when I compile and gives same error.

    Quote Originally Posted by YoHoJo View Post
    Procedure SetDTM; has not end for it.

    Your need another end. (with a period) at the very bottom of sccript.

    Also post scripts in SIMBA tags not Quote tags.
    Also make sure you have good standards so your code is nicer/easier to read!
    Thanks. Still getting error
    Is there an easier way to walk I have read literally every guide... I can't figure out walking...
    Last edited by Steingraber; 05-25-2012 at 11:14 PM.

  8. #8
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Semi colon after the very top $DEFINE
    {$DEFINE SRL_SMART};
    No semi colon and try that.
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

  9. #9
    Join Date
    May 2012
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kevin33 View Post
    Semi colon after the very top $DEFINE
    {$DEFINE SRL_SMART};
    No semi colon and try that.
    THANKS YOU SO MUCH!!! No more error!!!

  10. #10
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Lo your welcome. Happy to help. If you ever have any problems feel free to PM me or make a thread about it. You can be sure I will at least read it

    Oh and dont compile that second tab. Compile your first tab and be sure to save both to prevent the problem in the future.
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

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
  •