Results 1 to 4 of 4

Thread: Identifier expected in script

  1. #1
    Join Date
    Mar 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier expected in script

    hello as my title says: Identifier expected in script
    at the line ''until (i: = 10);'' why is this?

    my script:

    SCAR Code:
    var
    i: integer;

    procedure cuttree;
    begin
    i:= 0;
    repeat
    i:= i + 1;
      Writeln(IntToStr(i));
     tree := BitmapFromString(1, 7, '8E75438E75438E75438E7543927' +
           '744927744927744');
     if (findbitmap (tree, x, y)) then
     until (i: = 10);
     writeln ('found tree')
     movemousesmooth (x,y);
     clickmouse (x,y,true)
    end;

    allready thanks

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you have this
    if (findbitmap (tree, x, y)) then
    until (i: = 10);

    the script is saying, if it finds the bitmap, then what? its not doing anything after that then thats why. you could have something like
    if (findbitmap (tree, x, y)) then
    Writeln('hello world');
    until (i: = 10);

    just an example

  3. #3
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    you didnt declare that in your var. I rewrote it (didnt even run it, wrote it real fast in like literally a minute). This is more along the lines of what it should look like.

    SCAR Code:
    program WhateverYouWant;

    var
      i, tree, x, y : integer;

    procedure CutTree;
    begin
      Tree := BitmapFromString(1, 7, '8E75438E75438E75438E7543927' +
        '744927744927744');
      if (findbitmap(Tree, x, y)) then
      begin
        Mouse(0, 0, 0, 0, true)
          WriteLn('found tree')
          i := i + 1;
      end;

    begin //mainloop
      SetupSRL;
      ActivateClient;
      i := 0;
      repeat
        CutTree;
      until (i: = 10);
    end.

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    No no. until (i=10)


    In conditions (if condition then, while condition do, repeat until condition), there is no semi colon. Just equal (or less than, greater than, or a combination of those).
    SCAR Code:
    repeat
      DoStuff;
      iter := iter+1;
    until  iter > 10;
    When setting the value of a variable in a statement, there is a semi colon and equal.
    SCAR Code:
    Players[0].Username := 'Boreas';

    When setting the value of a constant, there is just equal.
    SCAR Code:
    const
    LoadsToDo = 10;

    In a for loop, there is a semi colon and equal.
    SCAR Code:
    for pArray := 0 to getarraylength(array)-1 do


    BTW, use Mouse and Mmouse or you will get banned. There's a new tut on using SRL commands, check it out.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Identifier expected in script...But Why?
    By Macrosoft in forum OSR Help
    Replies: 10
    Last Post: 01-27-2012, 06:33 AM
  2. Bah!! Identifier Expected in Script.
    By siroober in forum OSR Help
    Replies: 3
    Last Post: 05-03-2008, 11:46 PM
  3. Identifier expected in script
    By StrikerX in forum OSR Help
    Replies: 2
    Last Post: 04-11-2008, 12:21 PM
  4. Identifier expected in script
    By Becks in forum OSR Help
    Replies: 6
    Last Post: 04-11-2008, 06:41 AM
  5. Identifier expected in script?
    By steth1010 in forum OSR Help
    Replies: 6
    Last Post: 05-06-2007, 09:03 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
  •