Advertisement
colhaydutu

atm10 inscriber automation

Feb 12th, 2025 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 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. term.setCursorPos(1,1)
  9. print("by Colhaydutu")
  10. term.setCursorPos(1,3)
  11. print("Place items in the chest to craft")
  12. print("Press a key on the keyboard to select a recipe")
  13.  
  14.  
  15. term.setCursorPos(1,6)
  16. print("Select an item for inscriber")
  17. print("q - Printed Logic Circuit")
  18. print("w - Printed Silicon")
  19. print("e - Printed Calculation Circuit")
  20. print("r - Printed Engineering Circuit")
  21. print("t - Logic Processor ")
  22. print("y - Calculation Processor ")
  23. print("u - Engineering Processor ")
  24.  
  25.  
  26. local event, key, isHeld = os.pullEvent("key")
  27.  
  28. if key == keys.q then
  29. term.clear()
  30. term.setCursorPos(1,1)
  31. print("Selected item is Printed Logic Circuit")
  32. material1 = "ae2:logic_processor_press"
  33. material2 = "minecraft:gold_ingot"
  34. material3 = "minecraft:air"
  35. m1slot = 1
  36. m2slot = 3
  37. m3slot = 2
  38.  
  39.  
  40. elseif key == keys.w then
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. print("Selected item is Printed Silicon")
  44. material1 = "ae2:silicon_press"
  45. material2 = "ae2:silicon"
  46. material3 = "minecraft:air"
  47. m1slot = 1
  48. m2slot = 3
  49. m3slot = 2
  50.  
  51. elseif key == keys.e then
  52. term.clear()
  53. term.setCursorPos(1,1)
  54. print("Selected item is Printed Calculation Circuit")
  55. material1 = "ae2:calculation_processor_press"
  56. material2 = "ae2:certus_quartz_crystal"
  57. material3 = "minecraft:air"
  58. m1slot = 1
  59. m2slot = 3
  60. m3slot = 2
  61.  
  62. elseif key == keys.r then
  63. term.clear()
  64. term.setCursorPos(1,1)
  65. print("Selected item is Printed Engineering Circuit")
  66. material1 = "ae2:engineering_processor_press"
  67. material2 = "minecraft:diamond"
  68. material3 = "minecraft:air"
  69. m1slot = 1
  70. m2slot = 3
  71. m3slot = 2
  72.  
  73. elseif key == keys.t then
  74. term.clear()
  75. term.setCursorPos(1,1)
  76. print("Selected item is Logic Processor")
  77. material1 = "ae2:printed_logic_processor"
  78. material2 = "minecraft:redstone"
  79. material3 = "ae2:printed_silicon"
  80. m1slot = 1
  81. m2slot = 3
  82. m3slot = 2
  83.  
  84. elseif key == keys.y then
  85. term.clear()
  86. term.setCursorPos(1,1)
  87. print("Selected item is Calculation Processor")
  88. material1 = "ae2:printed_calculation_processor"
  89. material2 = "minecraft:redstone"
  90. material3 = "ae2:printed_silicon"
  91. m1slot = 1
  92. m2slot = 3
  93. m3slot = 2
  94.  
  95. elseif key == keys.u then
  96. term.clear()
  97. term.setCursorPos(1,1)
  98. print("Selected item is Calculation Processor")
  99. material1 = "ae2:printed_engineering_processor"
  100. material2 = "minecraft:redstone"
  101. material3 = "ae2:printed_silicon"
  102. m1slot = 1
  103. m2slot = 3
  104. m3slot = 2
  105.  
  106. else
  107. shell.run("startup.lua")
  108. term.clear()
  109.  
  110. end
  111.  
  112. local modem = peripheral.wrap("back")
  113. modem.open(1)
  114.  
  115. local chests = {}
  116. local inscribers = {}
  117.  
  118. for _, name in ipairs(peripheral.getNames()) do
  119. if string.find(name, "sophisticatedstorage:chest_") then
  120. table.insert(chests, peripheral.wrap(name))
  121. elseif string.find(name, "ae2:inscriber_") then
  122. table.insert(inscribers, peripheral.wrap(name))
  123. end
  124. end
  125.  
  126. for _, inscriber in ipairs(inscribers) do
  127. local inscriberItems = inscriber.list() -- Tüm slotları alıyoruz
  128. for i = 1, 3 do
  129. local item = inscriberItems[i]
  130. if item then
  131. for _, chest in ipairs(chests) do
  132. -- Item varsa, chest'e aktar
  133. inscriber.pushItems(peripheral.getName(chest), i, item.count)
  134. end
  135. end
  136. end
  137. end
  138.  
  139. while true do
  140. for _, chest in ipairs(chests) do
  141. for _, inscriber in ipairs(inscribers) do
  142. for slot, item in pairs(chest.list()) do
  143. if item.name == material1 then
  144. chest.pushItems(peripheral.getName(inscriber), slot, item.count, m1slot)
  145. elseif item.name == material2 then
  146. chest.pushItems(peripheral.getName(inscriber), slot, item.count, m2slot)
  147. elseif item.name == material3 then
  148. chest.pushItems(peripheral.getName(inscriber), slot, item.count, m3slot)
  149. end
  150. end
  151.  
  152. local inscriberItems = inscriber.list()
  153. if inscriberItems[4] then
  154. local item = inscriberItems[4]
  155. for _, chest in ipairs(chests) do
  156. inscriber.pushItems(peripheral.getName(chest), 4, item.count)
  157. end
  158. end
  159. end
  160. end
  161. sleep(1)
  162. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement