Results 1 to 9 of 9

Thread: Identifier Expected In Script

  1. #1
    Join Date
    Nov 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier Expected In Script

    SCAR Code:
    procedure FindandCut;
    begin
    if findcolor (x,y, 3758421, 229, 60, 229, 60) and
       findcolor (x,y, 530197,  254, 93, 254, 93) and
       findcolor (x,y, 1329212, 218, 95, 218, 95) then
                 Wait (7000)
                 ClickMouse (216,77, True)
                 Wait (7000)
                 ClickMouse (216, 77, True)
    It says "Identidier expected in script" at the p in procedure. How do i fix this?
    Thx

    EDIT: P.S. how do i make it repeat until inventorie's full?

  2. #2
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you end the procedure before that?

    And you write

    SCAR Code:
    repeat
      //stuff here
    until(InvFull);
    Temporarily inactive.

  3. #3
    Join Date
    Nov 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It was the first procedure

  4. #4
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Do you have variables or constants before that? Post the code you have before that procedure - pretty sure you just forgot something there.
    Temporarily inactive.

  5. #5
    Join Date
    Nov 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    Var
      x,y: Integer;
    begin
    procedure FindancCut;
    begin
    if findcolor (x,y, 3758421, 229, 60, 229, 60) and
       findcolor (x,y, 530197,  254, 93, 254, 93) and
       findcolor (x,y, 1329212, 218, 95, 218, 95) then
                 Wait (7000)
                 ClickMouse (216,77, True)
                 Wait (7000)
                 ClickMouse (216, 77, True)
    until (InvFull);
    end.
    All i know is, the beginning is TOTALLY screwed up.

  6. #6
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can't declare procedures in the main-loop (begin and end.). Fixed other errors too.

    Therefore:
    SCAR Code:
    program New;
    var
      x,y: Integer;

    procedure FindAndCut;
    begin
    repeat
      if findcolor (x,y, 3758421, 229, 60, 229, 60) and
         findcolor (x,y, 530197,  254, 93, 254, 93) and
         findcolor (x,y, 1329212, 218, 95, 218, 95) then
           Wait (7000)
           ClickMouse (216,77, True)
           Wait (7000)
           ClickMouse (216, 77, True)
    until (InvFull);
    end;

    begin
      FindandCut; //Run the procedure here
    end.
    This sentence is false.

  7. #7
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I'm pretty sure there should also be a 'begin' and 'end' for the then so it runs properly (and doesn't just run the 1st line) after the if() etc.

  8. #8
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, yeah, of course. Didn't see that error. Thanks for pointing out.

    SCAR Code:
    program New;
    var
      x,y: Integer;
     
    procedure FindAndCut;
    begin
    repeat
      if findcolor (x,y, 3758421, 229, 60, 229, 60) and
         findcolor (x,y, 530197,  254, 93, 254, 93) and
         findcolor (x,y, 1329212, 218, 95, 218, 95) then
       begin //Begin...
           Wait (7000)
           ClickMouse (216,77, True)
           Wait (7000)
           ClickMouse (216, 77, True)
       end; //.. and end so it actually runs each command.
    until (InvFull);
    end;
     
    begin
      FindandCut; //Run the procedure here
    end.
    This sentence is false.

  9. #9
    Join Date
    Nov 2007
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks! Im rlly bad at scripting lol

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
  •