daily pastebin goal
40%
SHARE
TWEET

CC: open_receive0

hevohevo Apr 30th, 2016 (edited) 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- open_receive0
  2. -- 遠隔操作で扉を開けるプログラム(メッセージ受信側)
  3.  
  4. local open_msg = "Open"  -- 開くメッセージ
  5.  
  6. rednet.open("right")  -- 右側に設置したモデムを使うという宣言
  7.  
  8. while true do
  9.   local id, msg = rednet.receive()  -- メッセージを待ち受ける
  10.   print(id, msg)
  11.  
  12.   if msg == open_msg then  -- もし受信メッセージが開くメッセージと同じならば、
  13.     print("correct")
  14.     redstone.setOutput("top", true)
  15.     os.sleep(10)
  16.     redstone.setOutput("top", false)
  17.   else  -- 同じでないならば、
  18.     print("wrong")
  19.   end
  20. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top