Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("touchpoint")
- --FINESTRES------------------------
- mprin = touchpoint.new("monitor_1")
- mcasc = touchpoint.new("monitor_1")
- --PERIFERICS-----------------------
- pim = peripheral.wrap("pim_0")
- --MENU PRINCIPAL-------------------
- mprin:add("Casc",nil, 2,2,14,5, colors.blue, colors.lime)
- --MENU CASC------------------------
- mcasc:add("Equipar ulleres",nil, 2,2,28,4, colors.orange, colors.blue)
- mcasc:add("Equipar casc",nil,2,5,28,7, colors.orange, colors.blue)
- mcasc:add("Menu principal", nil,2,8,28,10, colors.red, colors.orange)
- --FUNCIONS-------------------------
- function eulleres()
- pim.pushItemIntoSlot("west",40,1,2)
- pim.pullItemIntoSlot("west",1,1,40)
- end
- function ecasc()
- pim.pushItemIntoSlot("west",40,1,1)
- pim.pullItemIntoSlot("west",2,1,40)
- end
- --PROGRAMA PRINCIPAL----------------
- while true do
- mprin:draw()
- local event, p1 = mprin:handleEvents(os.pullEvent())
- if event == "button_click" and p1 == "Casc" then
- mcasc:draw()
- while true do
- local event, p1 = mcasc:handleEvents(os.pullEvent())
- if event == "button_click" and p1 == "Equipar ulleres" then
- mcasc:flash("Equipar ulleres")
- eulleres()
- elseif event == "button_click" and p1 == "Equipar casc" then
- mcasc:flash("Equipar casc")
- ecasc()
- elseif event == "button_click" and p1 == "Menu principal" then
- mcasc:flash("Menu principal")
- break
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement