SRL Archive - RS3 Help

ATPA/Smart Image help


Taric

2015-02-05 15:16:49

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

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?

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.

Olly

2015-02-05 15:38:57

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.

Brandon

2015-02-05 15:40:13

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.

Camel

2015-02-05 16:27:11

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

Hoodz

2015-02-05 16:49:48

From: Camel
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

slacky

2015-02-05 20:50:48

Judging from the error-message received your SmartImage is not initalized (it's nil).

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:

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 :)

The Mayor

2015-02-05 21:03:00

That means you never set smartEnableDrawing to true at the start of your script.

Taric

2015-02-05 21:21:36

From: slacky
Judging from the error-message received your SmartImage is not initalized (it's nil).

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:

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 :)


From: The Mayor
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