function GetTileFromXYZ(X, Y, Z: integer): TTile; begin Result := nil; if abs((Self.X - 7) - X) > 14 then Exit; if abs((Self.Y - 5) - Y) > 11 then Exit; if Self.Z <> Z then Exit; Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)]; end;
while not terminated do begin UpdateWorld; Tile := GetTileFromXYZ(X1,Y1,Self.Z); if Tile <> nil then if tile.count > 1 then if Tile.Item[1].Properties.door then if not tile.item[1].properties.walkable then Tile.Item[1].Use; sleep(1000); end;
Wyszukiwarka