Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local dis = tonumber(tArgs[1])
- g = 1
- st = 5
- -- Functions
- function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function placedown(item)
- turtle.detect()
- if (turtle.detectDown() == true) then
- turtle.digDown()
- end
- turtle.select(item)
- turtle.placeDown()
- end
- function placefront(item)
- turtle.detect()
- if (turtle.detect() == true) then
- turtle.dig()
- end
- turtle.select(item)
- turtle.place()
- end
- function placerow()
- placefront(st)
- placedown(gr)
- turnaround()
- turtle.forward()
- placedown(gr)
- turtle.forward()
- placedown(gr)
- placefront(st)
- turnaround()
- turtle.forward()
- turtle.turnRight()
- end
- -- Main Script
- local repeat = true
- write( [[This code is looped.
- Press Enter to terminate code. OK?")
- input = read()
- if input == "OK" then
- while repeat == true do
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- placerow()
- ev,k=os.pullEvent()
- if ev=="key"then
- if k == 28 then
- repeat = false
- end
- print("Code Terminated.")
- end
Advertisement
Add Comment
Please, Sign In to add comment