Results 1 to 10 of 10

Thread: Identifier expected

  1. #1
    Join Date
    May 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier expected

    Well you see, I'm in the process of making a smelter, but then, I encountered this error when I was seeing if the walking would work.
    SCAR Code:
    Failed when compiling
    [Error] (17120:4): Identifier expected

    Here is the script,
    SCAR Code:
    {
             _________ __              ___.         .__    .___
            /   _____//  |______ ______\_ |_________|__| __| _/ ____   ____
            \_____  \\   __\__  \\_  __ \ __ \_  __ \  |/ __ | / ___\_/ __ \
            /        \|  |  / __ \|  | \/ \_\ \  | \/  / /_/ |/ /_/  >  ___/
           /_______  /|__| (____  /__|  |___  /__|  |__\____ |\___  / \___  >
                   \/           \/          \/              \/_____/      \/
                     _________              .__   __
                    /   _____/ _____   ____ |  |_/  |_  ___________
                    \_____  \ /     \_/ __ \|  |\   __\/ __ \_  __ \
                    /        \  Y Y  \  ___/|  |_|  | \  ___/|  | \/
                   /_______  /__|_|  /\___  >____/__|  \___  >__|
                           \/      \/     \/               \/
                           To use, place your player(s) in the Al-Kharid bank.
                           Make sure the ores necessary in the first bank slots.
                           If you are makin cannonballs, please make sure the STEEL BARS are in the bank,
                           as of yet, it does not turn ores into cannonballs all at once.
                                    }

    program EpicChopper;
    {.include srl/srl.scar}
    var
        x,y: Integer;
       

    Procedure DeclarePlayers;
    begin

      HowManyPlayers := 1; // This MUST be correct, otherwise you will encounter runtime errors.
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
      Players[0].Integers[0] := 100; //Loads to do
     
    end;

    Procedure StartUp;
    begin
     Writeln('Welcome to Starbridge''s Smelter')
     Writeln('   Initializing script          ')
     if not loggedin then loginplayer;
    end;

    Function Walking : Boolean;
    begin
     if ismoving(4) then
      begin
       While ismoving(4) do
        begin
         wait(500)
        end;
      end else
       begin
        Result := false;
       end;
    end;


    Procedure ToFurnace;
    begin
     If Radialwalk(findsandcolor,0,45,2,2,50) then
      Begin
       if ismoving(4) then
       begin
        findsymbol(x,y,'Furnace')
        Mouse(x,y,2,2,true)
        if ismoving(4) then exit
      end else
       begin
        Writeln('We could not find the sand color')
        NextPlayer(false);
       end;
    end;

    begin
     DeclarePlayers;
     StartUp;
     ToFurnace;
    end.
    Thanks in advance everyone!

  2. #2
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    change the proc to this:

    Code:
    Procedure ToFurnace;
    begin
      If Radialwalk(findsandcolor,0,45,2,2,50) then
      Begin
        if ismoving(4) then
        begin
          findsymbol(x,y,'Furnace');
          Mouse(x,y,2,2,true);
          if ismoving(4) then exit;
        end else
        begin
          Writeln('We could not find the sand color')
          NextPlayer(false);
        end;
      end;
    end;

  3. #3
    Join Date
    May 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, what did I do wrong for future reference?

  4. #4
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by Starbridge View Post
    Thanks, what did I do wrong for future reference?
    well first your standards are a little hard to read at first.

    but after i formatted them to my liking, i found that u needed a 3rd end; at the end of the proc. due to the 3 begins.

    i also added sum ";" to a couple places out of personal preference.

  5. #5
    Join Date
    May 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay thanks, and, now, when I run it, it just sits there, it is targeted, and I have added setupSRL... I don't know why...

  6. #6
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    ok 1 sec i am gunna test

  7. #7
    Join Date
    May 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Okay. Oh yeah, should I use DTMs for finding the furnace?

  8. #8
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    i personally would use DTMs/DDTMs for everything, including walking.

    EDIT: ok i just tested it on MANY worlds... it cant find teh sand color. i would create my own autocolor if u wish to use the sand color for walking

    EDIT: brb for like 5 min. so i will be responding late

  9. #9
    Join Date
    May 2008
    Posts
    93
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, for me, it finds the sand color, but the mouse doesn't move, here, I put in a dtm for the walking. Its small so bare with me.
    SCAR Code:
    {
             _________ __              ___.         .__    .___
            /   _____//  |______ ______\_ |_________|__| __| _/ ____   ____
            \_____  \\   __\__  \\_  __ \ __ \_  __ \  |/ __ | / ___\_/ __ \
            /        \|  |  / __ \|  | \/ \_\ \  | \/  / /_/ |/ /_/  >  ___/
           /_______  /|__| (____  /__|  |___  /__|  |__\____ |\___  / \___  >
                   \/           \/          \/              \/_____/      \/
                     _________              .__   __
                    /   _____/ _____   ____ |  |_/  |_  ___________
                    \_____  \ /     \_/ __ \|  |\   __\/ __ \_  __ \
                    /        \  Y Y  \  ___/|  |_|  | \  ___/|  | \/
                   /_______  /__|_|  /\___  >____/__|  \___  >__|
                           \/      \/     \/               \/
                           To use, place your player(s) in the Al-Kharid bank.
                           Make sure the ores necessary in the first bank slots.
                           If you are makin cannonballs, please make sure the STEEL BARS are in the bank,
                           as of yet, it does not turn ores into cannonballs all at once.
                                    }

    program EpicChopper;
    {.include srl/srl.scar}
    var
        x,y,Sand: Integer;
       

    Procedure DeclarePlayers;
    begin

      HowManyPlayers := 1; // This MUST be correct, otherwise you will encounter runtime errors.
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
      Players[0].Integers[0] := 100; //Loads to do
     
    end;

    Procedure LoadDTMs;
    begin
    Sand := DTMFromString('78DA636C676260D06640011BA626338800694' +
           '620FE0F048CFD403586B8D58000631D508D3EAA9AB59393E06AC0' +
           'B80FA8460DB71AA02C030095470DC7');
    end;

    Procedure StartUp;
    begin
     ClearDebug;
     Writeln('Welcome to Starbridge''s Smelter')
     Writeln('   Initializing script          ')
     LoadDTMs;
     if not loggedin then loginplayer;
    end;

    Function Walking : Boolean;
    begin
     if ismoving(4) then
      begin
       While ismoving(4) do
        begin
         wait(500)
        end;
      end else
       begin
        Result := false;
       end;
    end;


    Procedure ToFurnace;
    begin
      If FindDTM(Sand,x,y,MIX1,MIY1,MIX2,MIY2) then
      Begin
        if ismoving(4) then
        begin
          findsymbol(x,y,'Furnace');
          Mouse(x,y,2,2,true);
          if ismoving(4) then exit;
        end else
        begin
          Writeln('We could not find the sand color')
          NextPlayer(false);
        end;
      end;
    end;

    begin
     DeclarePlayers;
     SetupSRL;
     ActivateClient;
     StartUp;
     ToFurnace;
     wait(20000+Random(40))
    end.

  10. #10
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    testing... will edit

    ok i changed ur proc to this:

    Code:
    Procedure ToFurnace;
    var
      WhichAngle: Extended;
    begin
      If FindDtmRotated(sand, x, y, MMX1, MMY1, MMX2, MMY2, Radians(-35), Radians(35), 0.05,
        WhichAngle) then
      Begin
        writeln('found dtm');
        if ismoving(4) then
        begin
          findsymbol(x,y,'Furnace');
          Mouse(x,y,2,2,true);
          if ismoving(4) then exit;
        end else
        begin
          Writeln('We could not find the sand color')
          NextPlayer(false);
        end;
      end else
      begin
        writeln('didnt find dtm');
      end;
      freedtm(sand);
    end;
    Last edited by x[Warrior]x3500; 05-11-2009 at 10:34 AM.

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
  •