Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local os = require("os")
- local robot = require("robot")
- local term = require("term")
- function doX(x, f)
- i = 0
- while i<x do
- f()
- i = i+1
- end
- end
- function forward()
- while not robot.forward() do
- robot.swing()
- os.sleep(0.2)
- end
- end
- function go()
- forward()
- if not robot.detectDown() then
- robot.placeDown()
- end
- robot.swingUp()
- end
- function doStructure()
- go()
- robot.turnRight()
- go()
- robot.turnLeft()
- robot.turnLeft()
- go()
- go()
- robot.turnRight()
- robot.turnRight()
- go()
- robot.turnLeft()
- end
- --program start
- print("Please make sure to put Cobblestone in first Robot slot")
- print("Count: ")
- count = tonumber(term.read())
- --doX(5, doStructure)
- n = 0
- while n<count do
- doStructure()
- n = n+1
- term.clear()
- print(n)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement