Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- running = false
- sleepTime = 4
- function placeLoader()
- selectedCh = turtle.getSelectedSlot()
- turtle.select(5)
- if turtle.getItemCount() == 0 then
- turtle.select(6)
- turtle.transferTo(5)
- turtle.select(5)
- end
- turtle.placeUp()
- turtle.select(selectedCh)
- end
- function checkOn()
- turtle.turnLeft()
- turtle.turnLeft()
- digIt(3)
- selectedC = turtle.getSelectedSlot()
- turtle.select(14)
- turtle.place()
- turtle.select(13)
- turtle.suck()
- term.clear()
- term.setCursorPos(1,1)
- if turtle.getItemCount() == 0 then
- running = false
- print ("Not Running")
- else
- sleepTime = turtle.getItemCount()
- running = true
- print (sleepTime.."s sleepTime")
- end
- turtle.drop()
- turtle.select(14)
- turtle.dig()
- turtle.select(selectedC)
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function digIt(slotToUse)
- selected = turtle.getSelectedSlot()
- turtle.select(slotToUse)
- repeat
- turtle.dig()
- turtle.dropDown()
- sleep(0.5)
- until turtle.detect() == false
- turtle.select(selected)
- end
- print (sleepTime.."s sleepTime")
- function digItDown(slotToUse)
- selected = turtle.getSelectedSlot()
- turtle.select(slotToUse)
- repeat
- turtle.digDown()
- turtle.dropDown()
- sleep(0.5)
- until turtle.detectDown() == false
- turtle.select(selected)
- end
- function digItUp(slotToUse)
- selected = turtle.getSelectedSlot()
- turtle.select(slotToUse)
- repeat
- turtle.digUp()
- turtle.dropDown()
- sleep(0.5)
- until turtle.detectUp() == false
- turtle.select(selected)
- end
- function refuelIt()
- if turtle.getFuelLevel() <= 16 then
- selectedF = turtle.getSelectedSlot()
- turtle.select(16)
- if turtle.getItemCount() == 0 then
- digItUp(3)
- turtle.select(15)
- turtle.placeUp()
- turtle.select(16)
- turtle.suckUp()
- turtle.select(15)
- turtle.digUp()
- turtle.select(16)
- end
- turtle.refuel(10)
- turtle.select(selectedF)
- end
- end
- function placeIt()
- refuelIt()
- turtle.select(2)
- turtle.turnLeft()
- if turtle.detect() then
- digIt(3)
- end
- turtle.place()
- turtle.turnRight()
- if turtle.detect() then
- digIt(3)
- end
- turtle.forward()
- digItUp(3)
- placeLoader()
- turtle.back()
- turtle.place()
- turtle.turnRight()
- if turtle.detect() then
- digIt(3)
- end
- turtle.place()
- turtle.select(5)
- turtle.digUp()
- turtle.select(1)
- while turtle.up() == false do
- digItUp(3)
- end
- turtle.placeDown()
- turtle.turnLeft()
- end
- function removeIt()
- turtle.digDown()
- turtle.down()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.dig()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- turtle.forward()
- end
- sleep(5)
- checkOn()
- while rs.getInput("top") == false do
- if running == true then
- placeIt()
- sleep(sleepTime)
- removeIt()
- else
- sleep(2)
- end
- checkOn()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement