Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("This program will turf down what is in front of it and make a script to build it")
- print("What do you want to call the new script?")
- fName = read()
- file = fs.open(fName, "w")
- print("How far in front of the turtle does the structure go?")
- x = read()
- print("How far up of the turtle does the structure go?")
- y = read()
- print("How far to the right of the turtle does the structure go?")
- z = read()
- blockData = {}
- turtle.select(1)
- for xi=1,x do
- turtle.forward()
- turtle.turnRight()
- for yi=1,y do
- for zi=1,z do
- blockData[xi] = {}
- blockData[xi][yi] = {}
- if turtle.detect() then
- blockData[xi][yi][zi] = true
- else
- blockData[xi][yi][zi] = false
- end
- turtle.dig()
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- for iz=1,z do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.up()
- end
- for iy=1,y do
- turtle.down()
- end
- turtle.turnLeft()
- end
- turtle.turnRight()
- turtle.turnRight()
- for ix=1,x do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- -- now to use the table to make the script
- --turtle.up()
- for yi=1,y do
- for xi=1,x do
- turtle.forward()
- turtle.turnRight()
- for yi=1,y do
- turtle.up()
- for zi=1,z do
- if blockData[xi] ~= nil then
- if blockData[xi][yi] ~= nil then
- if blockData[xi][yi][zi] == true then
- while turtle.getItemCount() == 0 do
- if turtle.getSelectedSlot() == 16 then
- turtle.select(1)
- else
- turtle.select(turtle.getSelectedSlot())
- end
- end
- turtle.placeDown()
- end
- end
- end
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- for iz=1,z do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- --turtle.up()
- end
- for iy=1,y do
- turtle.down()
- end
- turtle.turnLeft()
- end
- turtle.turnRight()
- turtle.turnRight()
- for ix=1,x do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement