Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. --connect
  2. rednet.open("left")
  3. m = peripheral.wrap("right")
  4.  
  5. --Clear
  6. m.setTextScale(1)
  7. m.setCursorPos(1,1)
  8. m.setBackgroundColor(colors.black)
  9. m.clear()
  10.  
  11. --ID
  12. print(os.getComputerID())
  13.  
  14. --listes
  15. listes_pc = {}
  16.  
  17. --Variables
  18. page = "1"
  19. pageMax = (math.floor(#listes_pc/10))+1
  20. ecran = "ecranMain"
  21.  
  22. --Function draw
  23. function drawBarreNav()
  24. local x
  25. for x = 1, 82 do
  26. m.setCursorPos(x,1)
  27. m.setBackgroundColor(colors.gray)
  28. m.write(" ")
  29. end
  30. m.setCursorPos(78,1)
  31. m.setBackgroundColor(colors.lightGray)
  32. m.write("home")
  33. end
  34.  
  35. function drawMain()
  36. local n,y,x
  37. for n = 1,2 do
  38. for x = 5,35 do
  39. for y = 4, 10 do
  40. m.setCursorPos(x+((40*n)-40),y)
  41. m.setBackgroundColor(colors.red)
  42. m.write(" ")
  43. end
  44. end
  45. end
  46. local n,y,x
  47. for n = 1,2 do
  48. for x = 5,35 do
  49. for y = 17,23 do
  50. m.setCursorPos(x+((40*n)-40),y)
  51. m.setBackgroundColor(colors.red)
  52. m.write("")
  53. end
  54. end
  55. end
  56. m.setCursorPos(15,6)
  57. m.write("PC CONNECTE")
  58. end
  59.  
  60. function drawPcCo()
  61. m.setCrusorPos(1,2)
  62. m.write("ID")
  63. m.setCrusorPos(9,2)
  64. m.write("|")
  65. m.setCrusorPos(10,2)
  66. m.write("Type")
  67. m.setCrusorPos(20,2)
  68. m.write("|")
  69. m.setCrusorPos(21,2)
  70. m.write("Etat")
  71. m.setCrusorPos(30,2)
  72. m.write("|")
  73. m.setCrusorPos(40,2)
  74. m.write("|")
  75. m.setCrusorPos(50,2)
  76. m.write("|")
  77. m.setCrusorPos(60,2)
  78. m.write("|")
  79. m.setCrusorPos(70,2)
  80. m.write("|")
  81. m.setCrusorPos(71,2)
  82. m.write("Delete")
  83.  
  84. end
  85.  
  86. function drawPcCo()
  87.  
  88. end
  89.  
  90. while true do
  91.  
  92. --Draw
  93. drawBarreNav()
  94. if ecran == "ecranMain" then
  95. drawMain()
  96. end
  97. if ecran == "ecranPcCo" then
  98. drawPcCo()
  99. end
  100.  
  101. local event, e1, e2, e3 = os.pullEvent()
  102.  
  103. --event rednet
  104. if event == "rednet_message" then
  105.  
  106. end
  107. --event monitor
  108. if event == "monitor_touch" then
  109. if x >= 78 and x <= 82 then
  110. if y >= 1 and y <= 1 then
  111. ecran = "ecranMain"
  112. end
  113. end
  114. --MainMenu
  115. if ecran == "ecranMain" then
  116. --Bouton Haut Gauche
  117. if x >= 5 and x <= 35 then
  118. if y >= 4 and y <= 10 then
  119. ecran = "ecranPcCo"
  120. end
  121. end
  122. --Bouton Haut Droite
  123. if x >= 45 and x <=75 then
  124. if y >= 4 and y <= 10 then
  125.  
  126. end
  127. end
  128. --Bouton bas gauche
  129. if x >= 5 and x <= 35 then
  130. if y >= 17 and y <= 23 then
  131.  
  132. end
  133. end
  134. --Bouton bas droite
  135. if x >= 45 and x <= 75 then
  136. if y >= 17 and y <= 23 then
  137.  
  138. end
  139. end
  140. end
  141. if ecran == "ecranPcCo" then
  142.  
  143. end
  144. end
  145. --event key
  146. if event == "key" then
  147. if ecran == "ecranMain" then
  148.  
  149. end
  150. if ecran == "ecranPcCo" then
  151.  
  152. end
  153. end
  154.  
  155.  
  156. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement