基于文本的冒险帮助和提示 [英] text based adventure help and tips
问题描述
我决定做一个基于文本的冒险,我意识到,我不知道很多有关决策之一。我这样做,但是,要知道我想一个批处理文件,使之,只是因为我觉得它更容易使用和分享。我没有太多的问题,但现在我敢肯定,我会拿出更多的随着时间的推移(如果我决定以此为乐),但现在我有两个问题:
-
你如何使线条看起来好像有人在打字呢?
-
你怎么才去到下一个流程(您知道戏剧效果),使该行等待x秒
修改我忘了,我需要与抱歉帮助脚本(它应该看起来像黑客帝国唤醒新屏幕上,但我不能得到的间隔小于2或隐藏在平文本下面)。
回音^ h
PING 127.0.0.1 -n 2
CLS
他回音
PING 127.0.0.1 -n 2
CLS
回声HEL
PING 127.0.0.1 -n 2
CLS
回声地狱
PING 127.0.0.1 -n 2
CLS
你好回声
PING 127.0.0.1 -n 3
CLS
回声你好。
PING 127.0.0.1 -n 3
CLS
回声你好..
PING 127.0.0.1 -n 3
CLS
回声喂...
PING 127.0.0.1 -n 5
等待/延迟 [来源] 一>
PING 127.0.0.1 -n 6'NUL
5秒延迟
- 如何工作的:6平的回声,它们之间默认为1秒钟的暂停环回IP 。
-
-n
不能小于2或会有没有延迟。
延迟< 1秒
PING 10.1.1.1 -n 1 -w 200 GT; NUL
200毫秒的延迟使用专用IP地址和超时标志 -w
。 (使用此方法时只调整 -w
值和离开 -n
为1)
大入门资源
示例
下面是一个例子键入程序将打印出消息的每个字符每个字符间200ms的延迟。
关闭@echo
拨打:输入你好......
退出/ B 0:打字<消息>
SETLOCAL
集消息=%〜1
:TypingLoop
平10.1.1.1 -n 1 -w 200 GT; NUL
< NUL集/ P=%消息:〜0.1%
集消息=%消息:〜1%。
如果定义的消息转到TypingLoop
ENDLOCAL
退出/ B 0
I decided to make a text based adventure and I realized I didn't know much about making one. I do, however, know that I want to make it with a batch file, just because I think it is easier to work with and share. I don't have many questions right now but I'm sure I'll come up with more as time goes on (if I decide this is fun) but right now I have two questions:
How do you make lines appear as if someone was typing it?
How do you make the line wait x seconds before going to the next process (you know for "dramatic effect")
edit I forgot to put the script that I need help with sorry (it's supposed to look like the "wake up neo" screen from The Matrix but I cant get the intervals smaller than 2 or hide the ping text underneath).
echo h
PING 127.0.0.1 -n 2
cls
echo he
PING 127.0.0.1 -n 2
cls
echo hel
PING 127.0.0.1 -n 2
cls
echo hell
PING 127.0.0.1 -n 2
cls
echo hello
PING 127.0.0.1 -n 3
cls
echo hello.
PING 127.0.0.1 -n 3
cls
echo hello..
PING 127.0.0.1 -n 3
cls
echo hello...
PING 127.0.0.1 -n 5
Wait/Delay [Source]
PING 127.0.0.1 -n 6 >nul
5 Second Delay
- How it Works: 6 ping echos with default 1 second pause between them with loopback ip.
-n
cannot be less than 2 or there will be no delay.
Delay < 1 Second
PING 10.1.1.1 -n 1 -w 200 >nul
200 Millisecond Delay by using a Private IP Address and the timeout flag -w
. ( only adjust the -w
value and leave -n
as 1 when using this method )
Great Getting Started Resources
Example
Here is an example Typing routine that will print out each character of the message with a 200ms delay between each character.
@echo off
call :Typing "hello..."
exit /b 0
:Typing <Message>
setlocal
set "Message=%~1"
:TypingLoop
ping 10.1.1.1 -n 1 -w 200 >nul
<nul set /p "=%Message:~0,1%"
set "Message=%Message:~1%"
if defined Message goto TypingLoop
endlocal
exit /b 0
这篇关于基于文本的冒险帮助和提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!