This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Drsirdeath's profile picture

Slow print? [Lua]

Started by Drsirdeath, 23 July 2012 - 01:28 PM
Drsirdeath #1
Posted 23 July 2012 - 03:28 PM
Can i make a monitor slowly print text?
Kolpa #2
Posted 23 July 2012 - 03:43 PM
use this function :)/>/>

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 monitor
example:

disp = peripheral.wrap("side")
monitorsp("this is a slowprint test",disp)
flaminsnowman99 #3
Posted 24 July 2012 - 02:59 AM

textutils.slowPrint("Test")
Noodle #4
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>
Kolpa #5
Posted 24 July 2012 - 11:57 AM

textutils.slowPrint("Test")
Make a file with this
textutils.slowPrint("TEXT_HERE")

Save, Exit, then type
monitor <DIRECTION> <FILE_WITH_THAT_CODE>
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 :)/>/>
Noodle #6
Posted 24 July 2012 - 12:34 PM
Your point? Its just printing thing on screen, you could do it in lua prompt also.
Kolpa #7
Posted 24 July 2012 - 12:52 PM
Your point? Its just printing thing on screen, you could do it in lua prompt also.
he wants to print on a monitor
Noodle #8
Posted 24 July 2012 - 12:56 PM
You are creating a function.
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
Kolpa #9
Posted 24 July 2012 - 02:00 PM
You are creating a function.
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
because i dont like the way that term.redirect() works
Drsirdeath #10
Posted 25 July 2012 - 01:24 AM

textutils.slowPrint("Test")

Thanks for all the help guys but this one i found worked fine!
Noodle #11
Posted 25 July 2012 - 04:55 AM
@Kolpa
Have you tried it -.-
It works.
You don't need to do mon.write( "" )