Results 1 to 2 of 2

Thread: Type Mismatch Help

  1. #1
    Join Date
    Jul 2008
    Posts
    49
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type Mismatch Help

    This is My banking procedure for My woodcut and banking script i get this:

    Line 26: [Error] (16232:59): Type mismatch in script J:\Home\Program Files\SCAR 3.15\Scripts\HalfWay There\Banking.scar

    YewsToDeposit := CountItemsIn( 'inv','bmp', YewLogs , 10 );

    Thet is line 26.


    SCAR Code:
    program Banking;
    {.include SRL\SRL.Scar}

    procedure OpenDaBank;
    var banktime, YewLogs, YewsToDeposit: Integer;
    begin
        YewLogs := BitmapFromString(35, 30, 'beNrtlr1Lw1AUxfuQ1iY6O' +
         'QsGXAqiNWDwqwoWoQ5dunQRREFEECfBQRAE8f/2xFNub3OT5wuareFMTXJ+9/' +
         'OlrdbyMpdbVFOI/nY763UGu6vDtDvKogZYTvwnZ/H4OIII2k+SPxSkKHhOL2I' +
         'gtOqDch+ECiFmRC7BI2wYAmFVH+RGOxE03ouuL9coayu35C5BWxsrwW1ykzT+' +
         'ej6Hbq/WLUsjtAhC1sFJOVII0iwRf9cSECl1QaieZll/ETJF++qkUw7yiFVlO' +
         'hiYsLWdja6AIPTL78/14XzmI5p0+pttL8tx6SAPRQZDEBRf5DbJ5pbh3LDXhe' +
         '18+9JcesK5VtZW1kr6qCMxrHx3Ph5P3+6PXu8O+SIpErNF2IG3VTWz4aYH8ef' +
         'T4P3hREBc28IhY1OwM+8HcUkBQlKzTf8pna6eR1VzYkEwBIjVYzp2JH5FBIJQ' +
         'OgHJKeQHhSxvAZS3I40BQvVebrKQjEonn7PNM7/ilJgd2hwATHvpNnlaDxW+W' +
         'dWH3sJj+nywkYu/ddaqOh3UA/OPBZdX6l/wD3QO+TAJpcr/X/6BkIIsmvEvaV' +
         'xj/qWNW17q+gb53kIg');
      MarkTime(banktime); //Sarts Timer
      repeat;
        if (not(Loggedin)) then  break; //Failsafe
        OpenBankQuiet('eb'); // Opens Edgeville Bank
      until(BankScreen or (TimeFromMark(banktime) > 120000)); // if it took longer then 2 minutis then it will stop trying to open the bank.
      if BankScreen then
      begin
        Writeln('Bankscreen Open');
        YewsToDeposit := CountItemsIn( 'inv','bmp', YewLogs , 10 );
        Deposit(2,28,2);
        CloseBank;
        Writeln('You have deposited' +IntToStr(YewsToDeposit) + 'Yew Logs');
        end;
    end;





    Begin
    SetupSRL;
    OpenDaBank;
    End.

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    The last parameter of CountItemsIn is a TIntegerArray. This allows for the fact that dtms, bmps, colours and bmp masks need different tolerance methods. (ie. dtms don't have tolerance, colour and bmps need just colour tolerance and bmp masks need colour tolerance and contour tolerance.

    So for your example:
    SCAR Code:
    YewsToDeposit := CountItemsIn( 'inv','bmp', YewLogs , [10]);

    The square brackets defines the 10 as part of an integer array rather than just a single integer.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type Mismatch...
    By Raskolnikov in forum OSR Help
    Replies: 3
    Last Post: 10-18-2008, 05:56 AM
  2. Type mismatch
    By batnas in forum OSR Help
    Replies: 3
    Last Post: 04-24-2008, 06:48 PM
  3. Type Mismatch..
    By Nava2 in forum OSR Help
    Replies: 1
    Last Post: 04-23-2008, 07:44 PM
  4. Type mismatch Help
    By Ashur2Good in forum OSR Help
    Replies: 2
    Last Post: 05-23-2007, 03:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •