Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function println(s) print(s .. "\n") end
- codes = {
- ["all"] = false,
- ["bedL"] = colors.white,
- ["bedW"] = colors.orange,
- ["hallL"] = colors.magenta,
- ["hallW"] = colors.lightBlue,
- ["craftL"] = colors.yellow,
- ["craftW"] = colors.lime,
- ["mainL"] = colors.pink,
- ["mainW"] = colors.gray,
- ["none"] = false
- }
- side = "back"
- state = redstone.getBundledInput(side)
- while true do
- print("Enter device: ")
- device = io.read()
- if codes[device] == nil then
- println("Invalid device")
- else
- if device == "all" then
- state = 0x7FFF
- println("Turned everything on")
- elseif device == "none" then
- state = 0
- println("Turned everything off")
- elseif colors.test(state, codes[device]) then
- state = colors.subtract(state, codes[device])
- println("Turned off " .. device)
- else
- state = colors.combine(state, codes[device])
- println("Turned on " .. device)
- end
- end
- redstone.setBundledOutput(side, state)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement