Advertisement
Guest User

startup

a guest
May 22nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. glass = peripheral.wrap("right")
  2. chatbox = os.pullEvent("chatbox_command")
  3. if rednet.isOpen("top") == false then
  4.   rednet.open("top")
  5.   rednet.host("ruben","gafas")
  6. end
  7.  
  8.   local boolOrange = false
  9.   local boolLightBlue = false
  10.   local boolBlue = false
  11.   local boolWhite = false
  12.  
  13. glass.clear()
  14.  
  15. local i = 0
  16. textbox = glass.addBox(1,1,100,55,0xFFFFFF,0.2)
  17.  
  18. time = textutils.formatTime(os.time(), false)
  19. text = glass.addText(5,2,"HORA: " .. time, 0x00FF00)
  20. textOrange = glass.addText(5,12,"Naranja: " .. tostring(boolOrange), 0xFF8D00)
  21. textLightBlue = glass.addText(5,22,"Azul claro: " .. tostring(boolLightBlue), 0x00EFFF)
  22. textBlue = glass.addText(5,32,"Azul: " .. tostring(boolBlue), 0x0000FF)
  23. textWhite = glass.addText(5,42,"Blanco: " .. tostring(boolBlue), 0xFFFFFF)
  24.  
  25. repeat
  26. local senderId, message, protocol = rednet.receive("ruben",0.8)
  27.  
  28. if message == nil or message == "" then
  29. else
  30. if message == "Orange.false" then
  31.         boolOrange = false
  32.     elseif message == "Orange.true" then
  33.         boolOrange = true
  34.     elseif message == "LightBlue.false" then
  35.         boolLightBlue = false
  36.     elseif message == "LightBlue.true" then
  37.         boolLightBlue = true
  38.     elseif message == "Blue.false" then
  39.         boolBlue = false
  40.     elseif message == "Blue.true" then
  41.         boolBlue = true
  42.     elseif message == "White.false" then
  43.         boolWhite = false
  44.     elseif messsage == "White.true" then
  45.         boolWhite = true
  46.     else
  47.         print(message)
  48.     end
  49. end
  50.  
  51. time = textutils.formatTime(os.time(), false)
  52. text.setText("HORA: " .. time)
  53. textOrange.setText("Naranja: " .. tostring(boolOrange))
  54. textLightBlue.setText("Azul claro: " .. tostring(boolLightBlue))
  55. textBlue.setText("Azul: " .. tostring(boolBlue))
  56. textWhite.setText("Blanco: " .. tostring(boolBlue))
  57. sleep(0.1)
  58. until i == 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement