Results 1 to 9 of 9

Thread: TypeMismatch with CountBitmap

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default TypeMismatch with CountBitmap

    Has anyone tried "CountBitmap" ?. It seems like it has a bug or something o_o... OR.. maybe im doing something wrong again X 'D...

    x := CountBitmap(fruit[i],0,0,200,200);

    --> Line 124: [Error] (124:39): Type mismatch in script

    x is integer.

    Code:
    function CountBitmap(Bitmap: Integer; xs, ys, xe, ye: Integer): Integer;
    Counts the number of instances of the entered Bitmap found in the search area.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's not you. It's most likely a bug. Mentioned before.
    http://www.villavu.com/forum/showthread.php?t=47137

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Another bug T_T. I just had one with "FindTransparentBitmap"...

    The Funny thing is, WriteLn(CountBitmap(...)); Works just fine.

    So i might be able to write a workaround, and grab the LastDebugLine, convert it to int, and write it to my var.

    Though thats alot of effort T_T, and i dont know how stable that would be ...

    Thanks for your quick reply.

    ~caused

    //Haha, I'm doing this now :3

    Code:
     WriteLN(CountBitmap(fruit[i],Fieldsize1.x,Fieldsize2.y,Fieldsize2.x,Fieldsize2.y+rowh));
          FieldSizeF.x := FieldSizeF.x + StrToInt(GetDebugLine(GetDebugLineCount-1));
    ..Anyone knows a better solution ?

  4. #4
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try CountItemsIn found in Amount.scar?

  5. #5
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks for the Idea. Though.
    I'm not making a runescape script.
    So I dont want to use SRL :x, its making the compiling so slow : O.. And isnt CountItemsIn not only for runescape ?

    ~caused

  6. #6
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah I think you are right and it's for rs but I taught you are making an rs script, srry.
    But you may get a good idea if you look through that function(and what it uses, and what is uses ...)

  7. #7
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Yeah... Anyways.My way of reading the Debug Window Works quite well XD.. So I'll stick to that =)..

  8. #8
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function CountBitmapEx(Bitmap, xs, ys, xe, ye : integer) : integer;
    begin
      Writeln(CountBitmap(Bitmap, xs, ys, xe, ye));
      result := GetDebugLine(GetDebugLineCount - 1);
      DeleteDebugLine(GetDebugLineCount - 1);
    end;
    ?

  9. #9
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    SCAR Code:
    function CountBitmapEx(Bitmap, xs, ys, xe, ye : integer) : integer;
    begin
      Writeln(CountBitmap(Bitmap, xs, ys, xe, ye));
      result := GetDebugLine(GetDebugLineCount - 1);
      DeleteDebugLine(GetDebugLineCount - 1);
    end;
    ?
    thats how i did it ..

    But now, since freddy is back : D:.. maybe he can fix that =)

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
  •