This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Slow print? [Lua]
Started by Drsirdeath, 23 July 2012 - 01:28 PMPosted 23 July 2012 - 03:28 PM
Can i make a monitor slowly print text?
Posted 23 July 2012 - 03:43 PM
use this function :)/>/>
example:
function monitorsp(text,monitor)
for x=1,string.len(text) do
char = string.sub(text,x,x)
monitor.write(char)
sleep(0.2) -- change this to change the print delay
end
end
to print the text to the monitorexample:
disp = peripheral.wrap("side")
monitorsp("this is a slowprint test",disp)
Posted 24 July 2012 - 02:59 AM
textutils.slowPrint("Test")
Posted 24 July 2012 - 03:48 AM
Make a file with this
textutils.slowPrint("TEXT_HERE")
Save, Exit, then type
monitor <DIRECTION> <FILE_WITH_THAT_CODE>
textutils.slowPrint("TEXT_HERE")
Save, Exit, then type
monitor <DIRECTION> <FILE_WITH_THAT_CODE>
Posted 24 July 2012 - 11:57 AM
textutils.slowPrint("Test")
problem is u have to call it outside of code or use shell.run() which is an extra step to do something when u can just use my function inside of your program code :)/>/>Make a file with this
textutils.slowPrint("TEXT_HERE")
Save, Exit, then type
monitor <DIRECTION> <FILE_WITH_THAT_CODE>
Posted 24 July 2012 - 12:34 PM
Your point? Its just printing thing on screen, you could do it in lua prompt also.
Posted 24 July 2012 - 12:52 PM
he wants to print on a monitorYour point? Its just printing thing on screen, you could do it in lua prompt also.
Posted 24 July 2012 - 12:56 PM
You are creating a function.
Why not just do
Why not just do
side = "" -- Side here
mon = peripheral.wrap(side)
term.redirect(mon) -- Beginning
textutils.slowPrint("Blahblahblah") -- Spaced because of beginning and end
term.restore() -- End
Posted 24 July 2012 - 02:00 PM
because i dont like the way that term.redirect() worksYou are creating a function.
Why not just doside = "" -- Side here mon = peripheral.wrap(side) term.redirect(mon) -- Beginning textutils.slowPrint("Blahblahblah") -- Spaced because of beginning and end term.restore() -- End
Posted 25 July 2012 - 01:24 AM
textutils.slowPrint("Test")
Thanks for all the help guys but this one i found worked fine!
Posted 25 July 2012 - 04:55 AM
@Kolpa
Have you tried it -.-
It works.
You don't need to do mon.write( "" )
Have you tried it -.-
It works.
You don't need to do mon.write( "" )