2 posts
Posted 02 March 2013 - 09:38 AM
First I want to know how to make a simple Stripmine which digs 2 blocks high and 1 block thick.
Like if you type in the turtle:
turtle.dig()
turtle.forward()
turtle.digUp()
And this for 50blocks.
Second question: Can I clear a floppy?
If yes. How can i clear it?
8543 posts
Posted 02 March 2013 - 10:55 AM
Split into new topic.
for i = 1, 50 do
turtle.dig()
turtle.forward()
turtle.digUp()
end
Delete the contents of the floppy and clear its label.
2 posts
Posted 02 March 2013 - 11:19 AM
But how do I delete the contents?
1190 posts
Location
RHIT
Posted 02 March 2013 - 11:25 AM
But how do I delete the contents?
From the shell, type "cd /disk" to navigate to the disk directory. Type "ls" to see all the files, and type "rm [program]" to remove programs you want. Type label to see all arguments (including a way to unlabel a disk).
In a program, an easy way to delete the entire contents of a directory would be to do something like the following:
for i,v in pairs(fs.list("/disk")) do
fs.delete(fs.combine("/disk/", v))
end
8543 posts
Posted 02 March 2013 - 11:26 AM
Manually, you can use the delete program (or its alias rm); automatically, you could use fs.list and fs.delete:
for _, file in pairs(fs.list("/disk")) do
fs.delete("/disk/"..file)
end