Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sleeptime = 60 -- 35 minutes
- local pasteID = "http://pastebin.com/raw.php?i=6EvtyJZx"
- debug = true
- pasteContent = http.get(pasteID)
- Paste = pasteContent.readAll()
- pasteContent.close()
- function update()
- file = fs.open("startup","r")
- contents = file.readAll()
- file.close()
- if (Paste ~= contents) then
- print("Updating program...")
- shell.run("delete","startup")
- wFile = fs.open("startup","w")
- wFile.write(Paste)
- wFile.close()
- sleep(1)
- os.reboot()
- end
- end
- function checkFuel()
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 20 then
- for i = 1, 16 do
- turtle.select( i )
- turtle.refuel()
- end
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 20 then
- print("I need food.")
- sleep(15)
- os.reboot()
- end
- else
- for i = 1, 16 do
- turtle.select( i )
- turtle.refuel()
- end
- print("My fuel level is well within boundary at "..turtle.getFuelLevel())
- end
- end
- function checkBlock()
- local success, data = turtle.inspect()
- if success then
- if (data.name == "minecraft:reeds") then
- print(data.name)
- print("Found some reeds..")
- turtle.dig()
- turtle.forward()
- end
- else
- turtle.forward()
- end
- end
- update()
- checkFuel()
- checkBlock()
- checkBlock()
- checkBlock()
- checkBlock()
- checkBlock()
- turtle.turnRight()
- turtle.turnRight()
- checkBlock()
- checkBlock()
- checkBlock()
- checkBlock()
- checkBlock()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dropDown()
- if (debug == false) then
- sleep(sleeptime)
- else
- sleep(10)
- print("40 seconds remaining")
- sleep(10)
- print("30 seconds remaining")
- sleep(10)
- print("20 seconds remaining")
- sleep(10)
- print("10 seconds remaining")
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement