Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function power()
- --place a powered rail
- turtle.down()
- --place a earth block first
- turtle.select(15)
- turtle.placeDown()
- turtle.up()
- turtle.turnRight()
- turtle.forward()
- --place a redstone torch, but first a block
- turtle.select(16)
- turtle.down()
- turtle.placeDown()
- turtle.up()
- turtle.select(7)
- if turtle.getItemCount()== 0 then
- turtle.select(8)
- end
- turtle.placeDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.select(5)
- if turtle.getItemCount()== 0 then
- turtle.select(6)
- end
- turtle.placeDown()
- turtle.placeDown()
- end
- function normal()
- turtle.down()
- turtle.select(16)
- turtle.placeDown()
- turtle.up()
- --inventory checks
- local slot= 1
- turtle.select(1)
- while turtle.getItemCount()== 0 do
- slot= slot +1
- turtle.select(slot)
- end
- turtle.placeDown()
- end
- function pathing()
- path= math.random(1,8)
- --5 and 6 turn, 3 and 7
- if path== 5 then
- turtle.turnLeft()
- turtle.forward()
- elseif path== 6 then
- turtle.turnRight()
- turtle.forward()
- elseif path == 3 or 7 then
- turtle.forward()
- turtle.up()
- elseif path == 2 then
- turtle.forward()
- turtle.down()
- else
- turtle.forward()
- end
- end
- function makePath(size)
- power()
- for i = 1, size do
- if i%6== 0 then
- --every 6 place a powered rail and go straight ahead
- power()
- else
- pathing()
- normal()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement