Results 1 to 5 of 5

Thread: Identifier expected in script.

  1. #1
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier expected in script.

    I get this error when I try this... I can't really figure it all out and I know its really long but i think it is something semi simple I just can't see. Help me out please


    SCAR Code:
    Procedure FindAxeAndType;
    var
     BronzeAxe, IronAxe, SteelAxe, BlackAxe, AdamAxe, RuneAxe, DragAxe: integer;
     
    begin
     if(not(LoggedIn)) then
     exit;
     begin
      BronzeAxe:= 2440785;
      IronAxe:= 5000274;
      SteelAxe:= 7895426;
      BlackAxe:= 1315862;
      AdamAxe:= 4609861;
      RuneAxe:= 6708293;
      DragAxe:= 857705;
      GameTab(4);
      wait(100+random(200));
      // For Bronze.
       if(FindColorTolerance(x, y, BronzeAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ronze')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
      // For Iron.
       begin
        if(FindColorTolerance(x, y, IronAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
        begin
         MMouse(x, y, 2, -2);
         if(IsUpText('ron')) then
         begin
          writeln('Player axe is not wielded.');
          Players[CurrentPlayer].Strings[0]:= 'iron';
          Players[CurrentPlayer].Booleans[0]:= false;
         end;
        end else
        // for Steel.
        begin
         if(FindColorTolerance(x, y, SteelAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('teel')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Black.
       begin
          if(FindColorTolerance(x, y, BlackAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('lack')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Adamant.
       begin
          if(FindColorTolerance(x, y, AdamAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('damant')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adam';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Rune.
       begin
          if(FindColorTolerance(x, y, RuneAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('une')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Dragon.
       begin
          if(FindColorTolerance(x, y, DragAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ragon')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       begin
        GameTab(5);
        wait(100+random(200));
       // For Bronze.
       if(FindColorTolerance(x, y, BronzeAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ronze')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
      // For Iron.
       begin
        if(FindColorTolerance(x, y, IronAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
        begin
         MMouse(x, y, 2, -2);
         if(IsUpText('ron')) then
         begin
          writeln('Player axe is wielded.');
          Players[CurrentPlayer].Strings[0]:= 'iron';
          Players[CurrentPlayer].Booleans[0]:= true;
         end;
        end else
        // for Steel.
        begin
         if(FindColorTolerance(x, y, SteelAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('teel')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Black.
       begin
          if(FindColorTolerance(x, y, BlackAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('lack')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Adamant.
       begin
          if(FindColorTolerance(x, y, AdamAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('damant')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adam';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Rune.
       begin
          if(FindColorTolerance(x, y, RuneAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('une')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Dragon.
       begin
          if(FindColorTolerance(x, y, DragAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ragon')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end;
      end else
      begin
       writeln('Did not find axe. Logging Out.');
       NextPlayer(False);
       Logout;
      end;
     end;
    end;

    Also if there is anyway I can clean this up WITHOUT having to changed anything that it is suppose to do it would be much appreciated if you let me know

  2. #2
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    Procedure FindAxeAndType;
    var
    BronzeAxe, IronAxe, SteelAxe, BlackAxe, AdamAxe, RuneAxe, DragAxe: integer;

    begin
     if(not(LoggedIn)) then
     exit;
     begin
      BronzeAxe:= 2440785;
      IronAxe:= 5000274;
      SteelAxe:= 7895426;
      BlackAxe:= 1315862;
      AdamAxe:= 4609861;
      RuneAxe:= 6708293;
      DragAxe:= 857705;
      GameTab(4);
      wait(100+random(200));
      if(FindColorTolerance(x, y, BronzeAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
      begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ronze')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
        if(FindColorTolerance(x, y, IronAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
        begin
         MMouse(x, y, 2, -2);
         if(IsUpText('ron')) then
         begin
          writeln('Player axe is not wielded.');
          Players[CurrentPlayer].Strings[0]:= 'iron';
          Players[CurrentPlayer].Booleans[0]:= false;
         end;
        end else
        // for Steel.
         if(FindColorTolerance(x, y, SteelAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('teel')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Black.
          if(FindColorTolerance(x, y, BlackAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('lack')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Adamant.
          if(FindColorTolerance(x, y, AdamAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('damant')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adam';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Rune.
          if(FindColorTolerance(x, y, RuneAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('une')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       // For Dragon.
          if(FindColorTolerance(x, y, DragAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ragon')) then
        begin
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end else
       begin
        GameTab(5);
        wait(100+random(200));
       // For Bronze.
       if(FindColorTolerance(x, y, BronzeAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ronze')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
      // For Iron.
        if(FindColorTolerance(x, y, IronAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
        begin
         MMouse(x, y, 2, -2);
         if(IsUpText('ron')) then
         begin
          writeln('Player axe is wielded.');
          Players[CurrentPlayer].Strings[0]:= 'iron';
          Players[CurrentPlayer].Booleans[0]:= true;
         end;
        end else
        // for Steel.
        begin
         if(FindColorTolerance(x, y, SteelAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('teel')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Black.
          if(FindColorTolerance(x, y, BlackAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('lack')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Adamant.
          if(FindColorTolerance(x, y, AdamAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('damant')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adam';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Rune.
       if(FindColorTolerance(x, y, RuneAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('une')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end else
       // For Dragon.
          if(FindColorTolerance(x, y, DragAxe, MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        if(IsUpText('ragon')) then
        begin
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
      end else
      begin
       writeln('Did not find axe. Logging Out.');
       NextPlayer(False);
       Logout;
      end;
     end;
    end;
    end;
    end;

    your very welcome.
    I do visit every 2-6 months

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    instead of haveing like 15 different variables, why not make an array, one for colors and one for uptexts, then you could make one block of code and just use a for to loop. I can kinda show you what I mean if you would like?
    “Ignorance, the root and the stem of every evil.”

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    AHH so long!
    Reduce with cases and use a for to do loop or something .
    Also use arrays like
    SCAR Code:
    intarray := [0, 1, 2, 3];
    XD

  5. #5
    Join Date
    Mar 2007
    Location
    Eugene, Oregon
    Posts
    195
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by zasz View Post
    your very welcome.

    Thanks a ton! I think I can set it up with an array and a case though. Thanks still

    SCAR Code:
    Procedure FindAxeAndType;
    var
     BronzeAxe, IronAxe, SteelAxe, BlackAxe, AdamAxe, RuneAxe, DragAxe: integer;
     AxeColor: array[0..6] of integer;

    begin
     if(not(LoggedIn)) then
     exit;
     begin
      AxeColor[0]:= 2440785;
      AxeColor[1]:= 5000274;
      AxeColor[2]:= 7895426;
      AxeColor[3]:= 1315862;
      AxeColor[4]:= 4609861;
      AxeColor[5]:= 6708293;
      AxeColor[6]:= 857705;
      for a:= 0 to 6 do
      begin
      GameTab(4);
      wait(100+random(200));
      if(FindColorTolerance(x, y, AxeColor[a], MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        wait(100+random(200));
        case (7) of
        0:
        begin
         if(IsUpText('ronze')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        1:
        begin
         if(IsUpText('ron')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'iron';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        2:
        begin
         if(IsUpText('teel')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        3:
        begin
         if(IsUpText('lack')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        4:
        begin
         if(IsUpText('damant')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adamant';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        5:
        begin
         if(IsUpText('une')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
        6:
        begin
         if(IsUpText('ragon')) then
         writeln('Player axe is not wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= false;
        end;
       end;
      end else
      begin
       GameTab(5);
       wait(100+random(200));
       if(FindColorTolerance(x, y, AxeColor[a], MIX1, MIY1, MIX2, MIY2, 10)) then
       begin
        MMouse(x, y, 2, -2);
        wait(100+random(200));
        case (7) of
        0:
        begin
         if(IsUpText('ronze')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'bronze';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        1:
        begin
         if(IsUpText('ron')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'iron';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        2:
        begin
         if(IsUpText('teel')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'steel';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        3:
        begin
         if(IsUpText('lack')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'black';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        4:
        begin
         if(IsUpText('damant')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'adamant';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        5:
        begin
         if(IsUpText('une')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'rune';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
        6:
        begin
         if(IsUpText('ragon')) then
         writeln('Player axe is wielded.');
         Players[CurrentPlayer].Strings[0]:= 'dragon';
         Players[CurrentPlayer].Booleans[0]:= true;
        end;
       end;
      end;
     end;
    end;

    Same error as before. Missing an end somewhere. But i gotta go so i can't find it atm. Tell me if this looks any better
    Last edited by FuruChan; 05-14-2009 at 09:38 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
  •