Homerdu29Off

poket computer

Dec 10th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.46 KB | None | 0 0
  1. modem = peripheral.wrap("back")
  2.  
  3. mainMenu = true
  4. menuStargate = false
  5. function TouchScreen()
  6.     term.setBackgroundColor(colors.black)
  7.     local event, side, arg1, arg2 = os.pullEvent()
  8.    
  9.     if event == "mouse_click" then
  10.         if (arg1 > 8 and arg1 < 19) and
  11.            (arg2 > 0 and arg2 < 2) then
  12.            menuStargate = false
  13.            menuDoors = false
  14.            mainMenu = true
  15.        
  16.         elseif (arg1 > 1 and arg1 < 12) and
  17.            (arg2 > 5 and arg2 < 7) and
  18.            mainMenu == true then
  19.         mainMenu = false
  20.         menuDoors = true
  21.         elseif (arg1 > 1 and arg1 < 12) and
  22.            (arg2 > 6 and arg2 < 8) and
  23.            mainMenu == true then
  24.         mainMenu = false
  25.         menuStargate = true
  26.         end
  27.     end    
  28. end
  29.  
  30. while true do
  31.     TouchScreen()
  32.     term.clear()
  33.     term.setBackgroundColor(colors.black)
  34.     term.setCursorPos(1,1)
  35.     term.setTextColor(colors.white)
  36.     print("O------O          O------O")
  37.     print("|      O----------O      |")
  38.     print("|                        |")
  39.     print("O------------------------O")
  40.     print("|                        |")
  41.     print("|                        |")
  42.     print("|                        |")
  43.     print("|                        |")
  44.     print("|                        |")
  45.     print("|                        |")
  46.     print("|                        |")
  47.     print("|                        |")
  48.     print("|                        |")
  49.     print("|                        |")
  50.     print("|                        |")
  51.     print("|                        |")
  52.     print("|                        |")
  53.     print("|                        |")
  54.     print("O------------------------O")
  55.        
  56.     term.setCursorPos(9,1)
  57.     term.setTextColor(colors.green)
  58.     print("\\Tablette/")
  59.    
  60.     if mainMenu == true then
  61.         term.setCursorPos(7,3)
  62.         term.setTextColor(colors.blue)
  63.         print("Menu Principal")
  64.         -----------
  65.         term.setCursorPos(2,6)
  66.         term.setTextColor(colors.white)
  67.         term.setBackgroundColor(colors.cyan)
  68.         print("  Portes  ")
  69.        
  70.         term.setCursorPos(2,7)
  71.         term.setTextColor(colors.white)
  72.         term.setBackgroundColor(colors.orange)
  73.         print(" Stargate ")
  74.        
  75.     elseif menuStargate == true then
  76.         term.setCursorPos(10,3)
  77.         term.setTextColor(colors.orange)
  78.         print("Stargate")
  79.     elseif menuDoors == true then
  80.         term.setCursorPos(11,3)
  81.         term.setTextColor(colors.cyan)
  82.         print("Portes")
  83.     end
  84.     sleep(0.5)
  85. end
Advertisement
Add Comment
Please, Sign In to add comment