Advertisement
rhn

Submarine base

rhn
Jul 28th, 2013
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. --Colour assignments:
  2. --White(1): Open hangar
  3. --Orange(2): Close hangar
  4. --Magenta(4): Retract gangplank
  5. --Lightblue(8): Extend gangplank
  6. --Yellow(16): Close doors
  7. --Lime(32): Howler alarm
  8. --Pink(64): Input lever
  9.  
  10. s=0
  11. while true do
  12. if (redstone.testBundledInput("top",64)) == true and s==0 then
  13.     print("Hangar doors opening")
  14.     --Sound alarm
  15.     redstone.setBundledOutput("top",32)
  16.     sleep(5)
  17.     redstone.setBundledOutput("top",0)
  18.     --Close doors
  19.     redstone.setBundledOutput("top",16)
  20.     sleep(1)
  21.     --Retract gangplank
  22.     for i = 1,2 do
  23.         redstone.setBundledOutput("top",4+16)
  24.         sleep(0.5)
  25.         redstone.setBundledOutput("top",16)
  26.         sleep(0.5)
  27.     end
  28.     --Open hangar doors
  29.     for i = 1,4 do
  30.         redstone.setBundledOutput("top",1+16)
  31.         sleep(0.5)
  32.         redstone.setBundledOutput("top",16)
  33.         sleep(0.5)
  34.     end
  35.     print("Hangar doors open")
  36.     s=1
  37. end
  38. if (redstone.testBundledInput("top",64)) == false and s==1 then
  39.     print("Hangar doors closing")
  40.     --Close hangar doors
  41.     for i = 1,4 do
  42.         redstone.setBundledOutput("top",2+16)
  43.         sleep(0.5)
  44.         redstone.setBundledOutput("top",16)
  45.         sleep(0.5)
  46.     end
  47.     print("Hangar doors closed")
  48.     sleep(10)
  49.     --Extend gangplank
  50.         for i = 1,2 do
  51.         redstone.setBundledOutput("top",8+16)
  52.         sleep(0.5)
  53.         redstone.setBundledOutput("top",16)
  54.         sleep(0.5)
  55.     end
  56.     sleep(1)
  57.     --Open doors
  58.     redstone.setBundledOutput("top",0)
  59.     --Sound clear alarm
  60.     redstone.setBundledOutput("top",32)
  61.     sleep(0.5)
  62.     redstone.setBundledOutput("top",0)
  63.     s=0
  64. end
  65. sleep(1)
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement