Advertisement
Guest User

controller

a guest
Oct 13th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. state = 1
  2. rednet.open("left")
  3. rednet.host("door","controller")
  4. while (state == 1) do
  5.   mid, msg, ptc = rednet.receive("door",10)
  6.   if (msg == "shutdown") then
  7.     state = 0
  8.     print("shutting down")
  9.   elseif (msg == "id") then
  10.     rednet.send(mid, "controller", "door")
  11.     print("sending id")
  12.   elseif (msg == "toggle") then
  13.     redstone.setOutput("bottom",true)
  14.     sleep(1)
  15.     redstone.setOutput("bottom",false)
  16.     print("toggling")
  17.   end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement