Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version =
- 10.0
- -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
- -- local code je treba zmenit dle potreby
- local code = "2VGZsGbx"
- --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
- function start()
- -- start hlavního programu
- while true do
- turtle.select(1)
- turtle.suckUp()
- local data = turtle.getItemDetail()
- if data then
- print("Item name: ", data.name)
- print("Item damage value: ", data.damage)
- print("Item count: ", data.count)
- if data.name == "minecraft:cobblestone" then
- print("Nalezen COBBLESTONE. Posilam ho do RECYCLERu")
- turtle.drop()
- end
- end
- turtle.dropUp()
- turtle.select(2)
- turtle.suck()
- --CABBLE2
- turtle.select(1)
- turtle.suckDown()
- local data = turtle.getItemDetail()
- if data then
- print("Item name: ", data.name)
- print("Item damage value: ", data.damage)
- print("Item count: ", data.count)
- if data.name == "minecraft:dirt" then
- print("Nalezen DIRT. Posilam ho do RECYCLERu")
- turtle.drop()
- end
- end
- turtle.dropDown()
- turtle.select(2)
- turtle.suck()
- --KONEC CABBLE2
- --DIRT
- turtle.select(1)
- turtle.suckUp()
- local data = turtle.getItemDetail()
- if data then
- print("Item name: ", data.name)
- print("Item damage value: ", data.damage)
- print("Item count: ", data.count)
- if data.name == "minecraft:dirt" then
- print("Nalezen DIRT. Posilam ho do RECYCLERu")
- turtle.drop()
- end
- end
- turtle.dropUp()
- turtle.select(2)
- turtle.suck()
- --KONEC DIRT
- --DIRT2
- turtle.select(1)
- turtle.suckDown()
- local data = turtle.getItemDetail()
- if data then
- print("Item name: ", data.name)
- print("Item damage value: ", data.damage)
- print("Item count: ", data.count)
- if data.name == "minecraft:dirt" then
- print("Nalezen DIRT. Posilam ho do RECYCLERu")
- turtle.drop()
- end
- end
- turtle.dropDown()
- turtle.select(2)
- turtle.suck()
- --KONEC DIRT2
- --konec while
- end
- -- konec hlavního programu
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement