Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("top")
  3. o = "back"
  4. gre = false
  5. lib = false
  6. bro = false
  7. yel = false
  8. pur = false
  9. pin = true
  10. lig = true
  11. mag = false
  12. ora = false
  13. m.clear()
  14.  
  15. function fillTable()
  16. button.setTable("Auto Spawner", green, 2,17,5,7)
  17. button.setTable("Witch", lightblue, 2,17,9,11)
  18. button.setTable("Zombie", brown, 2,17,13,15)
  19. button.setTable("Blaze", yellow, 22,37,5,7)
  20. button.setTable("Villager", purple, 22,37,9,11)
  21. button.setTable("Off", turnoff, 15,24,2,4)
  22. button.setTable("<- Door", doorleft, 1,10,1,3)
  23. button.setTable("Door ->", doorright, 29,39,1,3)
  24. button.setTable("Wither Skeleton", magenta, 22,37,13,15)
  25. button.setTable("Light", orange, 15,25,17,19)
  26. button.screen()
  27. end
  28.  
  29. function getClick()
  30. event,side,x,y = os.pullEvent("monitor_touch")
  31. button.checkxy(x,y)
  32. end
  33.  
  34. function turnoff()
  35. button.flash("Off")
  36. if gre then
  37. button.toggleButton("Auto Spawner")
  38. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.green))
  39. gre = false
  40. end
  41. if lib then
  42. button.toggleButton("Witch")
  43. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.lightBlue))
  44. lib = false
  45. end
  46. if bro then
  47. button.toggleButton("Zombie")
  48. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.brown))
  49. bro = false
  50. end
  51. if yel then
  52. button.toggleButton("Blaze")
  53. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.yellow))
  54. yel = false
  55. end
  56. if pur then
  57. button.toggleButton("Villager")
  58. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.purple))
  59. pur = false
  60. end
  61. if mag then
  62. button.toggleButton("Wither Skeleton")
  63. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.magenta))
  64. mag = false
  65. end
  66. end
  67.  
  68. function doorleft()
  69. if pin then
  70. print("pink is now inactive")
  71. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.pink))
  72. else
  73. print("pink is now active")
  74. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.pink))
  75. end
  76. button.toggleButton("<- Door")
  77. pin = not pin
  78. end
  79.  
  80. function doorright()
  81. if lig then
  82. print("lightGray is now inactive")
  83. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.lightGray))
  84. else
  85. print("lightGray is now active")
  86. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.lightGray))
  87. end
  88. button.toggleButton("Door ->")
  89. lig = not lig
  90. end
  91.  
  92. function green()
  93. if gre then
  94. print("green is now inactive")
  95. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.green))
  96. else
  97. print("green is now active")
  98. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.green))
  99. end
  100. button.toggleButton("Auto Spawner")
  101. gre = not gre
  102. end
  103.  
  104. function lightblue()
  105. if lib then
  106. print("light blue is now inactive")
  107. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.lightBlue))
  108. else
  109. print("light blue is now active")
  110. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.lightBlue))
  111. end
  112. button.toggleButton("Witch")
  113. lib = not lib
  114. end
  115.  
  116. function brown()
  117. if bro then
  118. print("brown is now inactive")
  119. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.brown))
  120. else
  121. print("brown is now active")
  122. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.brown))
  123. end
  124. button.toggleButton("Zombie")
  125. bro = not bro
  126. end
  127.  
  128. function yellow()
  129. if yel then
  130. print("yellow is now inactive")
  131. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.yellow))
  132. else
  133. print("yellow is now active")
  134. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.yellow))
  135. end
  136. button.toggleButton("Blaze")
  137. yel = not yel
  138. end
  139.  
  140. function purple()
  141. if pur then
  142. print("purple is now inactive")
  143. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.purple))
  144. else
  145. print("purple is now active")
  146. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.purple))
  147. end
  148. button.toggleButton("Villager")
  149. pur = not pur
  150. end
  151.  
  152. function magenta()
  153. if mag then
  154. print("magenta is now inactive")
  155. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.magenta))
  156. else
  157. print("magenta is now active")
  158. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.magenta))
  159. end
  160. button.toggleButton("Wither Skeleton")
  161. mag = not mag
  162. end
  163.  
  164. function orange()
  165. if ora then
  166. print("orange is now inactive")
  167. rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.orange))
  168. else
  169. print("orange is now active")
  170. rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.orange))
  171. end
  172. button.toggleButton("Light")
  173. ora = not ora
  174. end
  175.  
  176. fillTable()
  177. button.heading("Spawning Control")
  178. rs.setBundledOutput(o,320)
  179. button.toggleButton("Door ->")
  180. button.toggleButton("<- Door")
  181. button.label(2,18,"Cursed Room:")
  182.  
  183. while true do
  184. getClick()
  185. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement