Advertisement
M0n5t3r

Lift

Jul 24th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. local Height = "floor1"
  2. local up = 0
  3. local z = true
  4.  
  5. -- Floor1 = at 23
  6. -- Floor2 = at 31
  7. -- Floor3 = at 64
  8.  
  9. while z do
  10.  
  11.  --This is to go to Floor3
  12. os.pullEvent("redstone")
  13. if redstone.getOutput("back") and Height == "floor1" then
  14.  
  15.         while up < 41 do
  16.                 redstone.setOutput("front")
  17.                 sleep(1)
  18.                 up = up + 1
  19.         end
  20.         Height = "floor3"
  21.         up = 0
  22.  
  23.                
  24. elseif redstone.getOutput("back") and Height == "floor2" then
  25.         while up < 32 do
  26.             redstone.setOutput("front")
  27.             sleep(1)
  28.             up = up + 1
  29.         end
  30.         Height = "floor3"
  31.         up = 0
  32.  
  33.  
  34. -- This is to go to Floor2
  35. elseif redstone.getOutput("right") and Height == "floor1" then
  36.                 repeat
  37.                                                 redstone.setOutput("front")
  38.                                                 sleep(1)
  39.                                                 up = up + 1
  40.                 until up == 11
  41.                 Height = "floor2"
  42.                 up = 0
  43.  
  44. elseif redstone.getOutput("right") and Height == "floor3" then
  45.                 repeat
  46.                                                 redstone.setOutput("top")
  47.                                                 sleep(1)
  48.                                                 up = up + 1
  49.                 until up == 33
  50.                 Height = "floor2"
  51.                 up = 0
  52.  
  53. -- This is to go to Floor1
  54. elseif redstone.getOutput("left") and Height == "floor2" then
  55.                 repeat
  56.                                                 redstone.setOutput("top")
  57.                                                 sleep(1)
  58.                                                 up = up + 1
  59.                 until up == 11
  60.                 Height = "floor1"
  61.                 up = 0
  62.  
  63. elseif redstone.getOutput("right") and Height == "floor3" then
  64.                 repeat
  65.                                                 redstone.setOutput("top")
  66.                                                 sleep(1)
  67.                                                 up = up + 1
  68.                 until up == 33
  69.                 Height = "floor1"
  70.                 up = 0
  71. end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement