Advertisement
colhaydutu

energy orb automation

Jan 24th, 2024 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. term.setBackgroundColor(colors.lightGray)
  3. term.setTextColor( colors.lime )
  4. term.clear()
  5. local material1
  6. local material2
  7. local material3
  8. local delaytime
  9. local dropam1
  10. local dropam2
  11. term.setCursorPos(1,1)
  12. print("/ps colhaydutu /ps ETvd")
  13. term.setCursorPos(1,2)
  14. print("Place a hopper opposite to turtle (the turtle will drop the items)")
  15. print("Put items in the turtle's inventory")
  16. term.setCursorPos(1,6)
  17. print("Select a block for orb")
  18. print("z - Block of Energized Steel")
  19. print("x - Block of Blazing Crystal")
  20. print("c - Block of Niotic Crystal")
  21. print("v - Block of Spirited Crystal")
  22. print("b - Block of Nitro Crystal")
  23. print("n - Dry ice")
  24.  
  25. local event, key, isHeld = os.pullEvent("key")
  26.  
  27. if key == keys.z then
  28. term.clear()
  29. term.setCursorPos(1,1)
  30. print("Selected block is Energized Steel")
  31. material1 = "minecraft:gold_block"
  32. material2 = "minecraft:iron_block"
  33. dropam1 = 1
  34. print("Type delay time for craft (second) ")
  35. delaytime = read()
  36.  
  37. elseif key == keys.x then
  38. term.clear()
  39. term.setCursorPos(1,1)
  40. print("Selected block is Blazing Crystal")
  41. material1 = "botania:blaze_block"
  42. material2 = "minecraft:air"
  43. dropam1 = 1
  44. print("Type delay time for craft (second) ")
  45. delaytime = read()
  46.  
  47. elseif key == keys.c then
  48. term.clear()
  49. term.setCursorPos(1,1)
  50. print("Selected block is Niotic Crystal")
  51. material1 = "minecraft:diamond_block"
  52. material2 = "minecraft:air"
  53. dropam1 = 1
  54. print("Type delay time for craft (second) ")
  55. delaytime = read()
  56.  
  57. elseif key == keys.v then
  58. term.clear()
  59. term.setCursorPos(1,1)
  60. print("Selected block is Spirited Crystal")
  61. material1 = "minecraft:emerald_block"
  62. material2 = "minecraft:air"
  63. dropam1 = 1
  64. print("Type delay time for craft (second) ")
  65. delaytime = read()
  66.  
  67. elseif key == keys.b then
  68. term.clear()
  69. term.setCursorPos(1,1)
  70. print("Selected block is Nitro Crystal")
  71. material3 = "minecraft:redstone_block"
  72. material2 = "minecraft:nether_star"
  73. material1 = "powah:blazing_crystal_block"
  74. dropam2 = 2
  75. dropam1 = 1
  76.  
  77. print("Type delay time for craft (second) ")
  78. delaytime = read()
  79.  
  80. elseif key == keys.n then
  81. term.clear()
  82. term.setCursorPos(1,1)
  83. print("Selected the dry ice")
  84. material3 = "minecraft:blue_ice"
  85. material2 = "minecraft:air"
  86. material1 = "minecraft:air"
  87. dropam2 = 2
  88. print("Type delay time for craft (second) ")
  89. delaytime = read()
  90. else
  91. shell.run("startup.lua")
  92. term.clear()
  93. end
  94.  
  95. print("Starting...")
  96. sleep(1)
  97. term.clear()
  98. sleep(1)
  99. term.setCursorPos(1,1)
  100. print("working...")
  101. print("Break the turtle for stop")
  102.  
  103.  
  104. while true do
  105.  
  106. for slot = 1, 16 do
  107. local itemDetail = turtle.getItemDetail(slot)
  108. if itemDetail and itemDetail.name == material1 then
  109. turtle.select(slot)
  110. turtle.drop(1)
  111. break
  112. end
  113. end
  114.  
  115. for slot = 1, 16 do
  116. local itemDetail = turtle.getItemDetail(slot)
  117. if itemDetail and itemDetail.name == material2 then
  118. turtle.select(slot)
  119. turtle.drop(1)
  120. break
  121. end
  122. end
  123.  
  124. for slot = 1, 16 do
  125. local itemDetail = turtle.getItemDetail(slot)
  126. if itemDetail and itemDetail.name == material3 then
  127. turtle.select(slot)
  128. turtle.drop(2)
  129. break
  130. end
  131. end
  132.  
  133. sleep(tonumber(delaytime))
  134. end
  135.  
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement