lego11

Silos heka

Jun 27th, 2018
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.15 KB | None | 0 0
  1. function clear()
  2. term.clear()
  3. term.setCursorPos(1, 1)
  4. end
  5.  
  6. function disegnaTabellaPulita()
  7. print("SILOS QUANTITA' RICHIESTA")
  8. print("")
  9. print("1 1 2 3 4 5 6")
  10. print("2 1 2 3 4 5 6")
  11. print("3 1 2 3 4 5 6")
  12. print("4 1 2 3 4 5 6")
  13. print("5 1 2 3 4 5 6")
  14. print("6 1 2 3 4 5 6")
  15. print("7 1 2 3 4 5 6")
  16. print("8 1 2 3 4 5 6")
  17. print("9 1 2 3 4 5 6")
  18. print("")
  19. print("")
  20. print("")
  21. print("")
  22. print("")
  23. print("")
  24. print(" Annulla selezione Conferma ordine")
  25. end
  26.  
  27. function selezionaQuantita(qx, qy, cod, qt)
  28. term.setCursorPos(qx, qy)
  29. term.setTextColour(colours.lime)
  30. term.write(qt)
  31. end
  32.  
  33.  
  34. clear()
  35. disegnaTabellaPulita()
  36.  
  37. while true do
  38. event, button, x, y = os.pullEvent()
  39. -- Primo silo
  40. if event == "mouse_click" and x == 9 and y == 3 then
  41. selezionaQuantita(9, 3, 11, "1")
  42. elseif event == "mouse_click" and x == 15 and y == 3 then
  43. selezionaQuantita(15, 3, 12, "2")
  44. elseif event == "mouse_click" and x == 21 and y == 3 then
  45. selezionaQuantita(21, 3, 13, "3")
  46. elseif event == "mouse_click" and x == 27 and y == 3 then
  47. selezionaQuantita(27, 3, 14, "4")
  48. elseif event == "mouse_click" and x == 33 and y == 3 then
  49. selezionaQuantita(33, 3, 15, "5")
  50. elseif event == "mouse_click" and x == 39 and y == 3 then
  51. selezionaQuantita(39, 3, 16, "6")
  52. -- Secondo silo
  53. elseif event == "mouse_click" and x == 9 and y == 4 then
  54. selezionaQuantita(9, 4, 21, "1")
  55. elseif event == "mouse_click" and x == 15 and y == 4 then
  56. selezionaQuantita(15, 4, 22, "2")
  57. elseif event == "mouse_click" and x == 21 and y == 4 then
  58. selezionaQuantita(21, 4, 23, "3")
  59. elseif event == "mouse_click" and x == 27 and y == 4 then
  60. selezionaQuantita(27, 4, 24, "4")
  61. elseif event == "mouse_click" and x == 33 and y == 4 then
  62. selezionaQuantita(33, 4, 25, "5")
  63. elseif event == "mouse_click" and x == 39 and y == 4 then
  64. selezionaQuantita(39, 4, 26, "6")
  65. -- Terzo silo
  66. elseif event == "mouse_click" and x == 9 and y == 5 then
  67. selezionaQuantita(9, 5, 31, "1")
  68. elseif event == "mouse_click" and x == 15 and y == 5 then
  69. selezionaQuantita(15, 5, 32, "2")
  70. elseif event == "mouse_click" and x == 21 and y == 5 then
  71. selezionaQuantita(21, 5, 33, "3")
  72. elseif event == "mouse_click" and x == 27 and y == 5 then
  73. selezionaQuantita(27, 5, 34, "4")
  74. elseif event == "mouse_click" and x == 33 and y == 5 then
  75. selezionaQuantita(33, 5, 35, "5")
  76. elseif event == "mouse_click" and x == 39 and y == 5 then
  77. selezionaQuantita(39, 5, 36, "6")
  78. -- Quarto silo
  79. elseif event == "mouse_click" and x == 9 and y == 6 then
  80. selezionaQuantita(9, 6, 41, "1")
  81. elseif event == "mouse_click" and x == 15 and y == 6 then
  82. selezionaQuantita(15, 6, 42, "2")
  83. elseif event == "mouse_click" and x == 21 and y == 6 then
  84. selezionaQuantita(21, 6, 43, "3")
  85. elseif event == "mouse_click" and x == 27 and y == 6 then
  86. selezionaQuantita(27, 6, 44, "4")
  87. elseif event == "mouse_click" and x == 33 and y == 6 then
  88. selezionaQuantita(33, 6, 45, "5")
  89. elseif event == "mouse_click" and x == 39 and y == 6 then
  90. selezionaQuantita(39, 6, 46, "6")
  91. -- Quinto silo
  92. elseif event == "mouse_click" and x == 9 and y == 7 then
  93. selezionaQuantita(9, 7, 51, "1")
  94. elseif event == "mouse_click" and x == 15 and y == 7 then
  95. selezionaQuantita(15, 7, 52, "2")
  96. elseif event == "mouse_click" and x == 21 and y == 7 then
  97. selezionaQuantita(21, 7, 53, "3")
  98. elseif event == "mouse_click" and x == 27 and y == 7 then
  99. selezionaQuantita(27, 7, 54, "4")
  100. elseif event == "mouse_click" and x == 33 and y == 7 then
  101. selezionaQuantita(33, 7, 55, "5")
  102. elseif event == "mouse_click" and x == 39 and y == 7 then
  103. selezionaQuantita(39, 7, 56, "6")
  104. -- Sesto silo
  105. elseif event == "mouse_click" and x == 9 and y == 8 then
  106. selezionaQuantita(9, 8, 61, "1")
  107. elseif event == "mouse_click" and x == 15 and y == 8 then
  108. selezionaQuantita(15, 8, 62, "2")
  109. elseif event == "mouse_click" and x == 21 and y == 8 then
  110. selezionaQuantita(21, 8, 63, "3")
  111. elseif event == "mouse_click" and x == 27 and y == 8 then
  112. selezionaQuantita(27, 8, 64, "4")
  113. elseif event == "mouse_click" and x == 33 and y == 8 then
  114. selezionaQuantita(33, 8, 65, "5")
  115. elseif event == "mouse_click" and x == 39 and y == 8 then
  116. selezionaQuantita(39, 8, 66, "6")
  117. -- Settimo silo
  118. elseif event == "mouse_click" and x == 9 and y == 9 then
  119. selezionaQuantita(9, 9, 71, "1")
  120. elseif event == "mouse_click" and x == 15 and y == 9 then
  121. selezionaQuantita(15, 9, 72, "2")
  122. elseif event == "mouse_click" and x == 21 and y == 9 then
  123. selezionaQuantita(21, 9, 73, "3")
  124. elseif event == "mouse_click" and x == 27 and y == 9 then
  125. selezionaQuantita(27, 9, 74, "4")
  126. elseif event == "mouse_click" and x == 33 and y == 9 then
  127. selezionaQuantita(33, 9, 75, "5")
  128. elseif event == "mouse_click" and x == 39 and y == 9 then
  129. selezionaQuantita(39, 9, 76, "6")
  130. -- Ottavo silo
  131. elseif event == "mouse_click" and x == 9 and y == 10 then
  132. selezionaQuantita(9, 10, 81, "1")
  133. elseif event == "mouse_click" and x == 15 and y == 10 then
  134. selezionaQuantita(15, 10, 82, "2")
  135. elseif event == "mouse_click" and x == 21 and y == 10 then
  136. selezionaQuantita(21, 10, 83, "3")
  137. elseif event == "mouse_click" and x == 27 and y == 10 then
  138. selezionaQuantita(27, 10, 84, "4")
  139. elseif event == "mouse_click" and x == 33 and y == 10 then
  140. selezionaQuantita(33, 10, 85, "5")
  141. elseif event == "mouse_click" and x == 39 and y == 10 then
  142. selezionaQuantita(39, 10, 86, "6")
  143. -- Nono silo
  144. elseif event == "mouse_click" and x == 9 and y == 11 then
  145. selezionaQuantita(9, 11, 91, "1")
  146. elseif event == "mouse_click" and x == 15 and y == 11 then
  147. selezionaQuantita(15, 11, 92, "2")
  148. elseif event == "mouse_click" and x == 21 and y == 11 then
  149. selezionaQuantita(21, 11, 93, "3")
  150. elseif event == "mouse_click" and x == 27 and y == 11 then
  151. selezionaQuantita(27, 11, 94, "4")
  152. elseif event == "mouse_click" and x == 33 and y == 11 then
  153. selezionaQuantita(33, 11, 95, "5")
  154. elseif event == "mouse_click" and x == 39 and y == 11 then
  155. selezionaQuantita(39, 11, 96, "6")
  156.  
  157. --Annulla
  158. elseif event == "mouse_click" and x > 3 and x < 20 and y == 18 then
  159. clear()
  160. disegnaTabellaPulita()
  161. end
  162. end
Advertisement
Add Comment
Please, Sign In to add comment