Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clear()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function disegnaTabellaPulita()
- print("SILOS QUANTITA' RICHIESTA")
- print("")
- print("1 1 2 3 4 5 6")
- print("2 1 2 3 4 5 6")
- print("3 1 2 3 4 5 6")
- print("4 1 2 3 4 5 6")
- print("5 1 2 3 4 5 6")
- print("6 1 2 3 4 5 6")
- print("7 1 2 3 4 5 6")
- print("8 1 2 3 4 5 6")
- print("9 1 2 3 4 5 6")
- print("")
- print("")
- print("")
- print("")
- print("")
- print("")
- print(" Annulla selezione Conferma ordine")
- end
- function selezionaQuantita(qx, qy, cod, qt)
- term.setCursorPos(qx, qy)
- term.setTextColour(colours.lime)
- term.write(qt)
- end
- clear()
- disegnaTabellaPulita()
- while true do
- event, button, x, y = os.pullEvent()
- -- Primo silo
- if event == "mouse_click" and x == 9 and y == 3 then
- selezionaQuantita(9, 3, 11, "1")
- elseif event == "mouse_click" and x == 15 and y == 3 then
- selezionaQuantita(15, 3, 12, "2")
- elseif event == "mouse_click" and x == 21 and y == 3 then
- selezionaQuantita(21, 3, 13, "3")
- elseif event == "mouse_click" and x == 27 and y == 3 then
- selezionaQuantita(27, 3, 14, "4")
- elseif event == "mouse_click" and x == 33 and y == 3 then
- selezionaQuantita(33, 3, 15, "5")
- elseif event == "mouse_click" and x == 39 and y == 3 then
- selezionaQuantita(39, 3, 16, "6")
- -- Secondo silo
- elseif event == "mouse_click" and x == 9 and y == 4 then
- selezionaQuantita(9, 4, 21, "1")
- elseif event == "mouse_click" and x == 15 and y == 4 then
- selezionaQuantita(15, 4, 22, "2")
- elseif event == "mouse_click" and x == 21 and y == 4 then
- selezionaQuantita(21, 4, 23, "3")
- elseif event == "mouse_click" and x == 27 and y == 4 then
- selezionaQuantita(27, 4, 24, "4")
- elseif event == "mouse_click" and x == 33 and y == 4 then
- selezionaQuantita(33, 4, 25, "5")
- elseif event == "mouse_click" and x == 39 and y == 4 then
- selezionaQuantita(39, 4, 26, "6")
- -- Terzo silo
- elseif event == "mouse_click" and x == 9 and y == 5 then
- selezionaQuantita(9, 5, 31, "1")
- elseif event == "mouse_click" and x == 15 and y == 5 then
- selezionaQuantita(15, 5, 32, "2")
- elseif event == "mouse_click" and x == 21 and y == 5 then
- selezionaQuantita(21, 5, 33, "3")
- elseif event == "mouse_click" and x == 27 and y == 5 then
- selezionaQuantita(27, 5, 34, "4")
- elseif event == "mouse_click" and x == 33 and y == 5 then
- selezionaQuantita(33, 5, 35, "5")
- elseif event == "mouse_click" and x == 39 and y == 5 then
- selezionaQuantita(39, 5, 36, "6")
- -- Quarto silo
- elseif event == "mouse_click" and x == 9 and y == 6 then
- selezionaQuantita(9, 6, 41, "1")
- elseif event == "mouse_click" and x == 15 and y == 6 then
- selezionaQuantita(15, 6, 42, "2")
- elseif event == "mouse_click" and x == 21 and y == 6 then
- selezionaQuantita(21, 6, 43, "3")
- elseif event == "mouse_click" and x == 27 and y == 6 then
- selezionaQuantita(27, 6, 44, "4")
- elseif event == "mouse_click" and x == 33 and y == 6 then
- selezionaQuantita(33, 6, 45, "5")
- elseif event == "mouse_click" and x == 39 and y == 6 then
- selezionaQuantita(39, 6, 46, "6")
- -- Quinto silo
- elseif event == "mouse_click" and x == 9 and y == 7 then
- selezionaQuantita(9, 7, 51, "1")
- elseif event == "mouse_click" and x == 15 and y == 7 then
- selezionaQuantita(15, 7, 52, "2")
- elseif event == "mouse_click" and x == 21 and y == 7 then
- selezionaQuantita(21, 7, 53, "3")
- elseif event == "mouse_click" and x == 27 and y == 7 then
- selezionaQuantita(27, 7, 54, "4")
- elseif event == "mouse_click" and x == 33 and y == 7 then
- selezionaQuantita(33, 7, 55, "5")
- elseif event == "mouse_click" and x == 39 and y == 7 then
- selezionaQuantita(39, 7, 56, "6")
- -- Sesto silo
- elseif event == "mouse_click" and x == 9 and y == 8 then
- selezionaQuantita(9, 8, 61, "1")
- elseif event == "mouse_click" and x == 15 and y == 8 then
- selezionaQuantita(15, 8, 62, "2")
- elseif event == "mouse_click" and x == 21 and y == 8 then
- selezionaQuantita(21, 8, 63, "3")
- elseif event == "mouse_click" and x == 27 and y == 8 then
- selezionaQuantita(27, 8, 64, "4")
- elseif event == "mouse_click" and x == 33 and y == 8 then
- selezionaQuantita(33, 8, 65, "5")
- elseif event == "mouse_click" and x == 39 and y == 8 then
- selezionaQuantita(39, 8, 66, "6")
- -- Settimo silo
- elseif event == "mouse_click" and x == 9 and y == 9 then
- selezionaQuantita(9, 9, 71, "1")
- elseif event == "mouse_click" and x == 15 and y == 9 then
- selezionaQuantita(15, 9, 72, "2")
- elseif event == "mouse_click" and x == 21 and y == 9 then
- selezionaQuantita(21, 9, 73, "3")
- elseif event == "mouse_click" and x == 27 and y == 9 then
- selezionaQuantita(27, 9, 74, "4")
- elseif event == "mouse_click" and x == 33 and y == 9 then
- selezionaQuantita(33, 9, 75, "5")
- elseif event == "mouse_click" and x == 39 and y == 9 then
- selezionaQuantita(39, 9, 76, "6")
- -- Ottavo silo
- elseif event == "mouse_click" and x == 9 and y == 10 then
- selezionaQuantita(9, 10, 81, "1")
- elseif event == "mouse_click" and x == 15 and y == 10 then
- selezionaQuantita(15, 10, 82, "2")
- elseif event == "mouse_click" and x == 21 and y == 10 then
- selezionaQuantita(21, 10, 83, "3")
- elseif event == "mouse_click" and x == 27 and y == 10 then
- selezionaQuantita(27, 10, 84, "4")
- elseif event == "mouse_click" and x == 33 and y == 10 then
- selezionaQuantita(33, 10, 85, "5")
- elseif event == "mouse_click" and x == 39 and y == 10 then
- selezionaQuantita(39, 10, 86, "6")
- -- Nono silo
- elseif event == "mouse_click" and x == 9 and y == 11 then
- selezionaQuantita(9, 11, 91, "1")
- elseif event == "mouse_click" and x == 15 and y == 11 then
- selezionaQuantita(15, 11, 92, "2")
- elseif event == "mouse_click" and x == 21 and y == 11 then
- selezionaQuantita(21, 11, 93, "3")
- elseif event == "mouse_click" and x == 27 and y == 11 then
- selezionaQuantita(27, 11, 94, "4")
- elseif event == "mouse_click" and x == 33 and y == 11 then
- selezionaQuantita(33, 11, 95, "5")
- elseif event == "mouse_click" and x == 39 and y == 11 then
- selezionaQuantita(39, 11, 96, "6")
- --Annulla
- elseif event == "mouse_click" and x > 3 and x < 20 and y == 18 then
- clear()
- disegnaTabellaPulita()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment