Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("right")
- o = "back"
- gre = false
- lib = false
- bro = false
- yel = false
- pur = false
- m.clear()
- function fillTable()
- button.setTable("Auto Spawner", green, 2,17,4,6)
- button.setTable("Witch", lightblue, 2,17,8,10)
- button.setTable("Zombie", brown, 2,17,12,14)
- button.setTable("Blaze", yellow, 22,37,4,6)
- button.setTable("Villager", purple, 22,37,8,10)
- button.setTable("Off", turnoff, 1,10,1,3)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function (turnoff)
- rs.setBundledOutput(o,0)
- button.flash("Off")
- if gre then
- button.toggleButton("Auto Spawner")
- gre = false
- end
- if lib then
- button.toggleButton("Witch")
- lib = false
- end
- if bro then
- button.toggleButton("Zombie")
- bro = false
- end
- if yel then
- button.toggleButton("Blaze")
- yel = false
- end
- if pur then
- button.toggleButton("Villager")
- pur = false
- end
- end
- function green()
- if gre then
- print("red is now inactive")
- rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.green))
- else
- print("red is now active")
- rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.green))
- end
- button.toggleButton("Auto Spawner")
- gre = not gre
- end
- function lightblue()
- if lib then
- print("light blue is now inactive")
- rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.cyan))
- else
- print("light blue is now active")
- rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.cyan))
- end
- button.toggleButton("Witch")
- lib = not lib
- end
- function brown()
- if bro then
- print("brown is now inactive")
- rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.brown))
- else
- print("brown is now active")
- rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.brown))
- end
- button.toggleButton("Zombie")
- bro = not bro
- end
- function yellow()
- if yel then
- print("yellow is now inactive")
- rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.yellow))
- else
- print("yellow is now active")
- rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.yellow))
- end
- button.toggleButton("Blaze")
- yel = not yel
- end
- function purple()
- if pur then
- print("purple is now inactive")
- rs.setBundledOutput(o,colors.subtract(rs.getBundledOutput(o),colors.purple))
- else
- print("purple is now active")
- rs.setBundledOutput(o,colors.combine(rs.getBundledOutput(o),colors.purple))
- end
- button.toggleButton("Villager")
- pur = not pur
- end
- fillTable()
- button.heading("Test Programm")
- rs.setBundledOutput(o,0)
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement