Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- local m = peripheral.wrap("right")
- local rsOut = {}
- local buttonColors = {}
- function fillMainTable()
- m.clear()
- button.clearTable()
- button.setTable("Button1", mob1, "", 4, 17, 2, 4)
- button.setTable("Button2", mob2, "", 20, 33, 2, 4)
- button.setTable("Button3", mob3, "", 4, 17, 6, 8)
- button.setTable("Button4", mob4, "", 20, 33, 6, 8)
- button.setTable("Button5", mob5, "", 4, 17, 10, 12)
- button.setTable("Button6", mob6, "", 20, 33, 10, 12)
- button.setTable("Button7", mob7, "", 4, 17, 14, 16)
- button.setTable("Button8", mob8, "", 20, 33, 14, 16)
- print("Programm gestartet...")
- button.screen()
- m.setTextScale(1,6)
- m.setCursorPos(14,1)
- m.write("MOB SPAWNER")
- end
- function initRS()
- rsOut[colors.white] = true
- rsOut[colors.orange] = true
- rsOut[colors.magenta] = true
- rsOut[colors.lightBlue] = true
- rsOut[colors.yellow] = true
- rsOut[colors.lime] = true
- rsOut[colors.brown] = true
- rsOut[colors.green] = true
- buttonColors["Button1"] = colors.white
- buttonColors["Button2"] = colors.orange
- buttonColors["Button3"] = colors.magenta
- buttonColors["Button4"] = colors.lightBlue
- buttonColors["Button5"] = colors.yellow
- buttonColors["Button6"] = colors.lime
- buttonColors["Button7"] = colors.brown
- buttonColors["Button8"] = colors.green
- end
- function setRS()
- local colorOutput = 0
- for i,j in pairs(rsOut) do
- if j then colorOutput = colorOutput + i end
- end
- rs.setBundledOutput("back", colorOutput)
- end
- function mob1()
- button.toggleButton("Button1")
- rsOut[colors.white] = not rsOut[colors.white]
- setRS()
- end
- function mob2()
- button.toggleButton("Button2")
- rsOut[colors.orange] = not rsOut[colors.orange]
- setRS()
- end
- function mob3()
- button.toggleButton("Button3")
- rsOut[colors.magenta] = not rsOut[colors.magenta]
- setRS()
- end
- function mob4()
- button.toggleButton("Button4")
- rsOut[colors.lightBlue] = not rsOut[colors.lightBlue]
- setRS()
- end
- function mob5()
- button.toggleButton("Button5")
- rsOut[colors.yellow] = not rsOut[colors.yellow]
- setRS()
- end
- function mob6()
- button.toggleButton("Button6")
- rsOut[colors.lime] = not rsOut[colors.lime]
- setRS()
- end
- function mob7()
- button.toggleButton("Button7")
- rsOut[colors.brown] = not rsOut[colors.brown]
- setRS()
- end
- function mob8()
- button.toggleButton("Button8")
- rsOut[colors.green] = not rsOut[colors.green]
- setRS()
- end
- function getClick()
- local event,side,x,y = os.pullEvent()
- if event=="monitor_touch" then
- button.checkxy(x,y)
- end
- end
- initRS()
- setRS()
- fillMainTable()
- while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement