SRL Archive - Help

Setting DTM's but when going to use Error.


Mat

2012-05-12 14:25:05

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

2012-05-12 14:29:19

I need some code, probably the dtm couldn't be found in the memory.

Mat

2012-05-12 14:36:02

From: masterBB
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('mlwAAAHicY2dgYJjKxMAwH4h7gXguEE8D4glA3APEwowQLALEPEAsDsRiQCwAxNYHJwB1M2HFGgy4ASMeDAUAA/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

2012-05-12 15:12:06

Where/how are you declaring it before using it in DTMMouseInv()?

Mat

2012-05-12 15:13:31

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

2012-05-12 15:21:05

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

2012-05-12 15:28:49

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

2012-05-12 15:31:28

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

2012-05-12 15:32:09

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

2012-05-12 15:35:18

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

2012-05-13 16:58:24

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

2012-05-13 17:35:35

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.