Page 1 of 1

Scrolling text, ping keeps showing

Posted: 20 Feb 2015 17:00
by Haxs4Life
OK, so i'm coding a simple rpg kinda game. At the beginning I have the games name in large letters displayed on the screen with the type command, and then I have it clear the screen and retype the letters/image but every time its down 1 more(For a text scrolling effect). But my problem is i'm using the ping command so it doesn't just fly through the scroll, but goes slow, but when I do this it keeps showing the ping message. And yes I have @echo off , yet it still doesn't seem to be working. My code for the scrolling text section is down below.

P.S: The reason the @echo off is after every cls, is because I thought maybe it was turning echo back on after every cls, for some damn reason..It was just a thought though, doubt that is the problem.

Code: Select all

:CWAScroll
Echo.
cls
@echo off
Type CWA_Scroll.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll1.txt
ping -n 2 1 -w 2000 localhost
cls
@echo off
Type CWA_Scroll2.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll3.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll4.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll5.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll6.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll7.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll8.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll9.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll10.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll11.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll12.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll13.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll14.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll15.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll16.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll17.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll18.txt
ping -n 2 -w 2000 localhost
cls
@echo off
Type CWA_Scroll19.txt
ping -n 2 -w 2000 localhost
echo.
cls


Thanks for helping, in advance, -Haxs4Lyfe

Re: Scrolling text, ping keeps showing

Posted: 20 Feb 2015 17:38
by AiroNG
You can use ">nul" to hide the whole ping-output.

Code: Select all

ping localhost -n 2 >nul


result:

Code: Select all

C:\>ping localhost -n 2 >nul && echo: Test
 Test

C:\>

Re: Scrolling text, ping keeps showing

Posted: 20 Feb 2015 18:06
by Squashman
And use a FOR /L instead of hardcoding everything.

Re: Scrolling text, ping keeps showing

Posted: 20 Feb 2015 19:13
by foxidrive
As Squashman suggests and using AeroNG's nul plus your ping parameters but with "" : (after you rename the first file with a numeral too to CWA_Scroll0.txt )

Code: Select all

:CWAScroll
cls
for /L %%a in (0,1,19) do Type CWA_Scroll%%a.txt & ping -n 2 -w 2000 "">nul & cls

Re: Scrolling text, ping keeps showing

Posted: 20 Feb 2015 22:16
by Haxs4Life
wooow...I feel soo fricken dumb now! XD I completely forgot about >nul, or for statements XD its been too long, my goodness..
Thanks guys, you helped allot.