Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("bottom") -- Change "bottom" if your monitor is on a different side
- monitor.setTextScale(3.0) -- Adjust text size (0.5 - 5.0)
- monitor.setTextColor(colors.white) -- Set text color to blue
- monitor.setBackgroundColor(colors.blue) -- Set background color to white
- monitor.clear()
- local message = " Hostile Networks "
- local width, height = monitor.getSize() -- Get monitor dimensions
- local centerY = math.floor(height / 2) -- Center the text vertically
- -- Create a padded message: pad on both sides with spaces (length = monitor width)
- local pad = string.rep(" ", width)
- local paddedMessage = pad .. message .. pad
- local paddedLength = #paddedMessage
- while true do
- -- Loop from the far right of the padded message back to the start
- for offset = paddedLength - width + 1, 1, -1 do
- local display = string.sub(paddedMessage, offset, offset + width - 1)
- monitor.setCursorPos(1, centerY)
- monitor.clearLine() -- Clear only the current line
- monitor.write(display)
- sleep(0.2) -- Adjust the scrolling speed here
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment