Jump to content

Recommended Posts

Posted (edited)

Hello, i have a problem, im doing a little text-based game in command prompt, but i dont know how to make the text what was written before delete. Anybody knows how to do it? I attached the .txt file of the game, details in the file. And i need an command in style of "use this 100 times then go on with the next command" too. So if anybody knows, please tell me. Thanks

Hra 2.0.txt

Edited by knize002

Posted

I didn't look over your file but generally speaking, you delete text on a character display by writing over printing characters with blanks.

-Noel

Posted

What about CLS?

http://ss64.com/nt/cls.html
As a side note;

I KNOW THAT I COULD DO IT LIKE :
:b
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%
goto b
BUT IT WONT STOP IF I DO IT LIKE THAT, SO I HAD TO DO IT THAT STYLE.
IF ANYBODY OF YOU KNOWS HOW TO DO LIKE "WRITE IT 100 TIMES THEN GO ON THE NEXT COMMAND" PLEASE TELL ME

it is a simple FOR /L loop

FOR /L %%A IN (1,1,100) DO (
ECHO something
)

jaclaz

Posted (edited)

@jaclaz Thanks, i looked over the link you sent, and thats it. I tried it out and it works. Thanks!

(sorry, i messed up, i thought NoelC sent me the link )
 

Edited by knize002
Posted

@jaclaz i found myself the ss64.com and i looked in cmd for help too, but i still dont know which variable to use. I couldnt find any list of them.

Posted

@jaclaz Ok, so i used %%i for the parameter and it worked. But can i somehow change the speed of it? I wanted it for the "Matrix effect", but its too fast. When i used the infinite looping :a echo ... goto a it wasnt that fast and it created the "Matrix effect" better. But it was infinite. So if i could somehow decrease the speed....

Posted

Ok, so i managed the "Matrix effect". I used the FOR looping, but i used less times in the command, and i stack the command so it went a bit slower. Like this:
FOR /L %%i IN(1,1,20) DO echo %random%....
FOR /L %%i IN(1,1,20) DO echo %random%....
FOR /L %%i IN(1,1,20) DO echo %random%....
FOR /L %%i IN(1,1,20) DO echo %random%....
etc.

Thanks for helping guys!

Posted

Well, you can introduce a delay between the execution of the commands, *any* command without a definite output to the console would do.

Usually a "ping to to self" is used, but to just slow down a little bit a loop, you can also insert another FOR /L loop

FOR /L %%A IN (1,1,100) DO (

echo %random%

FOR /L %%B IN (1,1,10) DO (

echo %random%>NUL

)

)

jaclaz
 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...