xMikhailx

Lua/event/glasses_chat_command test

Aug 11th, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local event = require("event")
  2. local g = require("component").openperipheral_bridge
  3.  
  4. function list(_,_,nick,_,com)
  5. if com == "clear" then
  6. clear()
  7. elseif com == hellocomp then
  8. hellocomp()
  9. end
  10. else
  11.   g.addText(5,2,"Неверная команда.",0xFF0000)
  12.   g.sync()
  13.   os.sleep(5)
  14.   g.clear()
  15.   g.syc()
  16. end
  17. end
  18.  
  19. function clear()
  20. g.clear()
  21. g.sync()
  22. end
  23.  
  24. function hellocomp()
  25. g.clear()
  26. g.addBox(1,1,60,10,0xFFFFFF,0.2)
  27. g.addText(5,2,"Hello, Mikhail!",0xFF0000)
  28. g.sync()
  29. end
  30.  
  31. --while true do
  32. --end
  33. event.listen("glasses_chat_command",list)
Advertisement
Add Comment
Please, Sign In to add comment