Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("right")
- local cableSide = "back"
- local white = colors.white
- local orange = colors.orange
- local red = colors.red
- local function drawScreen()
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- monitor.setCursorPos(3, 1)
- monitor.setTextScale(1)
- monitor.setBackgroundColor(colors.blue)
- monitor.setTextColor(colors.white)
- monitor.write("[CRAFTING TERMINAL]")
- monitor.setCursorPos(3, 3)
- monitor.setTextScale(1)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 1 ]")
- monitor.setCursorPos(10, 3)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 2 ]")
- monitor.setCursorPos(17, 3)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 3 ]")
- monitor.setCursorPos(3, 6)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 4 ]")
- monitor.setCursorPos(10, 6)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 5 ]")
- monitor.setCursorPos(17, 6)
- monitor.setBackgroundColor(colors.red)
- monitor.setTextColor(colors.white)
- monitor.write("[ 6 ]")
- end
- drawScreen()
- while true do
- local event, side, x, y = os.pullEvent("monitor_touch")
- if x >= 3 and x <= 8 and y == 3 then
- rs.setBundledOutput(cableSide, white, true)
- elseif x >= 10 and x <= 15 and y == 3 then
- rs.setBundledOutput(cableSide, white, false)
- elseif x >= 17 and x <= 22 and y == 3 then
- rs.setBundledOutput(cableSide, orange, true)
- elseif x >= 3 and x <= 8 and y == 6 then
- rs.setBundledOutput(cableSide, orange, false)
- elseif x >= 10 and x <= 15 and y == 6 then
- rs.setBundledOutput(cableSide, red, true)
- elseif x >= 17 and x <= 22 and y == 6 then
- rs.setBundledOutput(cableSide, red, false)
- end
- drawScreen()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement