Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Computercraft turtle program to place landmarks for a BC quarry
- -- Author: lpenap
- -- It will asume fuel is in slot 1 and landmarks in slot 2
- -- This is just a test, it has not reached minimum quality.
- -- It may not work as expected...
- local SIDE=60
- local function doRefuel(moves)
- while (turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < moves) do
- turtle.select(1)
- turtle.refuel(1)
- end
- end
- local function moveForward()
- while (not turtle.forward()) do
- if (turtle.detect()) then
- turtle.dig()
- else
- turtle.attack()
- os.sleep(1)
- end
- end
- end
- local function placeNextLandmark(placeMark)
- doRefuel(SIDE+2)
- for i=1,SIDE do
- moveForward()
- end
- turtle.select(2)
- if (placeMark) then
- if (turtle.detect()) then
- turtle.dig()
- end
- turtle.place()
- end
- turtle.turnLeft()
- end
- local function placeLandmarks()
- doRefuel(SIDE+2)
- moveForward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(2)
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- placeNextLandmark(true)
- placeNextLandmark(false)
- placeNextLandmark(true)
- placeNextLandmark(false)
- end
- placeLandmarks()
Advertisement
Add Comment
Please, Sign In to add comment