Results 1 to 8 of 8

Thread: ATPA/Smart Image help

  1. #1
    Join Date
    Oct 2014
    Location
    With ezreal~
    Posts
    295
    Mentioned
    45 Post(s)
    Quoted
    255 Post(s)

    Default ATPA/Smart Image help

    Been putting it off long enough... HOW ON EARTH DO I SOLVE MY PROBLEM. I have tried re-installing simba, force updating just about everything, etc.

    I just can't seem to get things to work. I've tried to follow both Camel's tutorial and The Mayor's tutorial, but I always end up with this:



    The debug box reads

    Code:
    Error: Access violation at line 113
    Execution failed.
    The following bitmaps were not freed: [Minimap Mask]
    File[C:\Simba\Includes\SRL-6/logs/SRL log (05-02-15 at 02.10.03 PM).txt] has not been freed in the script, freeing it now.
    and the drawing tab opens up.

    I haven't seen other users on the forums have problems like this... so what do?

    Simba Code:
    program new;
    {$Define SMART}
    {$I SRL-6/SRL.Simba}
    // Scenario 1
    procedure HandleDoor()
    var
      x,y : Integer;
      TPA : TPointArray;
      ATPA : T2DPointArray;
    begin
      findColorsSpiralTolerance(x, y, TPA, 3230561, mainScreen.getBounds(), 6, colorSetting(2, 0.12, 0.91));
      if (Length(TPA) < 1) then
      begin
        Exit;
      end;

      // The door is about that size
      ATPA := TPA.toATPA(20, 40);
      ATPA.sortFromMidPoint(Mainscreen.playerPoint); // Sort found colors

      SmartImage.debugATPA(ATPA);

    end;

    begin
    setupSrl();
    HandleDoor();
    end.

    This was the code I was trying to run.



    It's not gay if it's efficient.

  2. #2
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    You'll probably see what type of box you're trying to draw. put a Writeln(Box) in the drawing function and see what it's crashing trying to draw.

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    The box you are trying to draw is out of bounds or contains a point or corner that is out of bounds. You can try using drawClippedBox and see what it draws.
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Jun 2014
    Location
    Oklahoma
    Posts
    336
    Mentioned
    22 Post(s)
    Quoted
    231 Post(s)

    Default

    The colors are likely outdated. They were collected poorly in the first place. Regrab them and try it again.

    That should make that snippet work assuming its from my tutorial

  5. #5
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    Quote Originally Posted by Camel View Post
    The colors are likely outdated. They were collected poorly in the first place. Regrab them and try it again.

    That should make that snippet work assuming its from my tutorial
    that doesnt really matter here since hes exiting the procedure when the length of the tpa < 1

  6. #6
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Judging from the error-message received your SmartImage is not initalized (it's nil).
    Code:
    Error: Access violation at line 113
    Execution failed.
    The following bitmaps were not freed: [Minimap Mask]
    As you see, there isn't any `SMART Debug Image` in that list of unfreed bitmaps, so it was never initialized.

    So what we have to do to solve this issue is to tell SRL that we want to draw on smart:
    Simba Code:
    program new;
    {$define SMART}
    {$I SRL-6/SRL.Simba}

    // Scenario 1
    procedure HandleDoor()
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      FindColorsTolerance(TPA, 3230561, Mainscreen.GetBounds(), 6, ColorSetting(2, 0.12, 0.91));
      if (Length(TPA) < 1) then
      begin
        Exit;
      end;

      // The door is about that size
      ATPA := TPA.ToATPA(20, 40);
      ATPA.SortFromMidPoint(Mainscreen.playerPoint); // Sort found colors

      SmartImage.DebugATPA(ATPA);
    end;

    begin
      SmartEnableDrawing := True;  //hey SRL I am gonna draw on smart, so initialize SmartImage for me!
      SetupSrl();
      HandleDoor();
    end.

    Hope this helps
    Last edited by slacky; 02-06-2015 at 01:59 AM.
    !No priv. messages please

  7. #7
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

  8. #8
    Join Date
    Oct 2014
    Location
    With ezreal~
    Posts
    295
    Mentioned
    45 Post(s)
    Quoted
    255 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Judging from the error-message received your SmartImage is not initalized (it's nil).
    Code:
    Error: Access violation at line 113
    Execution failed.
    The following bitmaps were not freed: [Minimap Mask]
    As you see, there isn't any `SMART Debug Image` in that list of unfreed bitmaps, so it was never initialized.

    So what we have to do to solve this issue is to tell SRL that we want to draw on smart:
    Simba Code:
    program new;
    {$define SMART}
    {$I SRL-6/SRL.Simba}

    // Scenario 1
    procedure HandleDoor()
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      FindColorsTolerance(TPA, 3230561, Mainscreen.GetBounds(), 6, ColorSetting(2, 0.12, 0.91));
      if (Length(TPA) < 1) then
      begin
        Exit;
      end;

      // The door is about that size
      ATPA := TPA.ToATPA(20, 40);
      ATPA.SortFromMidPoint(Mainscreen.playerPoint); // Sort found colors

      SmartImage.DebugATPA(ATPA);
    end;

    begin
      SmartEnableDrawing := True;  //hey SRL I am gonna draw on smart, so initialize SmartImage for me!
      SetupSrl();
      HandleDoor();
    end.

    Hope this helps
    Quote Originally Posted by The Mayor View Post
    That means you never set smartEnableDrawing to true at the start of your script.
    Didn't even know I needed to do that O.O

    Thanks guys!

    And a big thanks to everyone else who attempted to help :3



    It's not gay if it's efficient.

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
  •