Advertisement
Guest User

startup

a guest
Dec 21st, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. os.loadAPI("button")
  2. M = peripheral.wrap("monitor_0")
  3. M.clear()
  4. C = peripheral.wrap("container_chest_1")
  5.  
  6. function fillTable()
  7.   button.setTable("Old Warehouse", test1, 5, 23, 3, 5)
  8.   button.setTable("The Factory", theFactory, 27, 45, 3, 5)
  9.   button.setTable("Wither Spawning", wither, 5, 23, 7, 9)
  10.   button.setTable("Deep Dark", deepDark, 27, 45, 7, 9)
  11.   button.setTable("Nether", nether, 5, 23, 11, 13)
  12.   button.screen()
  13. end
  14.  
  15. function getClick()
  16.   event,side,x,y = os.pullEvent("monitor_touch")
  17.   button.checkxy(x,y)
  18. end
  19.  
  20. function test1()
  21.   button.flash("Old Warehouse")
  22.   print("Activating portal to Old Warehouse")
  23.   activatePortal(1)
  24. end
  25.  
  26. function theFactory()
  27.   button.flash("The Factory")
  28.   print("Activating portal to the factory")
  29.   activatePortal(2)
  30. end
  31.  
  32. function wither()
  33.   button.flash("Wither Spawning")
  34.   print("Activating portal to the wither")
  35.   activatePortal(3)
  36. end
  37.  
  38. function deepDark()
  39.   button.flash("Deep Dark")
  40.   print("Activating portal to the deep dark")
  41.   activatePortal(4)
  42. end
  43.  
  44. function nether()
  45.   button.flash("Nether")
  46.   print("Activating portal to the Nether")
  47.   activatePortal(5)
  48. end
  49.  
  50. function activatePortal(value)
  51.   redstone.setOutput("right",true)
  52.   sleep(1)
  53.   C.pushItem("up",value)
  54.   sleep(5)
  55.   C.pullItem("up",1,value)
  56.   redstone.setOutput("right",false)
  57. end
  58.  
  59.  
  60. fillTable()
  61. button.heading("Choose your destination wisely!")
  62. while true do
  63.   getClick()
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement