Advertisement
Guest User

airCheck

a guest
May 23rd, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. os.loadAPI("button")
  2. local mon = peripheral.wrap("right")
  3. mon.clear()
  4.  
  5. button.setTable("Sala 1", sala1, 5, 10, 4, 4)
  6. button.setTable("Sala 2", sala2, 5, 10, 7, 7)
  7. button.screen()
  8. button.heading("Aire")
  9.  
  10.  
  11. while true do
  12.   ext, id,msg=os.pullEvent("rednet_message")
  13.   if msg=="si" then
  14.     if(id==24) then  button.toggleButton("Sala 2") end
  15.     if(id==26) then button.toggleButton("Sala 1") end
  16.     print("Hay aire en sala "..id)
  17.   else
  18.     if(id==24) then button.toggleButton("Sala 2") end
  19.     if(id==26) then button.toggleButton("Sala 1") end
  20.     print("No hay aire en sala "..id)
  21.   end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement