Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- o = colors.orange
- w = colors.white
- p = colors.purple
- mon = peripheral.find("monitor")
- dLib = require("DisplayLib")
- function toggleBlaze()
- c = colors.combine(o,p,w)
- if rs.getBundledOutput("bottom") == c then
- rs.setBundledOutput("bottom", 0)
- dLib.drawButton(screen, colors.white, colors.red, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
- else
- rs.setBundledOutput("bottom", c)
- dLib.drawButton(screen, colors.white, colors.green, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
- end
- end
- mon.clear()
- screen = dLib.initDisplay(mon)
- dLib.drawButton(screen, colors.white, colors.red, 2,2,7,3,3,3,"Blaze", toggleBlaze, mon)
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- if screen[x][y] ~= nil then
- screen[x][y]()
- end
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement