Advertisement
Guest User

storage_elevator

a guest
Jul 4th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. --This program is designed to operate the storage
  2. --silo elevator.
  3.  
  4. os.loadAPI("button")
  5. m = peripheral.wrap("back")
  6. m.clear()
  7.  
  8. function fillTable()
  9.   print("Printing Table")
  10.   button.setTable("Up", up, 1, 9, 2, 4)
  11.   button.setTable("Exit", exit, 11, 19, 2, 4)
  12.   button.setTable("Down", down, 21, 29, 2, 4)
  13.   button.screen()  
  14. end
  15.  
  16. function getClick()
  17.   event,side,x,y = os.pullEvent("monitor_touch")
  18.   button.checkxy(x,y)
  19. end
  20.  
  21. function up()
  22.   button.flash("Up")
  23.   redstone.setOutput("right",true)
  24.   sleep(1)
  25.   redstone.setOutput("right",false)
  26. end
  27.  
  28. function down()
  29.   button.flash("Down")
  30.   redstone.setOutput("left", true)
  31.   sleep(1)
  32.   redstone.setOutput("left", false)
  33. end
  34.  
  35. function exit()
  36.   button.flash("Exit")
  37. end
  38.  
  39. fillTable()
  40. button.heading(" Elevator")
  41. --button.label(1,5,"test")
  42.  
  43. while true do
  44.   getClick()
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement