meuced

TableMaster

Oct 6th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function menu()
  2.   m.setBackgroundColor(colors.cyan)
  3.   m.clear()
  4.   m.setTextScale(1)
  5.   m.setBackgroundColor(colors.yellow)
  6.   m.setTextColor(colors.red)
  7.   m.setCursorPos(1,1)
  8.   m.write(" Lvl 0  ")
  9.   m.setCursorPos(1,3)
  10.   m.write(" Lvl 1  ")
  11.   m.setCursorPos(1,5)
  12.   m.write(" Lvl 4  ")
  13.   m.setCursorPos(1,7)
  14.   m.write(" Lvl 6  ")
  15.   m.setCursorPos(1,9)
  16.   m.write(" Lvl 11 ")
  17.   m.setCursorPos(1,11)
  18.   m.write(" Lvl 12 ")
  19.   m.setCursorPos(1,13)
  20.   m.write(" Lvl 15 ")
  21. end
  22.  
  23.  
  24. m = peripheral.wrap("top")
  25.  
  26. x, y = m.getSize()
  27.  
  28. print(x.." "..y)
  29.  
  30. --rednet.open("bottom")
  31.  
  32. --rednet.broadcast("hello")
  33.  
  34. --rednet.close("bottom")
  35.  
  36. menu()
  37. sleep(10)
  38. rednet.open("bottom")
  39. rednet.broadcast("111111111111111")
  40. sleep(0.5)
  41. rednet.broadcast("000000000000000")
  42. rednet.close("bottom")
  43.  
  44. while true do
  45.   event, side, xPos, yPos = os.pullEvent("monitor_touch")
  46.   rednet.open("bottom")
  47.   print("clic "..xPos.." "..yPos)
  48.   if yPos == 1 then
  49.     rednet.broadcast("000000000000000")
  50.     print("xPos = "..xPos.." et yPos = "..yPos)
  51.   elseif yPos == 3 then
  52.     rednet.broadcast("000000010000000")
  53.     print("xPos = "..xPos.." et yPos = "..yPos)
  54.   elseif yPos == 5 then
  55.     rednet.broadcast("000010101010000")
  56.     print("xPos = "..xPos.." et yPos = "..yPos)
  57.   elseif yPos == 7 then
  58.     rednet.broadcast("000011101110000")
  59.     print("xPos = "..xPos.." et yPos = "..yPos)
  60.   elseif yPos == 9 then
  61.     rednet.broadcast("001111111111100")
  62.     print("xPos = "..xPos.." et yPos = "..yPos)
  63.   elseif yPos == 11 then
  64.     rednet.broadcast("011111101111110")
  65.     print("xPos = "..xPos.." et yPos = "..yPos)
  66.   elseif yPos == 13 then
  67.     rednet.broadcast("111111111111111")
  68.     print("xPos = "..xPos.." et yPos = "..yPos)
  69.   end
  70.   rednet.close("bottom")
  71. end
Add Comment
Please, Sign In to add comment