Batch File: Typewriter Effect

后端 未结 4 1453
無奈伤痛
無奈伤痛 2020-12-06 23:38

I just got some code to do this effect, but I need to it to type faster, like a letter every half a second.

for %%i in (h e l l o o o o o o o o o o o o o o)          


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 23:41

    Just give a try for this code : Message Typewriter + Speaking Voice

    @echo off
    Title Typewriter with speaking voice by Hackoo 2016
    Color 0A & Mode con cols=70 lines=3
    set Msg="This is only a testing string to see if my script really works or not?"
    Call :Typewriter %Msg%
    set Msg="              What are you doing now dude ?"
    Call :Typewriter %Msg%
    set Msg="         I want to say Hello for everybody on StackOverflow !"
    Call :Typewriter %Msg%
    pause>nul
    Exit /b
    ::*********************************************************************
    :TypeWriter
    Cls
    echo(
    (
    echo strText=wscript.arguments(0^)
    echo intTextLen = Len(strText^)
    echo intPause = 150
    echo For x = 1 to intTextLen
    echo     strTempText = Mid(strText,x,1^)
    echo     WScript.StdOut.Write strTempText
    echo     WScript.Sleep intPause
    echo Next
    echo Set Voice=CreateObject("SAPI.SpVoice"^)
    echo voice.speak strText
    )>%tmp%\%~n0.vbs
    @cScript.EXE /noLogo "%tmp%\%~n0.vbs" "%~1"
    exit /b
    ::********************************************************************* 
    

提交回复
热议问题