Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 3 wide Bridge v1.0 by SparkVGX
- --Var
- continue = true
- lane = 1
- distance = 0
- tLeft = false
- blocksPlaced = 0
- Fuel = 1
- function bForward()
- if turtle.detect() == true then
- turtle.dig()
- turtle.forward()
- end
- else
- turtle.forward()
- end
- end
- function checkFuel()
- if turtle.getFuelLevel() <= 5 then
- turtle.select(1) --fuel goes in this slot
- turtle.refuel(1)
- end
- end
- function selectBlock()
- for sBlock=2,13 do
- if turtle.getItemCount(sBlock)~=0 then
- turtle.select(sBlock)
- break
- end
- end
- end
- --Place down
- function pDown()
- selectBlock()
- if turtle.detectDown() == false then
- if turtle.placeDown() == false then
- print("Need blocks")
- sleep(5)
- pDown()
- end
- blocksPlaced = blocksPlaced + 1
- print(blocksPlaced)
- end
- end
- function turn()
- if tLeft then
- turtle.turnLeft()
- bForward()
- turtle.turnLeft()
- end
- if tLeft == false then
- turtle.turnRight()
- bForward()
- turtle.turnRight()
- end
- tLeft = not tLeft
- end
- function Lane()
- if lane == 1 then
- while turtle.detect() == false do
- pDown()
- checkFuel()
- turtle.forward()
- distance = distance + 1
- lane = lane + 1
- end
- end
- if lane ~= 1 then
- for i=1,distance do
- pDown()
- checkFuel()
- bForward()
- pDown()
- end
- end
- end
- function goHome()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- for i=1,distance do
- turtle.forward()
- end
- end
- Lane()
- turn()
- Lane()
- turn()
- Lane()
- goHome()
Advertisement
Add Comment
Please, Sign In to add comment