Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- MJZ LUA Simple Turtle Floor Replacement for Minecraft Computercraft
- -- Arguements and Arg Checking
- local time = os.time()
- local formattedTime = textutils.formatTime(time, true)
- local width
- local length
- term.clear()
- term.setCursorPos(1,1)
- sleep(0.1)
- print("-------------------")
- print("Let's replace dat floor.")
- print("What's the length?")
- length = read()
- print("-------------------")
- print("What's the width? (going to the right side)")
- width = read()
- term.clear()
- term.setCursorPos(1,1)
- write("Replacing Floor ")
- write(length)
- write("x")
- write (width)
- print(".")
- textutils.slowWrite("Turtle started at " .. formattedTime, 100)
- print("-------------------")
- function startpos()
- print("No StartPos Saved")
- end
- function forward()
- turtle.forward()
- end
- function right()
- turtle.turnRight()
- end
- function left()
- turtle.turnLeft()
- end
- function replaceFloor()
- while not turtle.compareDown() do
- turtle.digDown()
- turtle.placeDown()
- write(".")
- end
- end
- function goRow()
- for l = 1, length-1 do
- forward()
- replaceFloor()
- l = l + 1
- end
- end
- function backPos()
- turtle.turnRight()
- turtle.forward()
- end
- -- starting code
- startpos()
- replaceFloor()
- goRow()
- for w = 1, width-1 do
- if width-1 == 0 then
- print("Stopped width")
- elseif (w % 2 == 0) then
- left()
- forward()
- replaceFloor()
- left()
- goRow()
- else
- right()
- forward()
- replaceFloor()
- right()
- goRow()
- end
- w = w + 1
- end
- textutils.slowWrite("Job finished\n", 20)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement