bennyclams

Untitled

Aug 7th, 2026
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. local drawer = peripheral.find("functionalstorage:oak_4")
  2. local controller = peripheral.find("mekmissiles:missile_silo")
  3.  
  4. local engine_item = "mekmissiles:rocket_engine"
  5. local body_item = "mekmissiles:rocket_body"
  6. local nose_item = "mekmissiles:rocket_nose_cone"
  7.  
  8. local small_warhead = "mnwe:industrial_bomb"
  9. local medium_warhead = "mnwe:nuclear_bomb"
  10. local large_warhead = "mnwe:hydrogen_bomb"
  11. local huge_warhead = "mnwe:antimatter_bomb"
  12.  
  13. if not drawer then
  14. print("No functional storage drawer found")
  15. return
  16. end
  17.  
  18. if not controller then
  19. print("No missile silo controller found")
  20. return
  21. end
  22.  
  23. -- Wait for redstone signal to start assembly
  24. os.pullEvent("redstone")
  25.  
  26. local engine_slot = nil
  27. local body_slot = nil
  28. local nose_slot = nil
  29.  
  30. for i = 1, drawer.size() do
  31. local item = drawer.getItemDetail(i)
  32. if item then
  33. if item.name == engine_item then
  34. engine_slot = i
  35. elseif item.name == body_item then
  36. body_slot = i
  37. elseif item.name == nose_item then
  38. nose_slot = i
  39. end
  40. end
  41. end
  42.  
  43. if not engine_slot then
  44. print("No rocket engine found in drawer")
  45. return
  46. end
  47.  
  48. if not body_slot then
  49. print("No rocket body found in drawer")
  50. return
  51. end
  52.  
  53. if not nose_slot then
  54. print("No rocket nose cone found in drawer")
  55. return
  56. end
  57.  
  58. drawer.pushItems(peripheral.getName(controller), engine_slot, 1)
  59. drawer.pushItems(peripheral.getName(controller), body_slot, 1)
  60. drawer.pushItems(peripheral.getName(controller), nose_slot, 1)
Advertisement
Add Comment
Please, Sign In to add comment