Advertisement
karelvysinka

Turtle suck condenser tower

Dec 26th, 2018
913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.39 KB | None | 0 0
  1. local version =
  2. 7.0
  3. --Czech title:
  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. --(c) ScherryCZ - Author contact: scherry@email.cz
  7.  
  8. ------------------------------------------------------------------------------------------------
  9. --TEST UPDATE
  10. ------------------------------------------------------------------------------------------------
  11. local code = "5pL2GBwT"
  12.  
  13. --check version
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. print("Program loading...")
  17. print("Current version: "..version)
  18. local updateSite= http.get("http://pastebin.com/raw.php?i="..code)
  19. updateSite.readLine()
  20. local newVersion = updateSite.readLine()
  21. if tonumber(newVersion) > version then
  22.         print("Update required. Updating now...")
  23.         local updateSite = http.get("http://pastebin.com/raw.php?i="..code)
  24.         local siteFile = updateSite.readAll()
  25.         local writeFile = fs.open(shell.getRunningProgram(),"w")
  26.         writeFile.write(siteFile)
  27.         writeFile.close()
  28.         print("The program will now restart your computer.")
  29.         sleep(1)
  30.         os.reboot()
  31. end
  32.  
  33. ------------------------------------------------------------------------------------------------
  34. --START
  35. ------------------------------------------------------------------------------------------------
  36.  
  37. while true do
  38.  
  39. turtle.select(1)
  40.  
  41. fuel = turtle.getFuelLevel()
  42. print(fuel)
  43. if fuel < 200 then
  44.     print("Fuel no OK.")
  45.     turtle.select(2)
  46.     turtle.refuel(1)
  47.     print("Fuel OK...")
  48.     turtle.select(1)
  49. end
  50.  
  51. tudu = turtle.detectUp()
  52. print(tud)
  53. if tudu == true then
  54.     turtle.suck()
  55.     for i=1,200 do
  56.         print(i)
  57.         turtle.down()
  58.     end
  59. end
  60.  
  61. turtle.suck()
  62.  
  63.  
  64. tudd = turtle.detectDown()
  65. if tudd == true then
  66.     turtle.select(1)
  67.     turtle.dropDown()
  68.     turtle.select(2)
  69.     turtle.suck()
  70.     turtle.select(3)
  71.     turtle.dropDown()
  72.     turtle.select(4)
  73.     turtle.dropDown()
  74.     turtle.select(5)
  75.     turtle.dropDown()
  76.     turtle.select(6)
  77.     turtle.dropDown()
  78.     turtle.select(7)
  79.     turtle.dropDown()
  80.     turtle.select(8)
  81.     turtle.dropDown()
  82.     turtle.select(9)
  83.     turtle.dropDown()
  84.     turtle.select(10)
  85.     turtle.dropDown()
  86.     turtle.select(11)
  87.     turtle.dropDown()
  88.     turtle.select(12)
  89.     turtle.dropDown()
  90.     turtle.select(13)
  91.     turtle.dropDown()
  92.     turtle.select(14)
  93.     turtle.dropDown()
  94.     turtle.select(15)
  95.     turtle.dropDown()
  96.     turtle.select(16)
  97.     turtle.dropDown()
  98.  
  99. end
  100.  
  101. turtle.up()
  102. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement