Results 1 to 7 of 7

Thread: Help! "Unknown Identifier" in my variable lines

  1. #1
    Join Date
    Oct 2007
    Location
    if(FindMyHouse(x,y,'ous',MyPlace,15))then
    Posts
    97
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help! "Unknown Identifier" in my variable lines

    Hey, I was using 'Mat's Powercutting Tutorial" and when I go to Compile, I get this.

    Line 15: [Error] (14710:1): Identifier expected in script

    Look at my Line 15....

    Line15--|var
    Line16--|x,y:integer;


    Strange?


    --------------


    Here's my full script

    SCAR Code:
    program PowerCutter;
    {.include srl/srl.scar}

    const
      TreeColor = 3894371; //colour pick the tree that you want to powerwhack(HAS to be willow)

    procedure DoAntiRandoms;
     begin
      FindTalk;
      FindNormalRandoms;
     if (FindFight = true) then
     begin
      RunAwayDirection('S'); //what direction do you want your character to run? (N,E,S,W)
      Wait(10000 + random(2500));
      RunBack;
    end;

    var
    x,y:integer;

    procedure Cut;
    var C:integer;
    begin
        if(FindObj(x,y,'ree',TreeColor,15))then
        begin
          Mouse(x,y,5,5,True);
          Writeln('Walking to Tree');
          Flag;
          Writeln('Cutting Tree');
          C:= InvCount;
            repeat
              wait(250);
                if not(LoggedIn)then
                  Exit;
            until(InvCount > C);
        end;

    procedure Drop;
    var Logs:integer;
      begin
    Logs := DTMFromString('78DA637466626078CA80023C1C25C1342394C' +
           'F680354F391010D30A2AA0900AA794D408D3750CD4D026A2C806A' +
           'EE1250634C845DF6403577F0AB0100142608C7');

        if(FindDTM(Logs,x,y,MIX1,MIY1,MIX2,MIY2))then
         begin
          Mouse(x,y,5,5,False);
           if(ClickOption('rop',2))then
           begin
            wait(1000+random(650));
            Writeln('Dropped');
            end else
            begin
             ArrangeInv;
            end;
         end else
         begin
          ArrangeInv;
      end;

    begin
      SetupSRL;
        repeat
            repeat
                if not(LoggedIn)then
                  Exit;
              Cut;
            until(InvFull)
            repeat
                if not(LoggedIn)then
                  Exit;
              Drop;
            until(FindDTM(Logs,x,y,MIX1,MIY1,MIX2,MIY2));
        until(False)
    end.

    '   _________    ___.                                       .__
    '
     /   _____/__ _\_ |__   _____   ___________  ___________  |  |
    '  \_____  \|  |  \ __ \ /     \_/ __ \_  __ \/  ___/\__  \ |  |
    '
     /        \  |  / \_\ \  Y Y  \  ___/|  | \/\___ \  / __ \|  |__
    ' /_______  /____/|___  /__|_|  /\___  >__|  /____  >(____  /____/
    '
           \/          \/      \/     \/           \/      \/


    I still have comments, etc, to add....but the content of the script, I just can't get it working, can someone help me?


    http://i224.photobucket.com/albums/d...iton/buxto.jpg

    WORKING Free RS Membership! (Click on the Bux.to sig!)


  2. #2
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You need one more "end;" in the procedure above
    var
    x,y: Integer;

    Also, the last part of the script will probably give you a syntax error. The string has no end, no name nor any code that will write it.

    -Knives

  3. #3
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    You're missing a end;

    E: Knives beat me to it

  4. #4
    Join Date
    Oct 2007
    Location
    if(FindMyHouse(x,y,'ous',MyPlace,15))then
    Posts
    97
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm sorry, but, I'm new to scripting and it'd be appreciated if you could tell me where to add the end into.

    Has the Exit; gotta be changed to end; ? (I've tried it, but just asking, many things I tried didn't work.)


    http://i224.photobucket.com/albums/d...iton/buxto.jpg

    WORKING Free RS Membership! (Click on the Bux.to sig!)


  5. #5
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Fixed your standards and added the end;'s needed...

    SCAR Code:
    program PowerCutter;
    {.include srl/srl.scar}

    const
      TreeColor = 3894371; //colour pick the tree that you want to powerwhack(HAS to be willow)

    procedure DoAntiRandoms;
     begin
      FindTalk;
      FindNormalRandoms;
     if (FindFight = true) then
     begin
        RunAwayDirection('S'); //what direction do you want your character to run? (N,E,S,W)
        Wait(10000 + random(2500));
        RunBack;
      end;// here
    end;

    var
      x, y: Integer;

    procedure Cut;
    var C:integer;
    begin
      if(FindObj(x,y,'ree',TreeColor,15))then
      begin
        Mouse(x,y,5,5,True);
        Writeln('Walking to Tree');
        Flag;
        Writeln('Cutting Tree');
        C:= InvCount;
        repeat
          wait(250);
          if not(LoggedIn)then
            Exit;
        until(InvCount > C);
      end; // here.
    end;

    procedure Drop;
    var Logs:integer;
    begin
      Logs := DTMFromString('78DA637466626078CA80023C1C25C1342394C' +
             'F680354F391010D30A2AA0900AA794D408D3750CD4D026A2C806A' +
             'EE1250634C845DF6403577F0AB0100142608C7');
      if(FindDTM(Logs,x,y,MIX1,MIY1,MIX2,MIY2))then
      begin
        Mouse(x,y,5,5,False);
        if(ClickOption('rop',2))then
        begin
          wait(1000+random(650));
          Writeln('Dropped');
        end else
        begin
          ArrangeInv;
        end;
        end else
        begin
          ArrangeInv;
        end;
      end;// here
    end;// and here...

    begin
      SetupSRL;
      repeat
        repeat
          if not(LoggedIn)then
            Exit;
          Cut;
        until(InvFull)
        repeat
          if not(LoggedIn)then
            Exit;
          Drop;
        until(FindDTM(Logs,x,y,MIX1,MIY1,MIX2,MIY2));
      until(False)
    end.

  6. #6
    Join Date
    Oct 2007
    Location
    if(FindMyHouse(x,y,'ous',MyPlace,15))then
    Posts
    97
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahha, thank you very much!


    EDIT: Compiled the fix-up from GOF, and found out that there were too many end;'s :P

    Fixed it up myself.

    Thanks again!


    http://i224.photobucket.com/albums/d...iton/buxto.jpg

    WORKING Free RS Membership! (Click on the Bux.to sig!)


  7. #7
    Join Date
    Oct 2007
    Posts
    95
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    -EDIT-
    I am sorry, I posted something here and did not mean to. Could a moderator please delete this?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 05-17-2008, 12:48 PM
  2. "Variable Expected In Script"
    By jlbmc in forum OSR Help
    Replies: 1
    Last Post: 01-19-2008, 04:21 PM
  3. Fix for "Unknown identifier ChangeFPHandle"
    By Markus in forum Outdated Tutorials
    Replies: 17
    Last Post: 09-14-2007, 03:01 AM

Posting Permissions

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