User User name Password  
   
Sunday 24.11.2024 / 11:47
Search AfterDawn Forums:        In English   Suomeksi   På svenska
afterdawn.com > forums > software, operating systems and more > windows - general discussion > slow down echo in batch file
Show topics
 
Forums
Forums
Slow Down Echo in Batch File
  Jump to:
 
Posted Message
Member
_
21. June 2009 @ 05:14 _ Link to this message    Send private message to this user   
Im trying to write this little code to drop on my girl's computer but it moves way too fast!!

@echo off
:place1
color 04
echo...........8888888.. ..8888888..
echo........8:::::::::::8. .8:::::::::::8.
echo......8:::::::::::::::8:::::::::::::::8.
echo.....8:::::::::::::::::::::::::::::::::8.
echo....8:::::::::::::::::::::::::::::::::::8
echo....8::::::::::/` \/ `\:::::::::::::::::8
echo....8::::::::::\ /` \/ `\:::::::::::8
echo....'8::::::::::\ /\ /::::::::::8'
echo.....'8::::::::::\/:::\ /.::::::::::8'
echo......'8:::::::::::::::\/::::::::::::8'
echo........'8:::::::::::::::::::::::::8'
echo..........'8:::::::::::::::::::::8'
echo............'8:::::::::::::::::8' two hearts
echo...............'8:::::::::::8' beat as one...
echo..................'8:::::8'
echo.....................'8'
goto place1


Thats the code

Anyone know how I can slow it down?
Advertisement
_
__
Junior Member
_
21. June 2009 @ 10:01 _ Link to this message    Send private message to this user   
Hi truehaven

That's really sweet...

Unfortunately, command prompt has no integrated wait or sleep command, which makes us rely on other means, of which includes... PING!

Try this:


@echo off 

:place1
color 04
echo...........8888888.. ..8888888..
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo........8:::::::::::8. .8:::::::::::8.
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo......8:::::::::::::::8:::::::::::::::8.
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo.....8:::::::::::::::::::::::::::::::::8.
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo....8:::::::::::::::::::::::::::::::::::8
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo....8::::::::::/` \/ `\:::::::::::::::::8
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo....8::::::::::\ /` \/ `\:::::::::::8
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo....'8::::::::::\ /\ /::::::::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo.....'8::::::::::\/:::\ /.::::::::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo......'8:::::::::::::::\/::::::::::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo........'8:::::::::::::::::::::::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo..........'8:::::::::::::::::::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo............'8:::::::::::::::::8' two hearts
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo...............'8:::::::::::8' beat as one...
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo..................'8:::::8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
echo.....................'8'
PING 1.1.1.1 -n 1 -w 0.5 >NUL
goto place1

What I did was add PING 1.1.1.1 -n 1 -w 0.5 >NUL in between each line, which makes a wait of 0.5 milliseconds before each line is portrayed. You can change 0.5 to any amount of milliseconds you would like.

Bet she'll be touched!

Best Regards :D

Do not mess in my affairs; you are crunchy and taste good with ketchup.
The greatest advantage you can have over someone is to know their name.
Success is relative; the more success the more relatives.
A computer once beat me at chess, but it was no match for me at kickboxing.


∂αякηιgнт
Member
_
21. June 2009 @ 16:30 _ Link to this message    Send private message to this user   
Thanks haha!!
Thats awesome :D
Member
_
21. June 2009 @ 16:33 _ Link to this message    Send private message to this user   
It works perfectly!
Thanks a bunch man!
I've only just started playing around with cmd and .bat files so I'm still learning :)
Advertisement
_
__
 
_
Junior Member
_
22. June 2009 @ 08:36 _ Link to this message    Send private message to this user   
You're welcome! CMD is a great way to start to learn programming, and its really really useful too!

Best Regards :D

Do not mess in my affairs; you are crunchy and taste good with ketchup.
The greatest advantage you can have over someone is to know their name.
Success is relative; the more success the more relatives.
A computer once beat me at chess, but it was no match for me at kickboxing.


∂αякηιgнт
afterdawn.com > forums > software, operating systems and more > windows - general discussion > slow down echo in batch file
 

Digital video: AfterDawn.com | AfterDawn Forums
Music: MP3Lizard.com
Gaming: Blasteroids.com | Blasteroids Forums | Compare game prices
Software: Software downloads
Blogs: User profile pages
RSS feeds: AfterDawn.com News | Software updates | AfterDawn Forums
International: AfterDawn in Finnish | AfterDawn in Swedish | AfterDawn in Norwegian | download.fi
Navigate: Search | Site map
About us: About AfterDawn Ltd | Advertise on our sites | Rules, Restrictions, Legal disclaimer & Privacy policy
Contact us: Send feedback | Contact our media sales team
 
  © 1999-2024 by AfterDawn Ltd.

  IDG TechNetwork