SRL Archive - Help

The Following DTM's Were not freed: [2] ERROR


ABC!

2012-06-09 05:04:28

So I am making my first script and am using DTM's to walk to the bank, but as soons as it starts the WalkToBank Procedure it exectues and I get the error message:

The Following DTM's Were not freed: [2]

Any help, greatly appreciated!

Procedure WalkToBank;

var
AreaOne,x,y : Integer;

begin
FindNormalRandoms
If (InvFull) then
begin
AreaOne := DTMFromString('mggAAAHicY2NgYNjAysCwGIh3AfEeVgh/IRAbMDIwaACxGhAbArElEFsAcUC0JoNPuDqDV7gsg1KUCENArDyDo7cSw38G7IARB4YAALWuCtA=');
if FindDTM(AreaOne,x, y, 1, 1, 200, 200) then
begin
Mouse(x, y, 0, 0, true);
writeln('Currently: Walking To Bank - Phase 1!');
end;
end;
end;

riwu

2012-06-09 06:30:32

u r just using DTM, DDTM is slightly more complex.

U mean it compiles fine but script is terminated as soon as it reaches the procedure? There is no TerminateScript command in this procedure so if ur script is terminated it must be from previous procedures.

You didnt free ur DTM at the end of the procedure so u will get the error when script is terminated.

ABC!

2012-06-09 06:44:47

From: riwu
u r just using DTM, DDTM is slightly more complex.

U mean it compiles fine but script is terminated as soon as it reaches the procedure? There is no TerminateScript command in this procedure so if ur script is terminated it must be from previous procedures.

You didnt free ur DTM at the end of the procedure so u will get the error when script is terminated.


How do I free the DTM?

And yes it compiles fine,runs everything okay, then when it goes to start walking it executes.

riwu

2012-06-09 06:51:36

What do u mean it "executes"? Terminates?
Add FreeDTM(AreaOne); to after ur "if () then begin… end" statement.

Also u shd probably use FindDTMRotated for walking unless the compass is perfectly north all the while.