if (timing > 5) {timing = 0; time.sleep(0.05); if (blockArray == undefined) 
{blockArray = new Array (0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var checkArray = new Array (0, 0, 0, 0, 0, 0);}
var action = 0; if (blockArray [0] + blockArray [1] + blockArray [2] == 0 && hitBlock != null) 
{blockArray [0] = hitBlock.x; blockArray [1] = hitBlock.y; blockArray [2] = hitBlock.z; action = 1;
chat.print("X1: " + blockArray [0] + " Y1: " + blockArray [1] + " Z1: " + blockArray [2]);}
if (action == 0 && blockArray [3] + blockArray [4] + blockArray [5] == 0 && hitBlock != null) 
{blockArray [3] = hitBlock.x; blockArray [4] = hitBlock.y; blockArray [5] = hitBlock.z; action = 1;
chat.print("X2: " + blockArray [3] + " Y2: " + blockArray [4] + " Z2: " + blockArray [5]);}
if (action == 0 && blockArray [0] * blockArray [3] != 0 && checkArray [0] == 0 && hitBlock != null)
{blockArray [6] = blockID; blockArray [7] = blockMD;
var checkArray = new Array (Math.min(blockArray [0],blockArray [3]),Math.min(blockArray [1],blockArray [4]),
Math.min(blockArray [2],blockArray [5]),Math.max(blockArray [0],blockArray [3]),
Math.max(blockArray [1],blockArray [4]),Math.max(blockArray [2],blockArray [5]))
chat.print("Convert to: BlockID: " + blockArray [6] + " BlockMD: " + blockArray [7]); action = 1;}
if (action == 0 && blockArray [0] * blockArray [3] * checkArray [0] != 0)
{if (hitBlock == null) {blockArray [8] = 0; blockArray [9] = 0;} 
else {blockArray [8] = blockID; blockArray [9] = blockMD;}
chat.print("Convert from: BlockID: " + blockArray [8] + " BlockMD: " + blockArray [9]);

for (j = checkArray [0]; j <= checkArray [3]; j += 1)
{for (i = checkArray [1]; i <= checkArray [4]; i += 1)
{for (ii = checkArray [2]; ii <= checkArray [5]; ii += 1)
{if (world.getBlockID(j,i,ii) == blockArray [8] && 
world.getMetadata(j,i,ii) == blockArray [9]) 
{world.setBlockIDAndMetadata(j,i,ii,blockArray [6],blockArray [7]);}}}}
var blockArray = new Array (0, 0, 0, 0, 0, 0, 0, 0, 0, 0); var checkArray = new Array (0, 0, 0, 0, 0, 0);}}