Advertisement
Guest User

startup

a guest
Jul 24th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. password = "test"
  2. remoteId = 2
  3. rednet.open("top")
  4. local status = false
  5. redstone.setOutput("front",false)
  6.  
  7. while true do
  8.   id, message = rednet.receive()
  9.   if id == remoteId and message == password then
  10.     if status == false then
  11.       status = true
  12.       redstone.setOutput("front",true)
  13.     elseif status == true then
  14.       status = false
  15.       redstone.setOutput("front",false)
  16.     end
  17.   elseif id == remoteId and message == "ping" then
  18.     sleep(.1)
  19.     rednet.send(remoteId,status)
  20.   end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement