Advertisement
aynoblo

Bee's Door

Apr 11th, 2020
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. --bee door host V1
  2. local rChannel=104
  3. local hChannel=103
  4. local osName=beeDoor
  5. local change=0
  6. local x,y,z=gps.locate()
  7.  
  8. modem=peripheral.wrap("back")
  9. modem.open(rChannel)
  10. modem.open(hChannel)
  11. print("modem status:",modem.isOpen(rChannel))
  12. print("modem status:",modem.isOpen(hChannel))
  13.  
  14. while true do
  15.     local event, osef, osef, osef, recieved, osef = os.pullEvent("modem_message")
  16.     command=textutils.unserialize(recieved)
  17.     if command.cx==nil or command.cy==nil or command.cz==nil then
  18.         print("nil")
  19.     else
  20.         if command.cx>=1378 and command.cx<=1383 and command.cy>=60 and command.cy<=68 and command.cz>=917 and command.cz<=923 and (command.pass=="4GzRLp9LySZsj4c86i5NwGAzh89R528a" or command.pass=="JtfDGV3Y35VDx6sf9r8Q26Pfzc7ciR27") then
  21.             if command.cx>=1379 and command.cx<=1382 and command.cy>=60 and command.cy<=68 and command.cz>=918 and command.cz<=922 then
  22.                 print("-----------------------")
  23.                 redstone.setOutput("right",false)
  24.                 doorState="open"
  25.                 print("door opened")
  26.                 print(command.cx)
  27.                 print(command.cy)
  28.                 print(command.cz)
  29.             else
  30.                 print("-----------------------")
  31.                 redstone.setOutput("right",true)
  32.                 doorState="close"
  33.                 print("door closed")
  34.                 print(command.cx)
  35.                 print(command.cy)
  36.                 print(command.cz)
  37.             end
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement