Results 1 to 5 of 5

Thread: My canvas is messing up...

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

    Default My canvas is messing up...

    So, I was bored the other day, and I decided to make a very useless script that takes a picture of the minimap, waits a while, takes another picture of the minimap, then blacks out any matching pixels.

    That script didn't work like it should have, so I tried remaking it. Still didn't work.

    Today, I decided to remake it again. Still not working

    I was hoping someone could look through and see why:

    When you try using one of the Pixel matching setups, it gives you an access violation error, and why, with either one of the setups, it turns the DI black? (It's not turning it black because the pixels don't match. Try filling in "0" with a different color.)

    Thank you!

    -Jason

  2. #2
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    are you sure the bitmaps are loaded into memory?

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

    Default

    Yes. Up in the procedure: Setup, I declare the coords, canvases, bitmaps, and I display the debug window.

  4. #4
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Try please

    SCAR Code:
    program New;

    var
      MapCan1, MapCan2, MapCan3: TCanvas;
      MapBmp1, MapBmp2, MapBmp3: Integer;
      MX1, MY1, MX2, MY2, x, y: Integer;

    procedure Setup;
    begin
      MX1 := 520;
      MY1 := 0;
      MX2 := 765;
      MY2 := 175;
      MapBmp1 := BitmapFromString(245, 175, ' ');
      MapBmp2 := BitmapFromString(245, 175, ' ');
      MapBmp3 := BitmapFromString(245, 175, ' ');
    end;

    procedure GetMapCans;
    begin
      CopyClientToBitmap(MapBmp1, MMX1, MMY1, MMX2, MMY2);
      MapCan1 := GetBitmapCanvas(MapBmp1);
      Wait(2000);
      CopyClientToBitmap(MapBmp2, MMX1, MMY1, MMX2, MMY2);
      MapCan2 := GetBitmapCanvas(MapBmp2);
      Wait(2000);
    end;

    procedure TakeOutMatches;
    begin
      MapCan3 := MapCan1;
      for x := 0 to 245 do
        for y := 0 to 175 do
        begin
          if (MapCan1.Pixels[x, y] <> MapCan2.Pixels[x, y]) then
          MapCan3.Pixels[x, y] := 255;
        end;
      DisplayDebugImgWindow(245, 175);
      CopyCanvas(MapCan3, GetDebugCanvas, 0, 0, 245, 175, 0, 0, 245, 175);
    end;

    begin
      Setup;
      GetMapCans;
      TakeOutMatches;
    end.
    Hup Holland Hup!

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

    Default

    *Gasp*

    It works!

    I'm just getting done editing it into mine, but it's gonna work!

    Thank you so much, Nielsie

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Jagex messing with me
    By alberttai in forum News and General
    Replies: 14
    Last Post: 06-12-2008, 01:41 PM
  2. Script messing up..
    By faster789 in forum OSR Help
    Replies: 5
    Last Post: 04-26-2008, 12:30 PM
  3. Messing up =[
    By siroober in forum News and General
    Replies: 12
    Last Post: 02-16-2008, 08:06 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
  •