Phran6
2012-05-11 15:20:38
program DiamonDash;
{$i srl/srl.simba}
var
Box : array of array of tbox;
Procedure mq;
var
DeskDTM,x,y,i,j : Integer;
begin
DeskDTM := DTMFromString('mbQAAAHicY2VgYPgFxZ1MEHyQkYFhF5CvyATBIHYjUMySk5FBl42BQY2dicGOm5lBk5+VARtgxILBAABk8wdB');
FindDTM(DeskDTM,x,y,0,0,1365,767);
// x-> 399; y-> 359 ; 10 carré en x et 9 carré en y
for i := 0 to 9 do
for j := 0 to 8 do
begin
Box[i][j] := IntToBox((x+(i*40)),(y+(j*40)),(x+((i+1)*40)),(y+((j+1)*40)));
end;
MMouse((Box[1][1].x1+Box[1][1].x2)/2,(Box[1][1].y1+Box[1][1].y2)/2,0,0);
FreeDTM(DeskDTM);
end;
begin
SetupSRL();
ClearDebug();
mq;
end. Im trying to do a script for the game diamond dash and i get the error :Error: Out Of Range at line 18 and the line is
Box[i][j] := IntToBox((x+(i*40)),(y+(j*40)),(x+((i+1)*40)),(y+((j+1)*40)));the dtm find the top left of the game and i want the tbox of each square
any idea ?