Re: Clever EU Coder Needed

new topic     » topic index » view thread      » older message » newer message

Sure man!
Here you go!

global procedure type_string(sequence str,atom speed)
-- Type a string The X-Files style!
object t, key
for i = 1 to length(str) do
key = get_key()
if key = 's' then
        puts(1,str[i..length(str)])
        exit
end if
        if str[i] = '\n' then
                        t = time()
                        while (t+(speed*4)) >= time() do
                        end while
        end if
puts(1,str[i])
t = time()
while (t+speed) >= time() do
end while
end for
end procedure



'speed' is the time in seconds to wait between each
character typed. When a newline is encountered, 4
times that time is waited.
When 's' is pressed during typing, everything is typed
out at once and the procedure returns.
Try it out with:
type_string("This is a test...\nPlease
ignore...\n",0.5)

Mike The Spike
PS. How's that for 'skill' ?

--- ck lester <cklester at YAHOO.COM> wrote:
> I need a function where I can pass lines of text
> separated by '\n' and it
> will "type" them out to the screen (slowly, as
> though on one of those
> ancient computers). After each line, it should pause
> for 1-4 seconds as
> though the computer was processing heavily behind
> the scenes. Also, in the
> midst of all this, if the user presses 's' (to
> skip), it needs to just shoot
> ALL the text out to screen.
>
> I'm going to rework what I've already got, but maybe
> somebody here can come
> up with something clever.
>
> Thanks!
> ck
>
>
>
_________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at
> http://mail.yahoo.com
>


__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu