Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
606 B
2
Indexable
Never
-- Initialize rednet and modem
rednet.open("left")
redstone.setOutput("back", false) -- Ensure redstone is initially off

-- Define the specific message to trigger the redstone signal
local triggerMessage = "activate_redstone"

-- Wait for rednet signal
while true do
  local senderID, message, distance = rednet.receive()
  
  -- Check if the received message is the trigger
  if message == triggerMessage then
    -- Activate redstone output for 5 seconds
    redstone.setOutput("back", true)
    sleep(5) -- Wait for 5 seconds
    redstone.setOutput("back", false) -- Turn off redstone output
  end
end
Leave a Comment