Results 1 to 10 of 10

Thread: [Error] Type mismatch. Help Please!

  1. #1
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [Error] Type mismatch. Help Please!

    When I run my script, It is always giving me this error.. I looked for all the ways i know of to fix this.. but still the error remains.

    Here it is
    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      if(FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2))then
        writeln('Found Knife in Inventory.');
        KnifeInv:=True
        if(not(FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)))then
          Writeln('No Knife, Dont worry... Banking for one');
          KnifeInv:=False
          Exit;
      FreeMyDTMs;
    end;
    The Error:
    Code:
    Failed when compiling
    Line 160: [Error] (17039:1): Type mismatch in script C:\SCAR 3.20\Scripts\Cutter.Scar
    Line 160 is this line
    SCAR Code:
    if(not(FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)))then
    Any, and all help would be appreciated. Going to sleep now. Talk to you all in the morning. Thanks to everyone who helps!
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    if not FindDTM(blahblah) then
    get rid of '('s
    T~M

  3. #3
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Didn't work.. still get the same error, here is what i changed it to.

    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      if(FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2))then
        writeln('Found Knife in Inventory.');
        KnifeInv:=True
        if not FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)then
          Writeln('No Knife, Dont worry... Banking for one');
          KnifeInv:=False
          Exit;
      FreeMyDTMs;
    end;
    Hmm.. maybe it's something else..i tried almost everything tho.

    Edit: See you all in the morning. Goodnight
    Last edited by Mystic; 05-09-2009 at 08:55 PM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  4. #4
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    change if(FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2))then to if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)then

  5. #5
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2) then
      begin
        writeln('Found Knife in Inventory.');
        KnifeInv := True;
      end else
      begin
        Writeln('No Knife, Dont worry... Banking for one');
        KnifeInv := False;
        Exit;
      end;
      FreeMyDTMs;
    end;

    Works?
    You need to put proper begins and ends in there!
    Ce ne sont que des gueux


  6. #6
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    procedure FindKnife;
    begin
    LoadMyDTMs;
    if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2) then
    begin
    writeln('Found Knife in Inventory.');
    KnifeInv := True;
    end else
    begin
    Writeln('No Knife, Dont worry... Banking for one');
    KnifeInv := False;
    Exit;
    end;
    FreeMyDTMs;
    end;
    to

    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      Result := FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)
      if Result then
        writeln('Found Knife in Inventory.')
      else
        Writeln('No Knife, Dont worry... Banking for one');

      FreeMyDTMs;
    end;

  7. #7
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Floor66 View Post
    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2) then
      begin
        writeln('Found Knife in Inventory.');
        KnifeInv := True;
      end else
      begin
        Writeln('No Knife, Dont worry... Banking for one');
        KnifeInv := False;
        Exit;
      end;
      FreeMyDTMs;
    end;

    Works?
    You need to put proper begins and ends in there!
    This doesn't work
    Still says line 160 error. Type Mismatch.
    Line 160 is
    SCAR Code:
    KnifeInv := True;
    Idk Whats going on >.<

    Quote Originally Posted by NaumanAkhlaQ View Post
    to

    SCAR Code:
    procedure FindKnife;
    begin
      LoadMyDTMs;
      Result := FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)
      if Result then
        writeln('Found Knife in Inventory.')
      else
        Writeln('No Knife, Dont worry... Banking for one');

      FreeMyDTMs;
    end;
    and when I run this one it says
    Code:
    Line 157: [Error] (17036:1): Unknown identifier 'Result' in script C:\SCAR 3.20\Scripts\Cutter.scar
    Line 157 is
    Code:
    Result := FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)
    Thanks, rep++ all of you.
    Any ideas on fixing this darn thing..?
    Last edited by Mystic; 05-10-2009 at 04:10 AM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Whoops I mean't:

    SCAR Code:
    procedure FindKnife : Boolean;
    begin
      LoadMyDTMs;
      Result := FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)
      if Result then
        writeln('Found Knife in Inventory.')
      else
        Writeln('No Knife, Dont worry... Banking for one');

      FreeMyDTMs;
    end;

    Btw you need a Variable called KnifeInv for that to work ^^

  9. #9
    Join Date
    Feb 2007
    Location
    Estonia.
    Posts
    1,938
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    SCAR Code:
    function FindKnife: Boolean;
    var
      x, y: Integer;
    begin
      LoadMyDTMs;
      if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2) then
      begin
        writeln('Found Knife in Inventory.');
        Result := True;
      end else
      begin
        Writeln('No Knife, Dont worry... Banking for one');
        Result := False;
        Exit;
      end;
      FreeMyDTMs;
    end;
    ~Eerik~
    Edit: Nauma beated me again. :/

  10. #10
    Join Date
    Apr 2009
    Location
    California!
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Whoops I mean't:

    SCAR Code:
    procedure FindKnife : Boolean;
    begin
      LoadMyDTMs;
      Result := FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2)
      if Result then
        writeln('Found Knife in Inventory.')
      else
        Writeln('No Knife, Dont worry... Banking for one');

      FreeMyDTMs;
    end;

    Btw you need a Variable called KnifeInv for that to work ^^
    ooh ty, don't you mean function
    And since FindKnife is a boolean does that mean that i can just call if(FindKnife = True)then, and just delete the Variable called KnifeInv?
    Thank you!!

    Quote Originally Posted by Heavenzeyez1 View Post
    SCAR Code:
    function FindKnife: Boolean;
    var
      x, y: Integer;
    begin
      LoadMyDTMs;
      if FindDTM(KnifeDTM, x, y, mix1, miy1, mix2, miy2) then
      begin
        writeln('Found Knife in Inventory.');
        Result := True;
      end else
      begin
        Writeln('No Knife, Dont worry... Banking for one');
        Result := False;
        Exit;
      end;
      FreeMyDTMs;
    end;
    ~Eerik~
    Edit: Nauma beated me again. :/
    He may have beat you but he forgot to replace the procedure with a function . There are similar errors within the rest of my script.. fixing thanks to both of your help. Thanks sooo much!! Rep++ both of you.
    Last edited by Mystic; 05-10-2009 at 04:41 AM.
    ~Penguin
    Semi-active
    http://i44.tinypic.com/33vk9aq.jpg
    SELL AUTOED GOODS AT MID-MAX! DON'T LET PRICES FALL AND GIVE US LESS PROFIT. (Put this in your sig)

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
  •