Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local txt = "Lockdown"
- monitor_side = "back"
- modem_side = "left"
- mon = peripheral.wrap(monitor_side)
- mon.setTextScale(3)
- x, y = mon.getSize()
- function writeCenter(text)
- return (x-string.len(text))/2 + 1
- end
- function m_write(text,color)
- mon.setBackgroundColor(color)
- mon.clear()
- mon.setCursorPos(writeCenter(text),2)
- mon.write(text)
- end
- local run = true
- local currentColor = colors.green
- m_write(txt,currentColor)
- while(run) do
- side, monX, monY = os.pullEvent("monitor_touch")
- if(currentColor == colors.green) then
- currentColor = colors.red
- else
- currentColor = colors.green
- end
- m_write(txt,currentColor)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement