Results 1 to 5 of 5

Thread: Identifier Error

  1. #1
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier Error

    I tried searching the forums and couldn't find an answer to my question. I know what causes an identifier error and usually how to take care of them except for this. I can't find where I'm missing something. Here's the procedure.

    SCAR Code:
    procedure Talk;
    begin
      begin
        if (InChat('Hey') or
          InChat('What''s up') or
          InChat('What up') or
          InChat('Sup') or
          InChat('Yo')) then
        begin
          TypeSend('Trying to read')
        end;
      end;
            begin
              Case Random(10)

              0: begin
                   TypeSend('Attack lvls?')
                 end;

              1: begin
                   TypeSend('Str lvls?')
                 end;

              2: begin
                   TypeSend('Defence levels?')
                 end;
            end;
    end;

    Let me know if you see any more errors. It has the error occuring at the first begin.

  2. #2
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Forgot "Of" on line 14 of your procedure.

    Case..Of needs to be ended, just like a begin..end;.

    You also put some unneeded begin..end;s in there.

    Fixed & Cleaned up:

    SCAR Code:
    procedure Talk;
    begin
      if (InChat('Hey') or
      InChat('What''s up') or
      InChat('What up') or
      InChat('Sup') or
      InChat('Yo')) then
      begin
        TypeSend('Trying to read');
        Case Random(10) of
        0: TypeSend('Attack lvls?');
        1: TypeSend('Str lvls?');
        2: TypeSend('Defence levels?');
        end;
      end;
    end;

    I see your making an AutoResponder, and I also see you're making the same mistake I did when I tried doing that. Lemme explain.

    InChat first makes a bitmap mask of the text you request to be checked for. Bitmaps tend to lag, especially if you're searching for that many, in such a small amount of time. It would cut down on lag a lot if you do something like this:

    SCAR Code:
    procedure Talk;
    var
      LastMessage: String;
    begin
      GetLastChatText(LastMessage);
      if ((Pos('Hey', LastMessage) <> 0) or
      (Pos('What''s up', LastMessage) <> 0) or
      (Pos('What up', LastMessage) <> 0) or
      (Pos('Sup', LastMessage) <> 0) or
      (Pos('Yo', LastMessage) <> 0)) then
      begin
        TypeSend('Trying to read'); // Btw, What's this?
        Case Random(10) of
        0: TypeSend('Attack lvls?');
        1: TypeSend('Str lvls?');
        2: TypeSend('Defence levels?');
        end;
      end;
    end;

    That saves the last chat message, into a variable, and checks the string like that. It's a lot faster than searching for so many bitmaps like you had before.

  3. #3
    Join Date
    Jun 2007
    Location
    Kentucky, United States of America
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a ton. . .Didn't know about the of thing.

  4. #4
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    No problem

  5. #5
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    jason knows what hes doing, but he isnt a member lol...odd...
    Originally Posted by YoHoJo
    I like hentai.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unknown Identifier Error
    By imLuck in forum OSR Help
    Replies: 0
    Last Post: 10-30-2008, 12:51 AM
  2. Unknown identifier error
    By 2pacfan in forum OSR Help
    Replies: 9
    Last Post: 04-23-2008, 11:09 AM
  3. Duplicate identifier Error
    By soul hacker in forum OSR Help
    Replies: 15
    Last Post: 06-03-2007, 11:42 PM
  4. Duplicate Identifier Error
    By I Karma I in forum OSR Help
    Replies: 6
    Last Post: 12-05-2006, 11:55 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
  •