Next up on the list of things I can' explain..
Simba Code:
Error: The given DTM Index[0] doesn't exist at line 730
is thrown when executing this:
Simba Code:
function drop(): boolean;
var
t: integer;
pts: tpointarray;
begin
if not isLoggedIn then
exit(false);
if not tabBackpack.open() then
begin
print('Failed to open tab.Backpack.');
exit(false);
end;
if tabBackpack.isEmpty() then
exit(true);
t := getSystemTime + 15000;
while tabBackpack.countDTM(oreDTM) > 0 do
begin
if t < getSystemTime then
begin
print('Timed out while dropping Ore.');
exit(false);
end;
sendKeys(toStr(quickKey), 100+random(500), 100+random(500));
wait(randomRange(3000, 8000));
end;
result := tabBackpack.countDTM(oreDTM) < 1;
end;
line 730 is the resulting line of the following function in wrappers.simba
Simba Code:
function findDTM(dtm: integer; var x, y: integer; searchBox: TBox): boolean; overload;
begin
result := findDTM(dtm, x, y, searchBox.x1, searchBox.y1, searchBox.x2, searchBox.y2);
end;
I've searched the forum and found that other people with a similar error had a "bad" DTM. I've remade this 3 ties now with the same outcome.
I can run other scripts which use the same DTM function with no problem.
Any ideas?