Results 1 to 3 of 3

Thread: Help please

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

    Default Help please

    I just started to learn to script, and this is a power chopper, i get this problem all the time.

    Failed when compiling
    Line 4: [Error] (12235:1): 'BEGIN' expected in script

    my script:

    program PowerChopper;
    {.include SRL/SRL.scar}

    ================================================== ======================
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    //////////////////I. Use with Scar 3.11 and SRL 4\\\\\\\\\\\\\\\\\\\\\\|
    //////////////////II. Low Detail \\\\\\\\\\\\\\\\\\\\\|
    //////////////////III. Setup on the setup lines \\\\\\\\\\\\\\\\\\\\\|
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    ================================================== ======================
    const
    LoadsPerPlayer = 100 //Amount of loads per player
    TreeColor = 865582; //Colour of tree leaves on the tree you want to cut.
    AxeEquipped = False //If axe is equipped, change to true.
    WaitPerTree = 5000;
    procedure DeclarePlayers;
    begin
    NumberOfPlayers(2);

    Players[0].Name := '';
    Players[0].Pass := '';
    Players[0].Nick := '';
    Players[0].Active := True;

    Players[1].Name := '';
    Players[1].Pass := '';
    Players[1].Nick := '';
    Players[1].Active := True;
    CurrentPlayer := 0;
    end;
    ////////////////////////////DO NOT TOUCH\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    Procedure ChopTree;
    var
    x, y, MyMark : integer;
    begin
    if not Loggedin then Exit;
    MarkTime(MyMark);
    repeat
    if FindObj(x, y, 'hop', TreeColor, 30) then
    begin
    Mouse(x, y, 1, 1, False);
    if ChooseOption('ree') then
    begin
    Wait(WaitPerTree);
    Exit;
    end;
    end;
    if TimeFromMark(MyMark) > (2 * 60 * 1000) then
    begin
    Logout;
    Exit;
    end;
    until false
    end;

    begin
    SetupSRL;
    DeclarePlayers;
    if Loggedin then Logout;
    LoginPlayer;
    repeat
    ChopTree;
    if InvFull then
    begin
    if (AxeInInventory) then DropToPosition(2, 28);
    if (not(AxeInInventory) then DropAll;
    Inc(Players[CurrentPlayer].Banked);
    if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
    begin
    NextPlayer(True);
    end;
    end;
    if not Loggedin then NextPlayer(False);
    until false


    end.

  2. #2
    Join Date
    Mar 2007
    Posts
    3,042
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    You can't just have "lines" in the middle of your script. You have to comment them out. Here's the script updated with that:

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

    {================================================== ======================
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    //////////////////I. Use with Scar 3.11 and SRL 4\\\\\\\\\\\\\\\\\\\\\\|
    //////////////////II. Low Detail \\\\\\\\\\\\\\\\\\\\\|
    //////////////////III. Setup on the setup lines \\\\\\\\\\\\\\\\\\\\\|
    ////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
    ================================================== ======================}

    const
    LoadsPerPlayer = 100 //Amount of loads per player
    TreeColor = 865582; //Colour of tree leaves on the tree you want to cut.
    AxeEquipped = False //If axe is equipped, change to true.
    WaitPerTree = 5000;
    procedure DeclarePlayers;
    begin
    NumberOfPlayers(2);

    Players[0].Name := '';
    Players[0].Pass := '';
    Players[0].Nick := '';
    Players[0].Active := True;

    Players[1].Name := '';
    Players[1].Pass := '';
    Players[1].Nick := '';
    Players[1].Active := True;
    CurrentPlayer := 0;
    end;
    ////////////////////////////DO NOT TOUCH\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    Procedure ChopTree;
    var
    x, y, MyMark : integer;
    begin
    if not Loggedin then Exit;
    MarkTime(MyMark);
    repeat
    if FindObj(x, y, 'hop', TreeColor, 30) then
    begin
    Mouse(x, y, 1, 1, False);
    if ChooseOption('ree') then
    begin
    Wait(WaitPerTree);
    Exit;
    end;
    end;
    if TimeFromMark(MyMark) > (2 * 60 * 1000) then
    begin
    Logout;
    Exit;
    end;
    until false
    end;

    begin
    SetupSRL;
    DeclarePlayers;
    if Loggedin then Logout;
    LoginPlayer;
    repeat
    ChopTree;
    if InvFull then
    begin
    if (AxeInInventory) then DropToPosition(2, 28);
    if (not(AxeInInventory) then DropAll;
    Inc(Players[CurrentPlayer].Banked);
    if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
    begin
    NextPlayer(True);
    end;
    end;
    if not Loggedin then NextPlayer(False);
    until false


    end.
    :-)

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

    Default

    oh, i didnt know that, thx

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
  •