Log in

View Full Version : Setting DTM's but when going to use Error.



Mat
05-12-2012, 06:25 PM
Error: Exception: The given DTM Index[296] doesn't exist at line 242

Not a clue why, could it be tripping up on the calling?
Mat

masterBB
05-12-2012, 06:29 PM
I need some code, probably the dtm couldn't be found in the memory.

Mat
05-12-2012, 06:36 PM
I need some code, probably the dtm couldn't be found in the memory.
I have like 20DTM's and I'm Pushing each one in to one function:

PrayerPot :=DTMFromString('mlwAAAHicY2dgYJjKxMAwH4h7gXguEE8D 4glA3APEwowQLALEPEAsDsRiQCwAxNYHJwB1M2HFGgy4ASMeDA UAA/AGdw==');
Function DTMMouseInv(DTM:Integer; Item:String):Boolean;
Var
pX,pY:integer;
begin
Ftab(25);
If FindDTM(DTM,pX,pY,MiX1,MiY1,MiX2,MiY2)then
begin
DTMMouseInv(PrayerPot,'PrayerPot');
:/
E:
It works in my Banking Function, im not freeing it either, but it doesn't work in the inv function :/

Runaway
05-12-2012, 07:12 PM
Where/how are you declaring it before using it in DTMMouseInv()?

Mat
05-12-2012, 07:13 PM
Where/how are you declaring it before using it in DTMMouseInv()?
I am Declaring all of them right at the start, the thing is It runs in my Banking Function No DTMFreeing in there, but all the other pots SuperStr etc work but only prayer pot fails, I have no idea why.
:/
Thanks
Mat

Mat
05-12-2012, 07:21 PM
Error: Exception: The given DTM Index[295] doesn't exist at line 1073
The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 'Prayerpot', 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, SRL - Lamp bitmap, 18]
Wtf?
Its there but its erroring?
WTF?

Runaway
05-12-2012, 07:28 PM
Error: Exception: The given DTM Index[295] doesn't exist at line 1073
The following DTMs were not freed: [0, 1, 2, 3, 4, 5, 'Prayerpot', 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, SRL - Lamp bitmap, 18]

Hmm... It looks like that could be the problem right there. If PrayerPot was declared properly, it would be listed as #6 in the DTM array...

Do a Ctrl+F for 'Prayerpot' and double check everything that comes up?

Mat
05-12-2012, 07:31 PM
Hmm... It looks like that could be the problem right there. If PrayerPot was declared properly, it would be listed as #6 in the DTM array...

Do a Ctrl+F for 'Prayerpot' and double check everything that comes up?
I have it called EpicPrayer and it find it for the BankingFunction, but for the Invent Function can i get it to work?
DTMMouseInv(EpicPrayer ,'Prayer Pot');
DTMMouseBank(EpicPrayer);
?

Sin
05-12-2012, 07:32 PM
I had this exactly problem on my frost dragon er
Once I finish up here and I get home I'll post yjr solution
Its horrible typing on this bphonr lull.

Mat
05-12-2012, 07:35 PM
Only way I got it to work is having one for each function, the only thing that is stopping my FDK I'm like how the?
:/
Mat

Abu
05-13-2012, 08:58 PM
My guess is that your freeing them but not reloading them.

For example this will not work:
begin
loadDTMs
repeat
Mainloop;
FreeDTMs;
until not LoggedIn;
end.

But this will:
begin
repeat
loadDTMs;
Mainloop;
FreeDTMs;
until not LoggedIn;
end.

Brandon
05-13-2012, 09:35 PM
Memory leak.. You keep loading and loading on the same variable thus u get that multiple indices not freed..


{$I SRL/SRL.Simba}

var
GlobalDTM: Integer;

procedure LoadAllDTMs;
begin
GlobalDTM:= DTMFromString('Some Random Base64Code Here');
end;

Procedure FreeAllDTMs;
begin
FreeDTM(GlobalDTM);
end;


Function DTMMouseBox(Item: Integer; Uptexts: TStringArray; Box: TBox): Boolean;
var
X, Y: Integer;
begin
Result:= False;
If FindDTM(Item, X, Y, Box.X1, Box.Y1, Box.X2, Box.Y2) then
begin
MMouse(X, Y, 5, 5);
Result:= IsUptextMultiCustom(Uptexts);
if Result then
ClickMouse2(MOUSE_LEFT);
end;
end;

begin
SetupSRL;
LoadAllDTMs;
AddOnTerminate('FreeAllDTMs');

DTMMouseBox(GlobalDTM, [''], MSBox);
DTMMouseBox(GlobalDTM, [''], MIBox);
end.