Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- ** Simple StripMine BETA**
- ** Written by: TheSwiftVlogger **
- Warning: Bugs and errors are still occurring
- *CHANGE LOG*
- version 0.0.1:
- - System booting intro added
- - added fuel check
- version 0.1.0
- - Bug fixes
- - added sand/gravel protection
- version 0.1.10
- - Complete re-written and restructured code
- Current bugs
- - torches not placing
- ]]--
- local sd = "Place fuel in slot 1, torches in slot 2"
- local ss = "Welcome, booting system, please hold.."
- local ld = "Loading required drivers"
- local cf = "Checking fuel levels."
- local fr = "Fuel remaining: "
- local gf = turtle.getFuelLevel()
- local pe = "press <Enter> to continue"
- function intro() --simple cosmetic intro
- term.clear()
- term.setCursorPos(1, 1)
- print(sd)
- sleep(1)
- term.setCursorPos(5, 7)
- print(pe)
- x = read()
- term.clear()
- term.setCursorPos(1, 1)
- print(ss)
- sleep(3)
- term.setCursorPos(1, 2)
- print(cf)
- sleep(1.2)
- term.setCursorPos(1, 3)
- print(fr.." "..gf)
- sleep(1)
- term.setCursorPos(5, 7)
- print(pe)
- x = read()
- term.clear()
- term.setCursorPos(1, 1)
- end
- local ac = "How Long to mine? " -- not function yet*
- function input()
- --for future plans*
- end
- function cFuel() --check fuel level, if below 30 will automatically refuel
- if turtle.getFuelLevel() < 29 then
- turtle.refuel(1)
- elseif turtle.getFuelLevel() > 30 then
- write("Fuel is over 30, no need to refuel")
- sleep(1.6)
- term.clear()
- end
- end
- function mine() --the function for mining, to 100 block long strips. with sand/gravel protection
- if turtle.detect() then
- turtle.dig()
- sleep(.5)
- end
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- end
- intro()
- cFuel()
- input() --nothing yet
- --script starts here
- while true do
- if i%6 == 0 then -- problem is here
- turtle.select(2)
- turtle.placeDown()
- turtle.select(1)
- end
- for i = 1, 100 do
- mine()
- end
- turtle.turnRight() --turns right to start a new strip, leaves 2 rows then mines.
- for i = 1, 3 do
- if turtle.detect() then
- turtle.dig()
- sleep(.5)
- end
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- end
- turtle.turnRight()
- for i = 1, 100 do --mines for another 100 blocks
- mine()
- end
- turtle.turnLeft() -- turns left to mine a new column (zig-zag look)
- for i = 1, 3 do
- if turtle.detect() then
- turtle.dig()
- sleep(.5)
- end
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- end
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment