Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- os.loadAPI("varRegister")
- m = peripheral.wrap("monitor_11")
- m.clear()
- function fillTable()
- button.setTable("Wither", s1, 3,16,2,4)
- button.setTable("Enderman", s2, 3,16,6,8)
- button.setTable("Witch", s3, 3,16,10,12)
- button.setTable("Wisp", s4, 3,16,14,16)
- button.setTable("Guardian", s5,3,16,18,20)
- button.setTable("bla", s6,3,16,22,24)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function s1()
- button.flash("Wither")
- if varRegister.loadVar("s1") == "off" then
- varRegister.saveVar("s1", "on")
- else
- varRegister.saveVar("s1", "off")
- end
- check()
- end
- function s2()
- button.flash("Enderman")
- if varRegister.loadVar("s2") == "off" then
- varRegister.saveVar("s2", "on")
- else
- varRegister.saveVar("s2", "off")
- end
- check()
- end
- function s3()
- button.flash("Witch")
- if varRegister.loadVar("s3") == "off" then
- varRegister.saveVar("s3", "on")
- else
- varRegister.saveVar("s3", "off")
- end
- check()
- end
- function s4()
- button.flash("Wisp")
- if varRegister.loadVar("s4") == "off" then
- varRegister.saveVar("s4", "on")
- else
- varRegister.saveVar("s4", "off")
- end
- check()
- end
- function s5()
- button.flash("Guardian")
- if varRegister.loadVar("s5") == "off" then
- varRegister.saveVar("s5", "on")
- else
- varRegister.saveVar("s5", "off")
- end
- check()
- end
- function s6()
- button.flash("bla")
- if varRegister.loadVar("s6") == "off" then
- varRegister.saveVar("s6", "on")
- else
- varRegister.saveVar("s6", "off")
- end
- check()
- end
- fillTable()
- while true do
- function check()
- if varRegister.loadVar("s1") == "on" then
- c1 = 1
- ss1 = 1
- else
- c1 = 2
- ss1 = 0
- end
- if varRegister.loadVar("s2") == "on" then
- ss2 = 4
- c2 = 1
- else
- c2 = 2
- ss2 = 0
- end
- if varRegister.loadVar("s3") == "on" then
- ss3 = 2048
- c3 = 1
- else
- c3 = 2
- ss3 = 0
- end
- if varRegister.loadVar("s4") == "on" then
- ss4 = 8192
- c4 = 1
- else
- c4 = 2
- ss4 = 0
- end
- if varRegister.loadVar("s5") == "on" then
- ss5 = 16384
- c5 = 1
- else
- c5 = 2
- ss5 = 0
- end
- if varRegister.loadVar("s6") == "on" then
- ss6 = 32768
- c6 = 1
- else
- c6 = 2
- ss6 = 0
- end
- bc = ss1 + ss2 + ss3 + ss4 + ss5 + ss6
- redstone.setBundledOutput("back", bc)
- m.setCursorPos(21, 3)
- if c1 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.write(varRegister.loadVar("s1").. " ")
- m.setCursorPos(21, 7)
- if c2 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.write(varRegister.loadVar("s2").. " ")
- if c3 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.setCursorPos(21, 11)
- m.write(varRegister.loadVar("s3").. " ")
- if c4 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.setCursorPos(21, 15)
- m.write(varRegister.loadVar("s4").. " ")
- if c5 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.setCursorPos(21, 19)
- m.write(varRegister.loadVar("s5").. " ")
- if c6 == 1 then
- m.setTextColor(colors.green)
- else
- m.setTextColor(colors.red)
- end
- m.setCursorPos(21, 23)
- m.write(varRegister.loadVar("s6").. " ")
- m.setTextColor(colors.white)
- end
- check()
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement