Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- todo
- -- en funktion som kollar inventory och återvänder när den är full
- local arg = { ... }
- local arglength = tonumber(arg[1])
- local argwidth = tonumber(arg[2])
- local argdepth = tonumber(arg[3])
- local length = 0
- local width = 0
- local depth = 0
- local direction = "forward"
- function Flenght()
- length = 0
- while length < arglength do
- turtle.digDown()
- if length < arglength -1 then
- turtle.dig()
- turtle.forward()
- end
- length = length + 1
- end
- end
- function Fwidth()
- width = 0
- while width < argwidth do
- Flenght()
- if width < argwidth - 1 then
- if direction == "forward" then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- direction = "backward"
- elseif direction == "backward" then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- direction = "forward"
- end
- end
- width = width + 1
- end
- end
- while depth < argdepth do
- Fwidth()
- turtle.turnRight()
- turtle.turnRight()
- turtle.down()
- depth = depth + 1
- end
Add Comment
Please, Sign In to add comment