Results 1 to 5 of 5

Thread: where error?

  1. #1
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default where error?

    So im just messing around trying to learn abit of reflection and i made this:

    SCAR Code:
    procedure FightCow;
    var
    NPC : TNPC;
    begin
    If not R_InFight then
    repeat
    begin
    If FindFreeNPC('Cow', NPC) then
    begin
    x := NPC.MS.x;
    y := NPC.MS.y;
    Mouse(x, y, 0, 0, false);
    ChooseOption('ttack');
    end;
    If not ChooseOption('ttack') then
    begin
    FightCow;
    Until (R_InFight) then // LINE 38
    If R_InFight then
    begin
    GameTab(tab_inv);
    Until not (R_InFight);  
    end;
    end;

    but im getting

    Line 38: [Error] (27710:1): Identifier expected in script

    i have tried adding end; everywhere i can think but that hastn solved it =/ help is appreciated

  2. #2
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    you have Until () then, take out the then. If you want you can do

    until(R_InFight);
    if(R_InFight) then

    but you can't do until() then


    EDIT: oh you do have if/then uderneath, well just take out the then after until. Then the error should go away.

  3. #3
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Also, there are 3 begins in the repeat..until loop, but only one end. I'm not 100% sure, but that might give an error.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Wow what happened there lol..

    Fixed..
    SCAR Code:
    Procedure FightCow;
     Var
      NPC: TNPC;
    Begin
      If Not R_InFight Then
      Begin
        Repeat
          Begin
            If FindFreeNPC('Cow', NPC) Then
            Begin
              x := NPC.MS.x;
              y := NPC.MS.y;
              Mouse(x, y, 0, 0, False);
              ChooseOption('ttack');
            End;
            If Not ChooseOption('ttack') Then
            Begin
              Repeat
                FightCow;
              Until (R_InFight) Then // LINE 38
                 If R_InFight Then
               Begin
                 GameTab(tab_inv);
               End;
            End;
          End;
        Until Not (R_InFight);  
      End;
    End;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  5. #5
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by R1ch View Post
    Also, there are 3 begins in the repeat..until loop, but only one end. I'm not 100% sure, but that might give an error.
    lol you're not 100% sure if 3 begins and only one end give an error? I think I can say I am sure it will I just only looked at his line 38 though when I told him how to fix his error he was getting. I didn't look for every error.

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
  •