Results 1 to 3 of 3

Thread: "Until" Problems

  1. #1
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default "Until" Problems

    My script is as follows:
    SCAR Code:
    ///////////////////////////////////////////////////////////////////////////
    //////////////////////////////Bronze Arrow Buyer///////////////////////////
    /////////////////////////////By: 3Garrett3/////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
    //Have your screen set to V-Bright.                                      //
    //Have Archery window open (Lowes).                                      //
    ///////////////////////////////////////////////////////////////////////////
    {Credits: JAD, Markus, Yohojo8 (DTM), Jason2gs, and RScheater13 for letting me
    use his Feather buyer to start this}

    program Arrowbuyer;
    {.include SRL/SRL.scar}
    var Arrow : Integer;
    Bought : Integer;
    begin;
    SetupSRL;
    Arrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
    repeat
     if FindDTM(Arrow,x,y,1, 1, 200, 200) Then
     Begin
       Mouse(x, y, 2, 2, False);
       ChooseOption(x, y, '10');
       Wait(6000+random(300));
       Bought:= Bought + 10
     End;
    End;
    until(IsFKeyDown(12))
    procedure Report;
      begin
        Writeln('[]========================================[]');
        Writeln('---------------->Progress Report<-----------');
        Writeln('  Bought ' + IntToStr(Bought) + 'Arrows ' + '        ');
        Writeln('[]========================================[]');
      end;
    end;
    end.

    And I get this
    SCAR Code:
    Line 27: [Error] (17688:1): Identifier expected in script C:\Program Files\SCAR 2.03\Scripts\DTMS\my first.scar
    As an error. Does this have something to do with the until? And I did have it fixed somehow but then it needed an end. after the until thing but it was right were it is now and i know that the end. thing stops the whole script doesnt it? so how do I fix this error and where do I put the until?

  2. #2
    Join Date
    Feb 2007
    Posts
    215
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Remove "end;" before the until. Proper syntax is:

    repeat
    //code
    until(condition)

    Also you cant have a procedure inside the main loop. And you have an extra end; before end.

    Example:

    SCAR Code:
    Program Example;
    {includes}
    var anInteger1, anInteger2 :Integer;
         aString :String;

    Procedure ProcedureName;
    begin
    //Some Code
    end;

    begin
    //main loop
    ProcedureName; //call to a procedure
    end. //end of main loop ends with end.

    See if you can fix it, when you are done or if you get stuck look at the attatched script, i fixed it for you

    No peeking till you try!
    A common mistake people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
    -Douglas Adams

  3. #3
    Join Date
    Feb 2007
    Location
    Australia
    Posts
    358
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Hey man,
    Ive fixed up your script for you.
    I added some notes in it you can see what I did and reference it to SonOfSheep's post and see where you went wrong.

    SCAR Code:
    program Arrowbuyer;
    {.include SRL/SRL.scar}

    var
    Arrow : Integer;
    Bought : Integer;

    procedure DeclareDTM;   //declare the arrows dtm
    begin;
    Arrow:= DTMFromString('78DA631467606090634001D922BC0CFF81342' +
           '310FF07024605204392010D302291405A1048881250C309241409' +
           'A801C9F3105003728B327E350096CF06C0');
    end;

    procedure BuyArrows;  //buy arrows procedure
    begin
     if FindDTM(Arrow,x,y,1, 1, 200, 200) Then
     begin                                       //   I moved the repeat from
       Mouse(x, y, 2, 2, False);                 //   here to the main loop.
       ChooseOption(x, y, '10');                 //
       Wait(6000+random(300));
       Bought:= Bought + 10
     end;
    end;

    procedure Report; //report procedure
    begin
        Writeln('[]========================================[]');
        Writeln('---------------->Progress Report<-----------');
        Writeln('  Bought ' + IntToStr(Bought) + 'Arrows ' + '        ');
        Writeln('[]========================================[]');
    end;

    begin //main loop              //
     SetupSRL;                     //  I put the loop in here, it still stops with
     repeat                        //  F12 and after you stop it it does a progress
      BuyArrows                    //  report
     until(IsFKeyDown(12))         //
     Report;                       //
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. action="www.site.com" method="post"
    By Jason2gs in forum General
    Replies: 4
    Last Post: 05-17-2007, 11:50 PM
  2. Replies: 3
    Last Post: 04-19-2007, 03:44 AM
  3. Replies: 5
    Last Post: 10-26-2006, 11:30 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
  •