Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version =
- 4.0
- -- Program pro prijem zprav pres modem
- -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
- -- local code je treba zmenit dle potreby
- local code = "skei2DRP"
- --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()
- while true do
- print ("Program is actual..")
- print ("Program working...")
- rednet.open("right")
- print ("Open modem right.")
- print("Help:")
- print("alldrop - all turtle drop slot.")
- print("allsdd - all turtle suck down and drop.")
- print("reboot - all turtle reboot.")
- print("Your command: ")
- local input = read()
- print("sending a command...:")
- print(input)
- print("..connect modem...")
- rednet.broadcast(input)
- print("Command sent OK...")
- end
- end
- function provedPrikaz(message)
- if message == "td" then
- turtle.dig()
- end
- if message == "reboot" then
- print("Reboot computer...")
- os.reboot()
- end
- print("End command...")
- end
- start()
Add Comment
Please, Sign In to add comment