Log in

View Full Version : Error: Exception: The given DTM Index[2] doesn't exist at line 136



Limoncello
03-05-2012, 05:50 PM
EDIT: the issue has been resolved and occured only thanks to my clumzyness. :garfield:

Whenever I try to use DTMs the following pops up after one loop, also opening the simba.simba file:


Error: Exception: The given DTM Index[2] doesn't exist at line 136
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

This confuses me as I've never even used <those> DTMs nor have I included any bitmaps.

Below I give some extracts of the codes:

simba.simba
function GetLetters(Text: string): string;
begin
result := ExtractFromStr(Text,letters);
end;

My SetDTM and ReleaseDTM procedures
procedure SetDTM; //DTM Defining procedure.
begin
DTMTrainer := DTMFromString('mQwAAAHicY2ZgYPgPxEyMDAx/gHQTENdCcYKsLUOGghNDhYoPgwiQD8OMSBgIABQiBik=');
DTMFall := DTMFromString('mQwAAAHicY2ZgYOBjZGDgAWIuIO4A8luBuB OI81qXMeRU9TKkFrUwiAD5MMyIhIEAAPBPBmc=');
DTMBack := DTMFromString('mQwAAAHicY2YAAkYGBmYg/gtkHgXiI0B8GIirVd0Y6tU8wFgEyIdhRiQMBAAIJwZR');
end;
procedure FrDTM; //DTM Freeing procedure.
begin
FreeDTM(DTMTrainer);
FreeDTM(DTMFall);
FreeDTM(DTMBack);
end;

Could anyone offer any insight on this issue?
And the non-loop part of my script:
begin
Smart_Server := 64;
Smart_Members := True;
Smart_Signed := True;

Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
SetDTM; //Set DTM's before code.
MouseSpeed := 18;
step := 'LureRC';
fails := 0; // The vars have been declared at the top, no problems.
stuns := 0;
success :=0;
TimeBegan := GetSystemTime;
ToggleXPBar(True);
StartingXP := (GetXPBarTotal);
repeat
if not FindNormalRandoms then
begin;
MakeCompass('E');
SetAngle(SRL_ANGLE_HIGH);
MainLoop; // This is my code
Antiban;
MiniBreaker;
end;
until AllPlayersInactive;
FrDTM;
end.

Abu
03-05-2012, 06:39 PM
Im getting a very similar issue where it says the DTM[2] was not freed, even though I freed all my DTM's and I didn't even have a DTM[2]....

Limoncello
03-05-2012, 07:28 PM
I've resolved the issue in my case. Turns out I've accidentally freed the DTMs twice (the 2nd freeing process didn't have what to free). After removing the second line the script started running properly!