Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The text to show on the monitor
- local tText = {
- "FOOD STAMPS ACCEPTED CIGS AND MALT LIQUOR OUT OF STOCK SPRITE CRANBERRY ONLY"
- }
- -- The side the monitor is on
- local sSide = "right"
- -- The text scale
- local nTextScale = 5
- local function printScroll(mon, t)
- local w, h = mon.getSize()
- local scroll = 1
- local maxLen
- for i, line in ipairs(t) do
- if not maxLen or #line > maxLen then
- maxLen = #line
- end
- end
- while true do
- mon.clear()
- for i, line in ipairs(t) do
- mon.setCursorPos(w - scroll, i)
- mon.write(line)
- end
- scroll = scroll + 1
- if scroll >= w + maxLen then
- scroll = 1
- end
- sleep(0.15)
- end
- end
- term.clear()
- term.setCursorPos(1, 1)
- print("Scrolling text on the monitor...")
- local mon = peripheral.wrap(sSide)
- mon.setTextScale(nTextScale)
- printScroll(mon, tText, sx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement