Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DYNAMIC GLOBAL VARS INPUT
- print("Place the turtle facing on the edge of the clearing zone, facing west to east.")
- print("Select the number of lines you wish to have mined.")
- lines = tonumber(read())
- print("You selected:", lines)
- os.sleep(2)
- term.clear()
- print("Select the length of lines you wish to have mined.")
- lineLength = tonumber(read())
- print("You selected:", lineLength)
- os.sleep(2)
- term.clear()
- --FIXED GLOBAL VARS
- distance = 0
- lineDist = 1
- orrentation = 0
- function Refuel()
- local fuelLvl = turtle.getFuelLevel()
- turtle.getFuelLevel()
- if turtle.getFuelLevel() then
- turtle.select(1)
- turtle.getItemCount()
- end
- end
- function Turn()
- local leftTurn = turtle.turnLeft()
- local rightTurn = turtle.turnRight()
- if lineDist == lineLength then --LINE PROGRESS CHECK
- lines = lines + 1
- if (lines % 2 == 0) then --LINE VAR EVEN CHECK
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- elseif (lines % 2 ~= 0) then --LINE VAR ODD CHECK
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- end
- lineDist = lineDist - (lineLength - 1) --LINE VAR RESET
- end
- end
- function Dig()
- local attemptForward = turtle.forward()
- for i=0,lineLength do
- turtle.select(1)
- turtle.dig()
- turtle.forward()
- if attemptForward == true then
- distance = distance + 1
- elseif attemptForward == false then
- Dig()
- elseif lineDist == lineLength then
- Turn()
- end
- end
- end
- function Quarry()
- for i=0,lines do
- Refuel()
- Dig()
- end
- end
- function Return()
- end
- Quarry()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement