Results 1 to 8 of 8

Thread: Sorry for another post so quick >.<

  1. #1
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Sorry for another post so quick >.<

    First script for an RSPS and wanted to see how I'd do. The only error is on the very best line I get the error saying "Unexpected end of file". What'd I do wrong ?

    Code:
    program New;
    {$i srl/srl.simba}
    
    
        var
         x, y: Integer;
    
    
    Procedure teleport;
       begin;
       MoveMouse(572, 360);
       Wait(100);
       ClickMouse(572, 360, mouse_Left);
       Wait(2000);
       MoveMouse(301, 430);
       Wait(100)
       ClickMouse(301, 430, mouse_Left);
       end;
    
       procedure ChopTree;
    var x, y: integer;
    begin
      if FindObj(x, y, 'hop', 12056824, 10) then
      begin
        Mouse(x, y, 0, 0, false);
        ChooseOption('hop');
       repeat
        Wait(1200+random(250));
      Until not IsUpText('ew') or (InvFull);
    
      MoveMouse(570, 285);
      Wait(100)
      ClickMouse(570,285, mouse_Left);
      Wait(4000)
      MoveMouse(266, 416)
      Wait(100)
      ClickMouse(266, 416, mouse_Left);
      Wait(6000);
      MoveMouse(278, 203);
      Wait(100);
      ClickMouse(278, 203, mouse_Left);
      Wait(3000);
      MoveMouse(660, 414);
      Wait(100);
      ClickMouse(660, 414, mouse_Left);
    end;
    
    begin
    repeat
      teleport;
      ChopTree;
    until false
    end;

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

    Default

    The end in the main loop has to have a period afterwards instead of a semi-colon:

    Simba Code:
    // incorrect:
    begin
      repeat
        Teleport;
        ChopTree;
      until false
    end;

    // correct:
    begin
      repeat
        Teleport;
        ChopTree;
      until false
    end.

  3. #3
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

  4. #4
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks to both of you! Again sorry for the double post!

  5. #5
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I ran into another problem. Followed everything ya said but towards the end where I type "var loop, c: integer;" it says an identifier is expected. Not quite sure what that is or how I'd switch it up to work.

  6. #6
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by phrost69 View Post
    I ran into another problem. Followed everything ya said but towards the end where I type "var loop, c: integer;" it says an identifier is expected. Not quite sure what that is or how I'd switch it up to work.
    make sure you remove all of the squiggly brackets, whether they be red or blue, only around the var line/looper. Don't remove the red brackets from the top of the file that has {$i srl/srl.simba} <-- leave as it shows, don't touch srl/srl.simba squiggly brackets.

  7. #7
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I made sure there were none. It's right on the line that say "var"

    begin
    var
    loop, c: integer;

    setupSRL;

    loops := 1000;
    repeat
    teleport;
    choptree;
    bank;
    inc(c);
    until(loops = c);
    end.

    Also saw I put begin at the wrong spot but it didn't help or make the problem worse by switching it.
    Last edited by phrost69; 09-27-2012 at 12:23 AM.

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

    Default

    ^ Declare the vars outside of the begin/end loop.

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
  •