Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version =
- 1.0
- -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
- -- local code je treba zmenit dle potreby
- --Vize - plán:
- --Nasavani cabblestone z truhly
- --tvobra compresed cabblestone
- --------------------------------------------------------------------------------------------
- --PROGRAM PRO UPDATE
- --------------------------------------------------------------------------------------------
- local code = "kFdiK7PX"
- --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
- --------------------------------------------------------------------------------------------
- -- HLAVNÍ PROGRAM
- --------------------------------------------------------------------------------------------
- function start()
- print("Turtle sorting CABBLESTONE")
- while true do
- turtle.select(1)
- turtle.suck()
- local data1 = turtle.getItemDetail()
- if data1 then
- print("Item name: ", data1.name)
- dataX1 = data1.name
- if dataX1 == "minecraft:cobblestone" then
- print("Nalezen cobblestone. Provedu umisteni to truhly.")
- turtle.dropUp()
- end
- print("Item damage value: ", data1.damage)
- print("Item count: ", data1.count)
- end
- turtle.dropDown()
- --end true do
- end
- end
- --------------------------------------------------------------------------------------------
- -- KONEC HLAVNIHO PROGRAMU
- --------------------------------------------------------------------------------------------
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement