Advertisement
1ng0

XP-Shower

Jul 26th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. ----------------------
  2. --                  --
  3. -- 1ng0`s XP-Shower --
  4. --                  --
  5. ----------------------
  6. redstone.setOutput("front", true)
  7. os.loadAPI("button")
  8. m = peripheral.wrap("bottom")
  9. m.clear()
  10. --screen()
  11.  
  12. function fillTable()
  13.   button.setTable("10 Lvl.", test1, 2,8,2,4)
  14.   button.setTable("20 Lvl.", test2, 11,17,2,4)
  15.   button.setTable("30 Lvl.", test3, 2,8,6,8)
  16.   button.setTable("? Lvl.", test4, 11,17,6,8)
  17.   button.setTable("- Lvl", test5, 2,8,10,12)
  18.   button.setTable("+ Lvl", test6, 11,17,10,12)
  19. end
  20.  
  21.  
  22. function getClick()
  23.   event,side,x,y = os.pullEvent("monitor_touch")
  24.   button.checkxy(x,y)
  25. end
  26.  
  27. function test1()
  28.   button.flash("10 Lvl.")
  29. --  print("10")
  30. end
  31.  
  32. function test2()
  33.   button.flash("20 Lvl.")
  34. --  print("20")
  35. end
  36.  
  37. function test3()
  38.   button.flash("30 Lvl.")
  39. --  print("30")
  40. end
  41.  
  42. function test4()
  43.  
  44. end
  45.  
  46. function test5()
  47.   button.toggleButton("- Lvl")
  48.   if button("- Lvl")("active") then
  49.     redstone.setOutput("back", true)
  50.   else
  51.     redstone.setOutput("back", false)
  52.   end
  53. end
  54.  
  55. function test6()
  56.   button.toggleButton("+ Lvl")
  57.   --if button.toggleButton[+ Lvl]["active"] then
  58.   --  redstone.setOutput("front", false)
  59.   --  button[+ Lvl]["active"] = false
  60.   --else
  61.   --  redstone.setOutput("front", true)
  62.   --  buttons[+ Lvl]["active"] = true
  63.   --end
  64. end
  65.  
  66.  
  67. fillTable()
  68. button.heading("1ng0`s XP-Shower")
  69.  
  70. while true do
  71.   getClick()
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement