Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drawer = peripheral.find("functionalstorage:oak_4")
- local controller = peripheral.find("mekmissiles:missile_silo")
- local engine_item = "mekmissiles:rocket_engine"
- local body_item = "mekmissiles:rocket_body"
- local nose_item = "mekmissiles:rocket_nose_cone"
- local small_warhead = "mnwe:industrial_bomb"
- local medium_warhead = "mnwe:nuclear_bomb"
- local large_warhead = "mnwe:hydrogen_bomb"
- local huge_warhead = "mnwe:antimatter_bomb"
- if not drawer then
- print("No functional storage drawer found")
- return
- end
- if not controller then
- print("No missile silo controller found")
- return
- end
- -- Wait for redstone signal to start assembly
- os.pullEvent("redstone")
- local engine_slot = nil
- local body_slot = nil
- local nose_slot = nil
- for i = 1, drawer.size() do
- local item = drawer.getItemDetail(i)
- if item then
- if item.name == engine_item then
- engine_slot = i
- elseif item.name == body_item then
- body_slot = i
- elseif item.name == nose_item then
- nose_slot = i
- end
- end
- end
- if not engine_slot then
- print("No rocket engine found in drawer")
- return
- end
- if not body_slot then
- print("No rocket body found in drawer")
- return
- end
- if not nose_slot then
- print("No rocket nose cone found in drawer")
- return
- end
- drawer.pushItems(peripheral.getName(controller), engine_slot, 1)
- drawer.pushItems(peripheral.getName(controller), body_slot, 1)
- drawer.pushItems(peripheral.getName(controller), nose_slot, 1)
Advertisement
Add Comment
Please, Sign In to add comment