Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = term
- t.sCP = t.setCursorPos
- t.w = t.write
- t.clear()
- t.sCP(1, 1)
- print("This program is provided by KingofGamesYami for personal use, please do not distribute. If your program is not working, check that you are using the correct syntax. If you use the scroll function, you must hold down control+t to stop the program. Press any key to continue")
- os.pullEvent(key)
- sleep(0.1)
- t.clear()
- t.sCP(1, 1)
- t.w("Side: ") --side of your monitor
- local side = string.lower(read())
- if side == "top" or side == "right" or side == "left" or side == "back" or side == "bottom" or side == "front" then --check side is valid
- --do nothing
- else
- print("Invalid side!")
- sleep(10)
- os.shutdown()
- end
- m = peripheral.wrap(side)
- m.clear()
- m.setCursorPos(1, 1)
- t.sCP(1, 2)
- t.w("Text Color: ") --Color of text
- local input = string.lower(read())
- local tcolor
- if (colors[input] and type(colors[input]) == "number") or (colours[input] and type(colours[input]) == "number") then
- tcolor = colors[input] or colours[input]
- elseif tonumber(input) then
- tcolor = tonumber(input)
- else
- print("Not a number or color!")
- sleep(10)
- os.shutdown()
- end
- m.setTextColor(tcolor)
- t.sCP(1, 3)
- t.w("Background Color: ")
- local input = string.lower(read())
- local bcolor
- if (colors[input] and type(colors[input]) == "number") or (colours[input] and type(colours[input]) == "number") then
- bcolor = colors[input] or colours[input]
- elseif tonumber(input) then
- bcolor = tonumber(input)
- else
- print("Not a number or color!")
- sleep(10)
- os.shutdown()
- end
- m.setBackgroundColor(bcolor) --Set Background Color
- m.clear()
- t.sCP(1, 4)
- t.w("Text Size: ") --Size of Text (1 - 5)
- local size = tonumber(read())
- if tonumber(size) == nil then --is number?
- print("Thats not a number!")
- sleep(10)
- os.shutdown()
- elseif size >= 0.5 and size <= 5 then --check size is valid
- --do nothing
- else
- print("Your size isn't within the limits... 0.5 - 5")
- sleep(10)
- os.shutdown()
- end
- m.setTextScale(size)
- t.sCP(1, 5)
- t.w("Text: ") --Text that will be printed
- local stuff = read()
- t.sCP(1, 6) --Scroll
- t.w("Would you like your text to scroll?: ")
- local scroll = string.lower(read())
- if scroll == "yes" then
- t.sCP(1, 7)
- t.w("Speed: ")
- speed = tonumber(read())
- local tlen = string.len(stuff)
- local mwidth, mheight = m.getSize()
- if mheight/2 == 0.5 then
- mheight = 2
- end
- local tpos = mwidth
- while true do --loop
- if tpos == 0-tlen then --reset position
- tpos = mwidth
- end
- m.clear()
- m.setCursorPos(tpos, mheight/2)
- m.write(stuff)
- tpos = tpos-1
- os.sleep(0.5/speed)
- end
- elseif scroll == "no" then
- sleep(0.1)
- else
- print("Invalid answer, use yes or no")
- sleep(10)
- os.shutdown()
- end
- t.redirect(m)
- print(stuff)
- t.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement