Advertisement
Guest User

test

a guest
Feb 7th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("right")
  3. o = "back"
  4. gre = false
  5. lib = false
  6. bro = false
  7. yel = false
  8. pur = false
  9. m.clear()
  10.  
  11. function fillTable()
  12. button.setTable("Auto Spawner", green, 5,20,3,5)
  13. button.setTable("Witch", lightblue, 5,20,7,9)
  14. button.setTable("Zombie", brown, 5,20,11,13)
  15. button.setTable("Blaze", yellow, 25,40,3,5)
  16. button.setTable("Villager", purple, 25,40,7,9)
  17. button.screen()
  18. end
  19.  
  20. function getClick()
  21. event,side,x,y = os.pullEvent("monitor_touch")
  22. button.checkxy(x,y)
  23. end
  24.  
  25. function green()
  26. if gre then
  27. print("red is now inactive")
  28. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.green))
  29. else
  30. print("red is now active")
  31. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.green))
  32. end
  33. button.toggleButton("Auto Spawner")
  34. gre = not gre
  35. end
  36.  
  37. function lightblue()
  38. if lib then
  39. print("light blue is now inactive")
  40. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.cyan))
  41. else
  42. print("light blue is now active")
  43. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.cyan))
  44. end
  45. button.toggleButton("Witch")
  46. lib = not lib
  47. end
  48.  
  49. function brown()
  50. if bro then
  51. print("brown is now inactive")
  52. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.brown))
  53. else
  54. print("brown is now active")
  55. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.brown))
  56. end
  57. button.toggleButton("Zombie")
  58. bro = not bro
  59. end
  60.  
  61. function yellow()
  62. if yel then
  63. print("yellow is now inactive")
  64. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.yellow))
  65. else
  66. print("yellow is now active")
  67. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.yellow))
  68. end
  69. button.toggleButton("Blaze")
  70. yel = not yel
  71. end
  72.  
  73. function purple()
  74. if pur then
  75. print("purple is now inactive")
  76. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.purple))
  77. else
  78. print("purple is now active")
  79. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.purple))
  80. end
  81. button.toggleButton("Villager")
  82. pur = not pur
  83. end
  84.  
  85. fillTable()
  86. button.heading("Test Programm")
  87. rs.setBundledOutput(o,0)
  88.  
  89. while true do
  90. getClick()
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement