Scrolling text, ping keeps showing

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Haxs4Life
Posts: 13
Joined: 02 Jan 2015 23:43
Contact:

Scrolling text, ping keeps showing

#1 Post by Haxs4Life » 20 Feb 2015 17:00

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

AiroNG
Posts: 46
Joined: 17 Nov 2013 15:00
Location: Germany

Re: Scrolling text, ping keeps showing

#2 Post by AiroNG » 20 Feb 2015 17:38

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:\>

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Scrolling text, ping keeps showing

#3 Post by Squashman » 20 Feb 2015 18:06

And use a FOR /L instead of hardcoding everything.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Scrolling text, ping keeps showing

#4 Post by foxidrive » 20 Feb 2015 19:13

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

Haxs4Life
Posts: 13
Joined: 02 Jan 2015 23:43
Contact:

Re: Scrolling text, ping keeps showing

#5 Post by Haxs4Life » 20 Feb 2015 22:16

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.

Post Reply