Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.find("monitor")
- mon.clear()
- mon.setCursorPos(3,2)
- mon.setTextScale(5)
- mon.setBackgroundColor(colors.black)
- function scrollText(tStrings, nRate)
- nRate = nRate or 5
- if nRate < 0 then
- error("rate must be positive")
- end
- local nSleep = 1 / nRate
- width, height = mon.getSize()
- x, y = mon.getCursorPos()
- sText = ""
- for n = 1, #tStrings do
- sText = sText .. tostring(tStrings[n])
- sText = sText .. " | "
- end
- sString = "| "
- if width / string.len(sText) < 1 then
- nStringRepeat = 3
- else
- nStringRepeat = math.ceil(width / string.len(sText) * 3)
- end
- for n = 1, nStringRepeat do
- sString = sString .. sText
- end
- while true do
- for n = 1, string.len(sText) do
- sDisplay = string.sub(sString, n, n + width - 1)
- mon.clearLine()
- mon.setCursorPos(1, y)
- mon.setBackgroundColor(colors.lightGray)
- mon.write(sDisplay)
- mon.setBackgroundColor(colors.black)
- sleep(nSleep)
- end
- end
- end
- mon.write("Attention")
- mon.setCursorPos(4,6)
- mon.write("DANGER")
- mon.setCursorPos(1,4)
- scrollText({"Industrial Craft","Centre de test"},3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement