Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Auto floor maker")
- print("KleebCo Inc")
- print("Before hitting enter put")
- print("some floor materials in me")
- print()
- write("Dimensions:")
- local slot=1
- turtle.select(slot)
- local text=read()
- local x
- local y
- x,y=string.match(text,"(%d+) (%d+)")
- x=tonumber(x)
- y=tonumber(y)
- local myX=0
- local myY=0
- print("Starting x:"..x.." y:"..y)
- local turnFunc
- turnFunc=turtle.turnRight
- function layBrick()
- turtle.placeDown()
- if turtle.getItemCount(slot) == 0 then
- slot=slot+1
- turtle.select(slot)
- end
- end
- while myY < y do
- turnFunc()
- if turnFunc == turtle.turnRight then
- turnFunc = turtle.turnLeft
- else
- turnFunc = turtle.turnRight
- end
- while myX < x do
- layBrick()
- myX = myX + 1
- if myX < x then
- turtle.forward()
- else
- turnFunc()
- end
- end
- myY = myY + 1
- if myY < y then
- turtle.forward()
- myX = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment