Jump to content




How to use slow print?


6 replies to this topic

#1 EmTeaKay

  • Members
  • 115 posts

Posted 02 April 2012 - 11:25 PM

How do I use slow print? Or whatever it is called. It's like print except it does it slowly. Can someone help me out?

#2 cant_delete_account

  • Members
  • 484 posts

Posted 02 April 2012 - 11:59 PM

Do: textutils.slowPrint("par1Str") where "par1Str" is the text you want it to slowly print.

#3 virtualayu

  • New Members
  • 31 posts

Posted 08 April 2012 - 03:10 AM

or you can do "oldschool" ^^ like
write("H")
sleep(0,1)
write("e")
sleep(0,1)
write("l")
sleep(0,1)
write("l")
sleep(0,1)
write("o")

but it's a lot of code ^^

#4 kamnxt

  • New Members
  • 80 posts

Posted 08 April 2012 - 10:39 AM

You can also set the speed.
speed = 5
string = "A string!"
textutils.slowPrint(string, speed)


#5 multitrym

  • New Members
  • 1 posts

Posted 29 June 2012 - 01:10 AM

You can also shortcut it.
function sprint(text)
textutils.slowPrint(text)
end
Type that at the top, when you want a slowprint just type:
sprint "Insert text here!"


#6 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 29 June 2012 - 01:20 AM

View Postmultitrym, on 29 June 2012 - 01:10 AM, said:

You can also shortcut it.
function sprint(text)
textutils.slowPrint(text)
end
Type that at the top, when you want a slowprint just type:
sprint "Insert text here!"
Even shorter:
local sprint = textutils.slowPrint

sprint("Text Here")
And you can use the time parameter:
sprint("Text", 3)


#7 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 29 June 2012 - 04:46 PM

Or you can code your own function. Like this:
function slowPrint(text, time)
    for i = 1, text:len() do
	    io.write(text:sub(i, i))
	    sleep(time)
    end
    io.write("n")
end

slowPrint("Hello, World!", .5)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users