Results 1 to 6 of 6

Thread: Syntax Error...

  1. #1
    Join Date
    Jun 2007
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Syntax Error...

    Here's my script:

    SCAR Code:
    //    Jacobdm0's Updated Feather Buyer!    \\
        //           Feather Buyer 1.2!!             \\
       //          Setup Starts On Line 14            \\
      //        Buys, then waits for restock           \\
     //          Ocasionally buys 1's or 5's            \\
    //  Doesn't ALWAYS get the exact amount you want     \\


          {.include SRL/SRL.scar}

    Const
    //  SETUP    \\
    // (VERY easy) \\

    FeathersToBuy = 1000; //Self Explain

    //Have Trade with Gerrant OPEN\\

    //DO NOT TOUCH BELOW\\

    Var
    FeathersBought : Integer;

    Procedure
     ClickFeathers;
       Begin
         Mouse(x,y,380,81,true);
         Wait(100);
         Wait(1+random(500));
       End;
    Procedure
     Buy10;
       Begin
         Mouse(x,y,380,152,False);
         Wait(7500+random(500));
         FeathersBought := FeathersBought+10
       End;
    Procedure
      Buy5;
        Begin
          Mouse(x,y,380,136,True);
          Wait(3000+random(500));
          FeathersBought := FeathersBought+5
        end;
    Procedure
      Buy1;
        Begin
          Mouse(x,y,380,121,true);
          Wait(1000+random(500));
          FeathersBought := FeathersBought+1;
        end;

    Begin
     FeathersBought := 0;
    Repeat
        Case random(16) of

          0: Begin
               ClickFeathers;
               Buy10;
             end;

          1: Begin
               ClickFeathers;
               Buy5;
             end;

          2: Begin
               ClickFeathers;
               Buy1;
             end;

          3: Begin
               ClickFeathers;
               Buy10;
             end;

          4: Begin
               ClickFeathers;
               Buy10;
             end;

          5: Begin
               ClickFeathers;
               Buy10;
             end;

          6: Begin
               ClickFeathers;
               Buy10;
             end;

          7: Begin
               ClickFeathers;
               Buy10;
             end;

          8: Begin
               ClickFeathers;
               Buy10;
             end;

          9: Begin
               ClickFeathers;
               Buy10;
             end;

         10: Begin
               ClickFeathers;
               Buy10;
             end;

         11: Begin
               ClickFeathers;
               Buy10;
             end;

         12: Begin
               ClickFeathers;
               buy10;
             end;

         13: Begin
               ClickFeathers;
               buy10;
             end;

         14: Begin
               ClickFeathers;
               buy10;
             end;

         15: Begin
               ClickFeathers;
               Buy5;
             end;

      Until (FeathersBought > FeathersToBuy);


    WriteLn: '=========================';
    WriteLn: '=====PROGRESS REPORT=====';
    WriteLn: '  Feathers Bought: ' +(IntToStr(FeathersBought));
    WriteLn: '==      JACOBDM0       ==';
    WriteLn: '=========================';
    End.

    Whenever i try to play it, Scar says:
    "Line 140: [Error] (14589:1): Syntax error in script"

    anyone know how to fix it? I figure, since it's REALLY close to the bottom of the script, it's my last problem to fix. PLEASE help.

  2. #2
    Join Date
    Nov 2006
    Location
    In an Amish Paradise
    Posts
    729
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Learn some standerds... last line... Until ( i = FeathersToBuy) or (BuyVariable);

    What I see at a quick glance...

    Hope this helps,
    ~Stupedspam

  3. #3
    Join Date
    Jun 2007
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OOPPS!!

    I completely posted the WRONG script. The one i posted was my first script, it was already working fine.

    Lemme repost my script that REALLY has the problem...

  4. #4
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    WriteLn: '=========================';
    WriteLn: '=====PROGRESS REPORT=====';
    WriteLn: '  Feathers Bought: ' +(IntToStr(FeathersBought));
    WriteLn: '==      JACOBDM0       ==';
    WriteLn: '=========================';
    End.

    needs to be

    SCAR Code:
    WriteLn('=========================');
    WriteLn('=====PROGRESS REPORT=====');
    WriteLn('  Feathers Bought: ' +(IntToStr(FeathersBought)));
    WriteLn('==      JACOBDM0       ==');
    WriteLn('=========================');
    End.

    Notice the parentheses I added onto each start and end of writeln, and removed the colon. The proper syntax of writeln is

    SCAR Code:
    writeln('Text');



    Edit- You've also got a who lot of other stuff wrong in there, i recommend looking over some beginner tutorials.

    SCAR Code:
    //    Jacobdm0's Updated Feather Buyer!    \\
        //           Feather Buyer 1.2!!             \\
       //          Setup Starts On Line 14            \\
      //        Buys, then waits for restock           \\
     //          Ocasionally buys 1's or 5's            \\
    //  Doesn't ALWAYS get the exact amount you want     \\


          {.include SRL/SRL.scar}

    Const
    //  SETUP    \\
    // (VERY easy) \\

    FeathersToBuy = 1000; //Self Explain

    //Have Trade with Gerrant OPEN\\

    //DO NOT TOUCH BELOW\\

    Var
    FeathersBought : Integer;

    Procedure
     ClickFeathers;
       Begin
         Mouse(x,y,380,81,true);
         Wait(100);
         Wait(1+random(500));
       End;
    Procedure Buy10;
       Begin
         Mouse(x,y,380,152,False);
         Wait(7500+random(500));
         FeathersBought := FeathersBought+10
       End;
    Procedure Buy5;
        Begin
          Mouse(x,y,380,136,True);
          Wait(3000+random(500));
          FeathersBought := FeathersBought+5
        end;
    Procedure Buy1;
    Begin
          Mouse(x,y,380,121,true);
          Wait(1000+random(500));
          FeathersBought := FeathersBought+1;
    end;

    Begin
     FeathersBought := 0;
    Repeat
        Case random(16) of

          0: Begin
               ClickFeathers;
               Buy10;
             end;

          1: Begin
               ClickFeathers;
               Buy5;
             end;

          2: Begin
               ClickFeathers;
               Buy1;
             end;

          3: Begin
               ClickFeathers;
               Buy10;
             end;

          4: Begin
               ClickFeathers;
               Buy10;
             end;

          5: Begin
               ClickFeathers;
               Buy10;
             end;

          6: Begin
               ClickFeathers;
               Buy10;
             end;

          7: Begin
               ClickFeathers;
               Buy10;
             end;

          8: Begin
               ClickFeathers;
               Buy10;
             end;

          9: Begin
               ClickFeathers;
               Buy10;
             end;

         10: Begin
               ClickFeathers;
               Buy10;
             end;

         11: Begin
               ClickFeathers;
               Buy10;
             end;

         12: Begin
               ClickFeathers;
               buy10;
             end;

         13: Begin
               ClickFeathers;
               buy10;
             end;

         14: Begin
               ClickFeathers;
               buy10;
             end;

         15: Begin
               ClickFeathers;
               Buy5;
             end;
    end;

    Until (FeathersBought > FeathersToBuy);


    WriteLn('=========================');
    WriteLn('=====PROGRESS REPORT=====');
    WriteLn('  Feathers Bought: ' +(IntToStr(FeathersBought)));
    WriteLn('==      JACOBDM0       ==');
    WriteLn('=========================');
    End.

    Compiles, please look through what i did in order to learn from mistakes. One problem was that you needed an end after
    SCAR Code:
    15:
    Begin
      ClickFeathers;
      Buy5;
    end;

    and before the until.

    Also need to specify where to buy the feather at, since you use mouse to move to a certain point.
    I like my coffee black just like my metal.

  5. #5
    Join Date
    Jun 2007
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    alright, thnx estaban.

    btw, this is only my second script. I didn't really expect it to have no errors.

  6. #6
    Join Date
    Apr 2007
    Location
    The Buckeye State
    Posts
    482
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yep, just read through that and i think you'll learn quite a bit from it .
    I like my coffee black just like my metal.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Syntax error(need help.)
    By weequ in forum OSR Help
    Replies: 9
    Last Post: 04-04-2008, 04:54 AM
  3. Replies: 5
    Last Post: 02-26-2008, 04:14 PM

Posting Permissions

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