Advertisement
Alexr360

Stargate Cargo Upper Distributer

Apr 8th, 2024 (edited)
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modem = peripheral.wrap("top") or error("No modem attached", 0)
  2. modem.open(12) -- Open 43 so we can receive replies
  3.  
  4. -- And wait for a reply
  5. local event, side, channel, replyChannel, message, distance
  6. repeat
  7.     event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
  8. until channel == 12
  9.  
  10. -- Process the received message based on its content
  11. if message == "Iron" then
  12.     modem.transmit(46, 12, "Preparing Package...")
  13.     print("Starting Drop...")
  14.     redstone.setOutput("front", true)
  15.  
  16.     os.sleep(1)
  17.  
  18.     print("Stoping Drop...")
  19.     redstone.setOutput("front", false)
  20.    
  21.     os.sleep(3)
  22.     modem.transmit(46, 12, "Drop-Ready")
  23. end
  24.  
  25. shell.run("startup")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement