Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. --   >---------------------->
  2. --  >   Bahnhof-System     >
  3. -- >---------------------->
  4.  
  5.  
  6. local mon = peripheral.wrap("right")
  7.  
  8.    
  9. function Stadtion()
  10.     term.setCursorPos(16,1)
  11.     term.setTextColor(colors.lime)
  12.         print("Bahnhof Stadion")
  13.        
  14.     term.setCursorPos(2,4)
  15.     term.setTextColor(colors.brown)
  16.         print("Colibrie Haus")
  17.         term.setCursorPos(30,24)
  18.         term.setTextColor(colors.lightGray)
  19.             print("Zurucksetzen")
  20.     term.setTextColor(colors.orange)
  21.     term.setCursorPos(2,6)
  22.         print("Haupthaus")    
  23.     term.setTextColor(colors.lightBlue)
  24.     term.setCursorPos(2,8)
  25.         print("Magic Haus")
  26.        
  27.     term.setCursorPos(2,24)
  28.     term.setTextColor(colors.gray)
  29.         print("Hauptmenu")
  30. end
  31.  
  32.  
  33. function turnOff(side, color)
  34.   rs.setBundledOutput(side, colors.subtract(rs.getBundledOutput(side), color))
  35. end
  36. function turnOn(side, color)
  37.   rs.setBundledOutput(side, colors.combine(rs.getBundledOutput(side), color))
  38. end
  39.  
  40. Stadtion()
  41.  
  42. while (true) do
  43.     event,side,x,y = os.pullEvent()
  44.         if event == "monitor_touch" then
  45.             if x > 2 and x < 18 and y == 4 then
  46.                 rs.setBundledOutput("left",rs.getBundledOutput("left") + colors.brown)
  47.                 sleep(2)
  48.             end
  49.            
  50.             if x > 2 and x < 10 and y == 6 then
  51.                 rs.setBundledOutput("left", rs.getBundledOutput("left") + colors.orange)
  52.             end
  53.            
  54.             if x > 2 and x < 11 and y == 8 then
  55.                 rs.setBundledOutput("left",rs.getBundledOutput("left") + colors.lightBlue)
  56.             end
  57.            
  58.             if x > 23 and x < 33 and y == 24 then
  59.                 rs.setBundledOutput("left",rs.getBundledOutput("left") + colors.black)
  60.                 sleep(2)
  61.             end
  62.            
  63.         -- Hauptmenu
  64.             if x > 2 and x < 11 and y == 24 then
  65.                 shell.run("clear")
  66.                 shell.run("Bahnhofanzeige")
  67.             end
  68.         end
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement