I do not know if this is the right place for this post, but I cannot find one that really fits, so I will just post it here and if need be it can be moved.
I have been working on a CC program that should scroll text from top to bottom and vice versa. I have been having trouble with it as I cannot quite figure out what if any portion of the code changes the text orientation. The code I am using and would like to have looked at is below.
term.clear()
term.setCursorPos(1,1)
term.setTextColor(8192)
print("Displaying text...")
mon = peripheral.wrap("back")
mon.setTextScale(4)
mon.setTextColor(16)
mon.setBackgroundColor(1024)
strtpos = 12
speed = .2
text = "message here"
pos = strtpos
poslimit = 0 - strtpos
while true do
mon.clear()
mon.setCursorPos(pos, 1)
mon.write(text)
sleep(speed)
if pos == poslimit then
pos = strtpos
else
pos = pos - 1
end
end
Thanks for the help!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have been working on a CC program that should scroll text from top to bottom and vice versa. I have been having trouble with it as I cannot quite figure out what if any portion of the code changes the text orientation. The code I am using and would like to have looked at is below.
term.clear() term.setCursorPos(1,1) term.setTextColor(8192) print("Displaying text...") mon = peripheral.wrap("back") mon.setTextScale(4) mon.setTextColor(16) mon.setBackgroundColor(1024) strtpos = 12 speed = .2 text = "message here" pos = strtpos poslimit = 0 - strtpos while true do mon.clear() mon.setCursorPos(pos, 1) mon.write(text) sleep(speed) if pos == poslimit then pos = strtpos else pos = pos - 1 end endThanks for the help!