Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local oldState = rs.getBundledInput("front")
- local colName = {"White", "Orange", "Magenta", "Light Blue", "Yellow", "Lime", "Pink", "Grey", "Light Grey", "Cyan", "Purple", "Blue", "Brown", "Green", "Red", "Black"}
- print("Online")
- repeat
- local event, p1 = os.pullEvent()
- if event == "redstone" then
- local curState, checkCol = rs.getBundledInput("front"), 1
- for i = 1, 16 do
- local curOn, oldOn = colours.test(curState, checkCol), colours.test(oldState, checkCol)
- if curOn and not oldOn then
- print(colName[i] .. " turned on.")
- elseif not curOn and oldOn then
- print(colName[i] .. " turned off.")
- end
- checkCol = checkCol * 2
- end
- oldState = curState
- end
- until event == "key" and p1 == keys.x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement