Results 1 to 12 of 12

Thread: for I := 1 to 4

  1. #1
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default for I := 1 to 4

    SCAR Code:
    Function MonsterClick: Boolean;
    begin
      for i := 1 to 4 do
      begin
        CastOn(Spell, MonsterName, MColours, 15)
          if InChatMulti('Text1', 'Text2', 'Text3') then
          begin
            Result = True;
            break;
          end else
          begin
             Result = False;
             FTWait(12);
          end;
      end;
    end;

    i is an integer, and Text1-3 actually has other text there, but I get this error:

    SCAR Code:
    Failed when compiling
    Line 87: [Error] (18605:1): Type mismatch in script

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I took that, put crap in the params of cast on, declared i, and did result:= and it compiled for me... post whole script?

  3. #3
    Join Date
    Oct 2006
    Posts
    702
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if you post script make sure u dont post ur username and pass by accident.
    "For it is not what goes into your mouth that will defile you; rather, it is what comes out of your mouth that defiles you." - Jesus of Nazareth

  4. #4
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't feel comfortable posting the entire script, my last script got stolen. Boreas, what did you change? Is there any other info you need?

  5. #5
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I only changed what I said in my last post. I can't get the same error with

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/magic.scar}

    var i:integer;

    Function MonsterClick: Boolean;
    begin
      for i := 1 to 4 do
      begin
        CastOn('s', 's', 223525, 15)
          if InChatMulti('Text1', 'Text2', 'Text3') then
          begin
            Result := True;
            break;
          end else
          begin
             Result := False;
             FTWait(12);
          end;
      end;
    end;

    begin
      SetupSRL;
      monsterclick;
    end.

    You can pm if you want, or at least tell me what line 87 is.

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    CastOn('s', 's', 223525, 15); <--- semicolon

  7. #7
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Boreas View Post
    CastOn('s', 's', 223525, 15); <--- semicolon
    lol thats not the problem the problem is SRL you must have changed somthing in there and saved it. i would restart SRL all over again.
    Because my Computer Runs it just Fine.

  8. #8
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Yea it is the problem, solved thru pm. What happened was first the missing semicolon caused the error message to be about the wrong line. It was about caston, which needs 2 strings and 2 integers. He declared Mcolours as an array of integers, where I used a made up integer which meant I didn't error. He's going to do Mcolours[i] or just pick 1 color.

  9. #9
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Are you sure that was the problem Boreas? Because he did put
    SCAR Code:
    Result = False; //no :!

  10. #10
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Leaving out the colon doesn't help lol, but it wasn't causing the type mismatch. When compiling, SCAR reads errors from the top to bottom, so it was getting to caston first.

  11. #11
    Join Date
    Oct 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  12. #12
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    np :P

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
  •