Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function menu()
- m.setBackgroundColor(colors.cyan)
- m.clear()
- m.setTextScale(1)
- m.setBackgroundColor(colors.yellow)
- m.setTextColor(colors.red)
- m.setCursorPos(1,1)
- m.write(" Lvl 0 ")
- m.setCursorPos(1,3)
- m.write(" Lvl 1 ")
- m.setCursorPos(1,5)
- m.write(" Lvl 4 ")
- m.setCursorPos(1,7)
- m.write(" Lvl 6 ")
- m.setCursorPos(1,9)
- m.write(" Lvl 11 ")
- m.setCursorPos(1,11)
- m.write(" Lvl 12 ")
- m.setCursorPos(1,13)
- m.write(" Lvl 15 ")
- end
- m = peripheral.wrap("top")
- x, y = m.getSize()
- print(x.." "..y)
- --rednet.open("bottom")
- --rednet.broadcast("hello")
- --rednet.close("bottom")
- menu()
- sleep(10)
- rednet.open("bottom")
- rednet.broadcast("111111111111111")
- sleep(0.5)
- rednet.broadcast("000000000000000")
- rednet.close("bottom")
- while true do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- rednet.open("bottom")
- print("clic "..xPos.." "..yPos)
- if yPos == 1 then
- rednet.broadcast("000000000000000")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 3 then
- rednet.broadcast("000000010000000")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 5 then
- rednet.broadcast("000010101010000")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 7 then
- rednet.broadcast("000011101110000")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 9 then
- rednet.broadcast("001111111111100")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 11 then
- rednet.broadcast("011111101111110")
- print("xPos = "..xPos.." et yPos = "..yPos)
- elseif yPos == 13 then
- rednet.broadcast("111111111111111")
- print("xPos = "..xPos.." et yPos = "..yPos)
- end
- rednet.close("bottom")
- end
Add Comment
Please, Sign In to add comment