Batch File: Typewriter Effect

后端 未结 4 1406
無奈伤痛
無奈伤痛 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:50

    Pinging 0.0.0.0 gives PING: transmit failed. General failure error message nearly immediately.

    (Edited according to suggestive rojo's comment)

    Better to ping some address returning Request timed out message chosen from a Private-Use Network range.

    for %%i in (h e l l o o o o o o o o o o o o o o) do (
       set /p a=%%inul 2>&1
    )
    

    Here:

    • a.b.c.d = address returning Request timed out message, see (*) below.

    • -4 = force using IPv4.

    • -n 1 = number of echo requests to send (one).

    • -w 500 = timeout in milliseconds to wait for each reply (500=1/2 sec); this should work to cca 5 seconds (approximate time for one unsuccesfull echo request).

    (*) The following IPv4 address ranges have been reserved by the IANA for private internets, and are not publicly routable on the global internet:

     10.0.0.0     --   10.255.255.255  (10/8       prefix)
     172.16.0.0   --   172.31.255.255  (172.16/12  prefix)
     192.168.0.0  --   192.168.255.255 (192.168/16 prefix)
    

提交回复
热议问题