Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version =
- 7.0
- --Czech title:
- -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
- -- local code je treba zmenit dle potreby
- --(c) ScherryCZ - Author contact: scherry@email.cz
- ------------------------------------------------------------------------------------------------
- --TEST UPDATE
- ------------------------------------------------------------------------------------------------
- local code = "5pL2GBwT"
- --check version
- term.clear()
- term.setCursorPos(1,1)
- print("Program loading...")
- print("Current version: "..version)
- local updateSite= http.get("http://pastebin.com/raw.php?i="..code)
- updateSite.readLine()
- local newVersion = updateSite.readLine()
- if tonumber(newVersion) > version then
- print("Update required. Updating now...")
- local updateSite = http.get("http://pastebin.com/raw.php?i="..code)
- local siteFile = updateSite.readAll()
- local writeFile = fs.open(shell.getRunningProgram(),"w")
- writeFile.write(siteFile)
- writeFile.close()
- print("The program will now restart your computer.")
- sleep(1)
- os.reboot()
- end
- ------------------------------------------------------------------------------------------------
- --START
- ------------------------------------------------------------------------------------------------
- while true do
- turtle.select(1)
- fuel = turtle.getFuelLevel()
- print(fuel)
- if fuel < 200 then
- print("Fuel no OK.")
- turtle.select(2)
- turtle.refuel(1)
- print("Fuel OK...")
- turtle.select(1)
- end
- tudu = turtle.detectUp()
- print(tud)
- if tudu == true then
- turtle.suck()
- for i=1,200 do
- print(i)
- turtle.down()
- end
- end
- turtle.suck()
- tudd = turtle.detectDown()
- if tudd == true then
- turtle.select(1)
- turtle.dropDown()
- turtle.select(2)
- turtle.suck()
- turtle.select(3)
- turtle.dropDown()
- turtle.select(4)
- turtle.dropDown()
- turtle.select(5)
- turtle.dropDown()
- turtle.select(6)
- turtle.dropDown()
- turtle.select(7)
- turtle.dropDown()
- turtle.select(8)
- turtle.dropDown()
- turtle.select(9)
- turtle.dropDown()
- turtle.select(10)
- turtle.dropDown()
- turtle.select(11)
- turtle.dropDown()
- turtle.select(12)
- turtle.dropDown()
- turtle.select(13)
- turtle.dropDown()
- turtle.select(14)
- turtle.dropDown()
- turtle.select(15)
- turtle.dropDown()
- turtle.select(16)
- turtle.dropDown()
- end
- turtle.up()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement