Log in

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



ABC!
06-09-2012, 09:04 AM
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/IRAbMDIwaACxGhAbArElEFsAcUC0JoNPuDqDV7gsg1KUCENArD yDo7cSw38G7IARB4YAALWuCtA=');
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
06-09-2012, 10:30 AM
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!
06-09-2012, 10:44 AM
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
06-09-2012, 10:51 AM
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.