Advertisement
Axow01

receiver_computer_craft

Aug 16th, 2023 (edited)
1,148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1.  
  2. rednet.open("left")
  3.  
  4. local dispacher_id = 24
  5.  
  6. term.clear()
  7. term.setCursorPos(1, 1)
  8. term.setCursorBlink(false)
  9. term.setTextColor(colors.green)
  10. term.write("Receiver: "..os.getComputerID())
  11.  
  12. while (true) do
  13.     local sender_id, message, distance_or_protocol = rednet.receive("lights_activation_440")
  14.     if (dispacher_id == 3) then
  15.         if (message == true) then redstone.setAnalogOutput("back", 15)
  16.         elseif (message == false) then redstone.setAnalogOutput("back", 0)
  17.         elseif (message == "alarm") then print("alarm not handled here.") end
  18.     end
  19. end
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement