Advertisement
karelvysinka

Rotary macerator farm turtle Tekkit legends

Jul 15th, 2017
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 0 0
  1. local version =
  2. 6.0
  3. -- Program pro prijem zprav pres modem
  4. -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
  5. -- local code je treba zmenit dle potreby
  6.  
  7. local code = "xV4xFMvq"
  8.  
  9. --check version
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. print("Program loading...")
  13. print("Current version: "..version)
  14. local updateSite= http.get("http://pastebin.com/raw.php?i="..code)
  15. updateSite.readLine()
  16. local newVersion = updateSite.readLine()
  17. if tonumber(newVersion) > version then
  18.         print("Update required. Updating now...")
  19.         local updateSite = http.get("http://pastebin.com/raw.php?i="..code)
  20.         local siteFile = updateSite.readAll()
  21.         local writeFile = fs.open(shell.getRunningProgram(),"w")
  22.         writeFile.write(siteFile)
  23.         writeFile.close()
  24.         print("The program will now restart your computer.")
  25.         sleep(1)
  26.         os.reboot()
  27. end
  28.  
  29. function start()
  30.     b=0
  31.     while true do
  32.             turtle.select(1)
  33.             turtle.dropDown()
  34.             if turtle.getItemCount( turtle.getSelectedSlot() ) > 10 then
  35.                 print("Ve slotu je více jak 10 itemu. V poradku.")
  36.             else
  37.                 print("Ve slotu dochazi blazerod. Doplnujeme......>>>")
  38.                 turtle.suckUp()
  39.                 turtle.dropDown()
  40.             end
  41.     turtle.select(2)
  42.     turtle.drop()
  43.     turtle.select(3)
  44.     turtle.suckDown()
  45.     turtle.drop()
  46.     b=b+1
  47.     print(b)
  48.     end
  49. end
  50.  
  51. --start programu
  52. local a=0
  53. while true do
  54.     start()
  55.     a=a+1
  56.     print(a)
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement