Advertisement
Guest User

elevator

a guest
Jun 13th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. glass = peripheral.wrap("right")
  2.  
  3. MonU3 = peripheral.wrap("monitor_0")
  4. MonU2 = peripheral.wrap("monitor_1")
  5. MonU1 = peripheral.wrap("monitor_2")
  6. MonE  = peripheral.wrap("monitor_3")
  7. Mon1  = peripheral.wrap("monitor_4")
  8. Mon2  = peripheral.wrap("monitor_5")
  9. Nr = 0
  10. lastColor = 1
  11. allColors = 0
  12.  
  13. lastLevel = 0
  14.  
  15. level = {[16384] = "U3" , [8192] = "U2" , [4096] = "U1" , [2048] = "E" , [1024] = "1" , [512] = "2" }
  16. while true do
  17.  
  18.   event = os.pullEvent("redstone")
  19.   Nr = Nr +1
  20.   allColors = redstone.getBundledInput("left")
  21.  
  22.   if allColors ~= 0 then
  23.        
  24.       if colors.test(allColors,lastColor) == true then
  25.         lastRealElevatorCOlor = allColors
  26.       else
  27.         lastColor = colors.subtract(allColors, lastRealElevatorColor)
  28.       end
  29.   end
  30.    
  31.  
  32.   if lastColor ~= lastLevel then
  33.     ColorNr = tonumber(lastColor)
  34.    
  35.      
  36.     print("Letzte Etage: "..lastColor)
  37.    
  38.     glass.clear()
  39.     glass.addText(5,2,"Letzte Etage: "..level[lastColor],0xFF0000)
  40.     glass.sync()
  41.   end
  42.   lastLevel = lastColor
  43. end
  44.  
  45. function DisplayAllDisplays(Message)
  46.  
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement