Advertisement
karelvysinka

Turtle crafting DRUM

Aug 9th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.29 KB | None | 0 0
  1. local version =
  2. 39.0
  3. -- Pri zmene programu je treba na radku 2 zmenit verzi, aby se program automaticky aktualizoval
  4. -- local code je treba zmenit dle potreby
  5.  
  6.  
  7. local code = "sKQUDMWA"
  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. print("Turtle crafting DRUM STARTUJI")
  31.  
  32. --kompletni vyprazdneni bocnich slotu
  33. turtle.select(4)
  34. turtle.dropDown()
  35. turtle.select(8)
  36. turtle.dropDown()
  37. turtle.select(12)
  38. turtle.dropDown()
  39. turtle.select(13)
  40. turtle.dropDown()
  41. turtle.select(14)
  42. turtle.dropDown()
  43. turtle.select(15)
  44. turtle.dropDown()
  45. turtle.select(16)
  46. turtle.dropDown()
  47. print("Vyprazdneny vsechny bocni sloty 2")
  48.  
  49. --nasati novych cabblestone
  50. print("Nasavam nove Cabblestone")
  51. while true do
  52.  
  53. turtle.select(1)
  54. local t1 = turtle.getItemCount(1)
  55. print(t1)
  56. local t1v = 64-t1
  57. print(t1v)
  58. turtle.suck(t1v)
  59.  
  60. turtle.select(2)
  61. local t2 = turtle.getItemCount(2)
  62. local t2v = 64-t2
  63. turtle.suck(t2v)
  64.  
  65. turtle.select(3)
  66. local t3 = turtle.getItemCount(3)
  67. local t3v = 64-t3
  68. turtle.suck(t3v)
  69.  
  70. turtle.select(5)
  71. local t4 = turtle.getItemCount(5)
  72. local t4v = 64-t4
  73. turtle.suck(t4v)
  74.  
  75. turtle.select(6)
  76. local t5 = turtle.getItemCount(6)
  77. local t5v = 64-t5
  78. turtle.suck(t5v)
  79.  
  80. turtle.select(7)
  81. local t6 = turtle.getItemCount(7)
  82. local t6v = 64-t6
  83. turtle.suck(t6v)
  84.  
  85. turtle.select(9)
  86. local t7 = turtle.getItemCount(9)
  87. local t7v = 64-t7
  88. turtle.suck(t7v)
  89.  
  90. turtle.select(10)
  91. local t8 = turtle.getItemCount(10)
  92. t8v = 64-t8
  93. turtle.suck(t8v)
  94.  
  95. turtle.select(11)
  96. local t9 = turtle.getItemCount(11)
  97. local t9v = 64-t9
  98. turtle.suck(t9v)
  99.  
  100. --presun cabblestone do craft slotu
  101. --turtle.select(4)
  102. --turtle.transferTo(10)
  103. --turtle.select(8)
  104. --turtle.transferTo(11)
  105.  
  106. -- vyprazdneni pro jistotu bocnich slotu pro crafting
  107. turtle.select(12)
  108. turtle.dropDown()
  109. turtle.select(13)
  110. turtle.dropDown()
  111. turtle.select(14)
  112. turtle.dropDown()
  113. turtle.select(15)
  114. turtle.dropDown()
  115. turtle.select(16)
  116. turtle.dropDown()
  117. print("Vyprazdneny bocni sloty")
  118.  
  119. --zahajeni caftovani kdyz jsou plne sloty
  120. print(t1)
  121. print(t2)
  122. print(t3)
  123. print(t4)
  124. print(t5)
  125. print(t6)
  126. print(t7)
  127. print(t8)
  128. if (t1>0) and (t2>0) and (t3>0) and (t4>0) and (t5>0) and (t6>0) and (t7>0) and (t8>0) then
  129.     print("Craftuji...")
  130.     turtle.craft()
  131.     print("Docraftovano OK...")
  132. end
  133.  
  134. --sklizeni vycraftovaneho compresed cabblestone
  135. turtle.select(4)
  136. turtle.dropUp()
  137. turtle.select(8)
  138. turtle.dropUp()
  139. turtle.select(12)
  140. turtle.dropUp()
  141. turtle.select(13)
  142. turtle.dropUp()
  143. turtle.select(14)
  144. turtle.dropUp()
  145. turtle.select(15)
  146. turtle.dropUp()
  147. turtle.select(16)
  148. turtle.dropUp()
  149. print("Sklizeni vycraftovaneho compresed cabblestone")
  150.  
  151.  
  152. end
  153.  
  154.  
  155. -- konec hlavního programu
  156. end
  157.  
  158.  
  159. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement