william200027

Serveur affichage

Sep 24th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.26 KB | None | 0 0
  1. ---Variable---
  2.  
  3. Gauche1 = 28
  4. Gauche2 = 28
  5. Gauche3 = 28
  6. Gauche4 = 28
  7. Gauche5 = 28
  8.  
  9. ---Peripheral---
  10.  
  11. m = peripheral.wrap("right")
  12.  
  13. ---Program---
  14.  
  15. function Affi1()
  16.  
  17. m.setBackgroundColor(colors.black)
  18. m.clear()
  19. m.setBackgroundColor(colors.gray)
  20. m.setCursorPos(1,1)
  21. m.write("                             ")
  22. m.setCursorPos(1,3)
  23. m.write("                             ")
  24. m.setCursorPos(1,2)
  25. m.write(" ")
  26. m.setCursorPos(29,2)
  27. m.write(" ")
  28.  
  29. m.setCursorPos(1,5)
  30. m.write("                             ")
  31. m.setCursorPos(1,7)
  32. m.write("                             ")
  33. m.setCursorPos(1,6)
  34. m.write(" ")
  35. m.setCursorPos(29,6)
  36. m.write(" ")
  37.  
  38. m.setCursorPos(1,9)
  39. m.write("                             ")
  40. m.setCursorPos(1,11)
  41. m.write("                             ")
  42. m.setCursorPos(1,10)
  43. m.write(" ")
  44. m.setCursorPos(29,10)
  45. m.write(" ")
  46.  
  47. m.setCursorPos(1,13)
  48. m.write("                             ")
  49. m.setCursorPos(1,15)
  50. m.write("                             ")
  51. m.setCursorPos(1,14)
  52. m.write(" ")
  53. m.setCursorPos(29,14)
  54. m.write(" ")
  55.  
  56. m.setCursorPos(1,17)
  57. m.write("                             ")
  58. m.setCursorPos(1,19)
  59. m.write("                             ")
  60. m.setCursorPos(1,18)
  61. m.write(" ")
  62. m.setCursorPos(29,18)
  63. m.write(" ")
  64.  
  65. m.setBackgroundColor(colors.blue)
  66. m.setCursorPos(2,2)
  67. m.write("                           ")
  68. m.setCursorPos(2,6)
  69. m.write("                           ")
  70. m.setCursorPos(2,10)
  71. m.write("                           ")
  72. m.setCursorPos(2,14)
  73. m.write("                           ")
  74. m.setCursorPos(2,18)
  75. m.write("                           ")
  76. end
  77.  
  78. function Affi2()
  79.  
  80. m.setBackgroundColor(colors.lightBlue)
  81. m.setCursorPos(Gauche1,2)
  82. m.write(" ")
  83. Gauche1 = Gauche1 - 1
  84. end
  85.  
  86. function Affi3()
  87. m.setBackgroundColor(colors.lightBlue)
  88. m.setCursorPos(Gauche2,6)
  89. m.write(" ")
  90. Gauche2 = Gauche2 - 1
  91. end
  92.  
  93. function Affi4()
  94. m.setBackgroundColor(colors.lightBlue)
  95. m.setCursorPos(Gauche3,10)
  96. m.write(" ")
  97. Gauche3 = Gauche3 - 1
  98. end
  99.  
  100. function Affi5()
  101. m.setBackgroundColor(colors.lightBlue)
  102. m.setCursorPos(Gauche4,14)
  103. m.write(" ")
  104. Gauche4 = Gauche4 - 1
  105. end
  106.  
  107. function Affi6()
  108. m.setBackgroundColor(colors.lightBlue)
  109. m.setCursorPos(Gauche5,18)
  110. m.write(" ")
  111. Gauche5 = Gauche5 - 1
  112. end
  113.  
  114. Affi1()
  115.  
  116. while true do
  117.  
  118.  if(Gauche1 == 28)then
  119.     Affi2()
  120.     Gauche1 = 24
  121.  end
  122.  
  123.  if(Gauche2 == 28)then
  124.     Affi3()
  125.     Gauche2 = 4
  126.  end
  127.  
  128.  if(Gauche3 == 28)then
  129.     Affi4()
  130.     Gauche3 = 22
  131.  end
  132.  
  133.  if(Gauche4 == 28)then
  134.     Affi5()
  135.     Gauche4 = 6
  136.  end
  137.  
  138.  if(Gauche5 == 28)then
  139.     Affi6()
  140.     Gauche5 = 10
  141.  end
  142.  
  143. sleep(1)
  144.  
  145.   if(Gauche1 == 24)then
  146.     m.setBackgroundColor(colors.lightBlue)
  147.     m.setCursorPos(24,2)
  148.     m.write("     ")
  149.     Gauche1 = 20
  150.  end
  151.  
  152.  if(Gauche2 == 4)then
  153.     m.setBackgroundColor(colors.lightBlue)
  154.     m.setCursorPos(4,6)
  155.     m.write("                        ")
  156.     Gauche2 = 20
  157.  end
  158.  
  159.  if(Gauche3 == 22)then
  160.     m.setBackgroundColor(colors.lightBlue)
  161.     m.setCursorPos(22,10)
  162.     m.write("       ")
  163.     Gauche3 = 20
  164.  end
  165.  
  166.  if(Gauche4 == 6)then
  167.     m.setBackgroundColor(colors.lightBlue)
  168.     m.setCursorPos(6,14)
  169.     m.write("                      ")
  170.     Gauche4 = 20
  171.  end
  172.  
  173.  if(Gauche5 == 10)then
  174.     m.setBackgroundColor(colors.lightBlue)
  175.     m.setCursorPos(10,18)
  176.     m.write("                  ")
  177.     Gauche5 = 20
  178.  end
  179.  
  180. sleep(1)
  181.  
  182.   if(Gauche1 == 20)then
  183.     Affi1()
  184.     m.setBackgroundColor(colors.lightBlue)
  185.     m.setCursorPos(25,2)
  186.     m.write("    ")
  187.     Gauche1 = 1
  188.  end
  189.  
  190.  if(Gauche2 == 20)then
  191.     m.setBackgroundColor(colors.lightBlue)
  192.     m.setCursorPos(5,6)
  193.     m.write("                        ")
  194.     Gauche2 = 1
  195.  end
  196.  
  197.  if(Gauche3 == 20)then
  198.     m.setBackgroundColor(colors.lightBlue)
  199.     m.setCursorPos(23,10)
  200.     m.write("      ")
  201.     Gauche3 = 1
  202.  end
  203.  
  204.  if(Gauche4 == 20)then
  205.     m.setBackgroundColor(colors.lightBlue)
  206.     m.setCursorPos(7,14)
  207.     m.write("                      ")
  208.     Gauche4 = 1
  209.  end
  210.  
  211.  if(Gauche5 == 20)then
  212.     m.setBackgroundColor(colors.lightBlue)
  213.     m.setCursorPos(11,18)
  214.     m.write("                  ")
  215.     Gauche5 = 1
  216.  end
  217.  
  218.  sleep(1)
  219.  
  220. if(Gauche1 == 1 and Gauche2 == 1 and Gauche3 == 1 and Gauche4 == 1 and Gauche5 == 1)then
  221. Affi1()
  222. Gauche1 = 28
  223. Gauche2 = 28
  224. Gauche3 = 28
  225. Gauche4 = 28
  226. Gauche5 = 28
  227. end
  228. end
  229.  
  230. ----=Autor=----
  231. --By Zaidal86
  232. ----=-----=----
Advertisement
Add Comment
Please, Sign In to add comment