Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --# load the Touchpoint API
- loadup = function()
- shell.run("pastebin", "get", "h2qXpRLG", "touchpoint")
- os.loadAPI("touchpoint")
- print("Touchpoint API Loaded")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- end
- loadup()
- --# Redstone Cable Bug
- function colours.subtract(cols, ...)
- for i = 1, #arg do
- if bit.band(cols, arg[i]) == arg[i] then
- cols = cols - arg[i]
- end
- end
- return cols
- end
- colors.subtract = colours.subtract
- --# intialize a new button set on the top monitor
- local t = touchpoint.new("front")
- --# rs.setBundledOutput WHITE.
- function WhiteAction()
- t:toggleButton("Power")
- rs.setBundledOutput("back", (colors.test(rs.getBundledOutput("back"), colors.white) and colors.subtract(rs.getBundledOutput("back"), colors.white) or colors.combine(rs.getBundledOutput("back"), colors.white)))
- end
- --# Main Function.
- buttonLoads = function()
- t:add("Lights", nil, 1, 1, 7, 1, colors.black, colors.black)
- t:add("Power", WhiteAction, 2, 2, 6, 4, colors.red, colors.lime)
- t:draw()
- end
- buttonLoads()
- t:run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement