Advertisement
Guest User

Messagingv.0.0.3

a guest
Apr 20th, 2014
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.54 KB | None | 0 0
  1. function getSideOfPeripheral()
  2.   for k,v in pairs(rs.getSides()) do
  3.     --print(v)
  4.     if (peripheral.getType(v)) == "openperipheral_glassesbridge" then
  5.       gl = peripheral.wrap(v)
  6.       Main()
  7.     end
  8.   end
  9. end
  10. function updateHUD()
  11.   gl.clear()
  12.   gl.addBox(0,0,2000,10,0x006400,0.70)
  13.   gl.addText(1,1,text)
  14. end
  15. function Main()
  16.   while true do
  17.     evt, text = os.pullEvent()
  18.     if evt == "chat_command" then
  19.       if text == "/clear" then
  20.         gl.clear()
  21.       elseif text == "/changelog" then
  22.         text = "Changed the peripheral required to.."
  23.         updateHUD()
  24.         text = "The OpenPeriphreals Glasses :)"
  25.         sleep(1)
  26.         updateHUD()
  27.         text = "Also, you now need to type in chat.."
  28.         sleep(1)
  29.         updateHUD()
  30.         text = "with this in front: '$$' no need for"
  31.         sleep(1)
  32.         updateHUD()
  33.         text = "a space."
  34.         sleep(1)
  35.         updateHUD()
  36.       elseif text == "/help" then
  37.       text = "Don't forget to right click the.."
  38.       print("Don't forget to right click the Terminal Glasses Bridge with the glasses!")
  39.       updateHUD()
  40.       sleep(1)
  41.       text = "Terminal Glasses Bridge with the glasses!"
  42.       updateHUD()
  43.       sleep(1)
  44.       text = "Use /clear to clear the screen"
  45.       updateHUD()
  46.       sleep(1)
  47.       text = "and /changelog to see this version's changelog"
  48.       updateHUD()
  49.       sleep(1)
  50.       text = "/help shows you this message."
  51.       updateHUD()
  52.       else
  53.         updateHUD()
  54.       end
  55.     end
  56.   end
  57. end
  58. getSideOfPeripheral()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement