I've been lurking around the scripting tutorials for some days, and decided to try to make my own script. I have a problem though, i get this DTM error, which i could not find a solution for. Have been searching some around, and found tons of people having the same problem, but strangely no solution (might be me not looking good enough).
Anyway, what error i get is this:
The problem occurs in the below function, in the first FindDTM, between WriteLn('called');, and WriteLn('called2');. It seems that way to me at leastCode:Exception in Script: The given DTM Index[0] doesn't exist The following DTMs were not freed: [1]
Simba Code:function CraftAndExit: boolean;
var
walksDTM, clickDTM, x, y, i: integer;
aFound: extended;
begin
walksDTM := DTMFromString('mrAAAAHic42BgYKhlYmBwgOJJQLwRiMOBOB2INwGxJ1' +
'CNHxDbAXETEHtB6RYgLgXi/EwlBvkofhTcVuvN0FTlCcZyQDW8ODAHEDMSwDAAAC/WDlM=');
wait(700 + random(90));
WriteLn('called');
if FindDTMRotated(walksDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
WriteLn('called2');
mouse(x, y, 1, 1, true);
FFlag(2);
clickDTM := DTMFromString('mlwAAAHicY2dgYOAEYiEg5mGAACYgFgBiPijmhYqB' +
'gBwQqwGxIhAnJsaAcWhQGENQQAhDZFgUQ3x8FENychwDK1AeF2bEg6EAAKs3CG8=');
if FindDTM(clickDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
WriteLn('called3');
InvMouse(2, 1);
wait(30 + random(50));
mouse(x, y, 10, 10, true);
FreeDTM(walksDTM);
FreeDTM(clickDTM);
Result := true;
Exit;
end;
end;
FreeDTM(walksDTM);
FreeDTM(clickDTM);
end;
It would not hurt if i could get some suggestions for improvements in the function otherwise as well. Thanks in advance
EDIT:
Stupid me managed to free 'clickDTM', even in the event it was not called, had to get some help at IRC to realise it![]()




Reply With Quote

