Advertisement
Xyzzy

MultiFloorLift - startup

Jan 19th, 2013
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. local inS = "right"
  2. local otS = "left"
  3.  
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print("Elevator Program Running...")
  7.  
  8. while true do
  9.   if rs.getBundledInput(inS) == 1 then
  10.     shell.run("call-bottom")
  11.   elseif rs.getBundledInput(inS) == 2 then
  12.     shell.run("F4-F3")
  13.   elseif rs.getBundledInput(inS) == 4 then
  14.     shell.run("F4-F2")
  15.   elseif rs.getBundledInput(inS) == 8 then
  16.     shell.run("F4-F1")
  17.   elseif rs.getBundledInput(inS) == 16 then
  18.     shell.run("call-floor3")  
  19.   elseif rs.getBundledInput(inS) == 32 then
  20.     shell.run("F3-F4")
  21.   elseif rs.getBundledInput(inS) == 64 then
  22.     shell.run("F3-F2")
  23.   elseif rs.getBundledInput(inS) == 128 then
  24.     shell.run("F3-F1")
  25.   elseif rs.getBundledInput(inS) == 256 then
  26.     shell.run("call-floor2")
  27.   elseif rs.getBundledInput(inS) == 512 then
  28.     shell.run("F2-F4")
  29.   elseif rs.getBundledInput(inS) == 1024 then
  30.     shell.run("F2-F3")
  31.   elseif rs.getBundledInput(inS) == 2048 then
  32.     shell.run("F2-F1")
  33.   elseif rs.getBundledInput(inS) == 4096 then
  34.     shell.run("call-floor1")
  35.   elseif rs.getBundledInput(inS) == 8192 then
  36.     shell.run("F1-F4")
  37.   elseif rs.getBundledInput(inS) == 16384 then
  38.     shell.run("F1-F3")
  39.   elseif rs.getBundledInput(inS) == 32768 then
  40.     shell.run("F1-F2")
  41.   else
  42.   sleep(0)
  43.   end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement